OSDN Git Service

Spun off Autofill PERF tests on its own package...
authorFelipe Leme <felipeal@google.com>
Fri, 4 May 2018 18:26:41 +0000 (11:26 -0700)
committerFelipe Leme <felipeal@google.com>
Fri, 4 May 2018 18:42:46 +0000 (11:42 -0700)
...so bugs on it (like starving the UI Thread) don't impact other tests

Test: mmma -j ./frameworks/base/apct-tests/perftests/autofill/ && \
  adb install -r $OUT/data/app/AutofillPerfTests/AutofillPerfTests.apk && \
  adb shell am instrument -w -e class android.view.autofill.LoginTest \
  com.android.perftests.autofill/android.support.test.runner.AndroidJUnitRunner

Bug: 38345816

Change-Id: I76346f1d1c45790788400fcd9765f6b424d99f4c

apct-tests/perftests/autofill/Android.mk [new file with mode: 0644]
apct-tests/perftests/autofill/AndroidManifest.xml [new file with mode: 0644]
apct-tests/perftests/autofill/AndroidTest.xml [new file with mode: 0644]
apct-tests/perftests/autofill/res/layout/autofill_dataset_picker_text_only.xml [moved from apct-tests/perftests/core/res/layout/autofill_dataset_picker_text_only.xml with 100% similarity]
apct-tests/perftests/autofill/res/layout/test_autofill_login.xml [moved from apct-tests/perftests/core/res/layout/test_autofill_login.xml with 100% similarity]
apct-tests/perftests/autofill/src/android/view/autofill/AbstractAutofillPerfTestCase.java [moved from apct-tests/perftests/core/src/android/view/autofill/AbstractAutofillPerfTestCase.java with 99% similarity]
apct-tests/perftests/autofill/src/android/view/autofill/LoginTest.java [moved from apct-tests/perftests/core/src/android/view/autofill/LoginTest.java with 99% similarity]
apct-tests/perftests/autofill/src/android/view/autofill/MyAutofillCallback.java [moved from apct-tests/perftests/core/src/android/view/autofill/MyAutofillCallback.java with 100% similarity]
apct-tests/perftests/autofill/src/android/view/autofill/MyAutofillService.java [moved from apct-tests/perftests/core/src/android/view/autofill/MyAutofillService.java with 99% similarity]

diff --git a/apct-tests/perftests/autofill/Android.mk b/apct-tests/perftests/autofill/Android.mk
new file mode 100644 (file)
index 0000000..28555a0
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright (C) 2018 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.
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+    android-support-test \
+    androidx.annotation_annotation \
+    apct-perftests-utils
+
+LOCAL_PACKAGE_NAME := AutofillPerfTests
+LOCAL_PRIVATE_PLATFORM_APIS := true
+
+LOCAL_COMPATIBILITY_SUITE += device-tests
+
+include $(BUILD_PACKAGE)
diff --git a/apct-tests/perftests/autofill/AndroidManifest.xml b/apct-tests/perftests/autofill/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..e706a32
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 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.android.perftests.autofill">
+
+    <application>
+        <uses-library android:name="android.test.runner" />
+        <activity android:name="android.perftests.utils.StubActivity">
+          <intent-filter>
+            <action android:name="com.android.perftests.core.PERFTEST" />
+          </intent-filter>
+        </activity>
+
+        <service
+            android:name="android.view.autofill.MyAutofillService"
+            android:label="PERF AutofillService"
+            android:permission="android.permission.BIND_AUTOFILL_SERVICE" >
+            <intent-filter>
+                <action android:name="android.service.autofill.AutofillService" />
+            </intent-filter>
+        </service>
+
+    </application>
+
+    <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
+        android:targetPackage="com.android.perftests.autofill"/>
+</manifest>
diff --git a/apct-tests/perftests/autofill/AndroidTest.xml b/apct-tests/perftests/autofill/AndroidTest.xml
new file mode 100644 (file)
index 0000000..29f9f94
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 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.
+-->
+<configuration description="Runs AutofillPerfTests metric instrumentation.">
+    <option name="test-suite-tag" value="apct" />
+    <option name="test-suite-tag" value="apct-metric-instrumentation" />
+    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+        <option name="cleanup-apks" value="true" />
+        <option name="test-file-name" value="AutofillPerfTests.apk" />
+    </target_preparer>
+
+    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
+        <option name="package" value="com.android.perftests.autofill" />
+        <option name="hidden-api-checks" value="false"/>
+    </test>
+</configuration>
@@ -28,7 +28,7 @@ import android.support.test.filters.LargeTest;
 import android.support.test.rule.ActivityTestRule;
 import android.support.test.InstrumentationRegistry;
 
-import com.android.perftests.core.R;
+import com.android.perftests.autofill.R;
 
 import java.util.Locale;
 import java.util.Collection;
@@ -28,7 +28,7 @@ import android.perftests.utils.StubActivity;
 import android.provider.Settings;
 import android.support.test.rule.ActivityTestRule;
 import android.support.test.InstrumentationRegistry;
-import com.android.perftests.core.R;
+import com.android.perftests.autofill.R;
 
 import java.util.Locale;
 import java.util.Collection;
@@ -30,7 +30,7 @@ import android.widget.RemoteViews;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 
-import com.android.perftests.core.R;
+import com.android.perftests.autofill.R;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -46,7 +46,7 @@ public class MyAutofillService extends AutofillService {
     private static final String TAG = "MyAutofillService";
     private static final int TIMEOUT_MS = 5000;
 
-    private static final String PACKAGE_NAME = "com.android.perftests.core";
+    private static final String PACKAGE_NAME = "com.android.perftests.autofill";
     static final String COMPONENT_NAME = PACKAGE_NAME + "/android.view.autofill.MyAutofillService";
 
     private static final BlockingQueue<FillRequest> sFillRequests = new LinkedBlockingQueue<>();