Permalink
Browse files

add launch performance test for 3D gallery

Change-Id: Ib1c74297b9d5bf63232da29546612e6fbae55ba9
  • Loading branch information...
1 parent c11af96 commit 8768def39fee86f0535adadf7b60f32d7821a88e Guang Zhu committed Jun 15, 2010
Showing with 92 additions and 0 deletions.
  1. +18 −0 tests/Android.mk
  2. +29 −0 tests/AndroidManifest.xml
  3. +45 −0 tests/src/com/cooliris/media/Gallery3DLauncher.java
View
@@ -0,0 +1,18 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+# We only want this apk build for tests.
+LOCAL_MODULE_TAGS := tests
+LOCAL_CERTIFICATE := media
+
+LOCAL_JAVA_LIBRARIES := android.test.runner
+
+# Include all test java files.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := Gallery3DTests
+
+LOCAL_INSTRUMENTATION_FOR := Gallery3D
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.cooliris.media.tests">
+
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <instrumentation android:name="com.cooliris.media.Gallery3DLauncher"
+ android:targetPackage="com.cooliris.media"
+ android:label="Gallery3D Launch Performance">
+ </instrumentation>
+
+</manifest>
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.cooliris.media;
+
+import android.app.Activity;
+import android.test.LaunchPerformanceBase;
+import android.os.Bundle;
+
+/**
+ * Instrumentation class for DeskClock launch performance testing.
+ */
+public class Gallery3DLauncher extends LaunchPerformanceBase {
+
+ @Override
+ public void onCreate(Bundle arguments) {
+ super.onCreate(arguments);
+
+ mIntent.setClassName(getTargetContext(), "com.cooliris.media.Gallery");
+ start();
+ }
+
+ /**
+ * Calls LaunchApp and finish.
+ */
+ @Override
+ public void onStart() {
+ super.onStart();
+ LaunchApp();
+ finish(Activity.RESULT_OK, mResults);
+ }
+}

0 comments on commit 8768def

Please sign in to comment.