OSDN Git Service

add launch performance test for browser
authorGuang Zhu <guangzhu@google.com>
Thu, 1 Apr 2010 18:21:43 +0000 (11:21 -0700)
committerGuang Zhu <guangzhu@google.com>
Thu, 1 Apr 2010 18:21:43 +0000 (11:21 -0700)
this is part of a larger effort to collect app launch performance for the platform.

Change-Id: Id7159c67b0d746c9a109988e05f53be6a10921af

tests/AndroidManifest.xml
tests/src/com/android/browser/BrowserLaunchPerformance.java [new file with mode: 0644]

index 51715a9..cb1ffc7 100644 (file)
@@ -34,4 +34,9 @@
                      android:targetPackage="com.android.browser"
                      android:label="Tests for Browser."/>
 
+    <instrumentation android:name="com.android.browser.BrowserLaunchPerformance"
+        android:targetPackage="com.android.browser"
+        android:label="Browser Launch Performance">
+    </instrumentation>
+
 </manifest>
diff --git a/tests/src/com/android/browser/BrowserLaunchPerformance.java b/tests/src/com/android/browser/BrowserLaunchPerformance.java
new file mode 100644 (file)
index 0000000..c5d4279
--- /dev/null
@@ -0,0 +1,26 @@
+package com.android.browser;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.test.LaunchPerformanceBase;
+
+public class BrowserLaunchPerformance extends LaunchPerformanceBase {
+
+    @Override
+    public void onCreate(Bundle arguments) {
+        super.onCreate(arguments);
+
+        mIntent.setClassName(getTargetContext(), "com.android.browser.BrowserActivity");
+        start();
+    }
+
+    /**
+     * Calls LaunchApp and finish.
+     */
+    @Override
+    public void onStart() {
+        super.onStart();
+        LaunchApp();
+        finish(Activity.RESULT_OK, mResults);
+    }
+}