summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-18 22:54:44 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-18 22:54:44 +0000
commitcdd4b2aeba65f4448d812e984ddd9062315ed917 (patch)
tree22a12fa5809f7554d5a8ae047fcdd3df881d3db9
parent9f48337e645ec53c6d45ac84cd0c367af1f55630 (diff)
parent441fc4daccb93f7ab9177d3ddcb69a2f8e9f3262 (diff)
downloadplatform_testing-cdd4b2aeba65f4448d812e984ddd9062315ed917.tar.gz
Add a generic microbenchmark for opening apps. am: 441fc4dacc
Change-Id: Ic3c7e94c9e3aeb9826bb6e202bc47ad8bdf93f53
-rw-r--r--tests/health/scenarios/tests/Android.bp1
-rw-r--r--tests/health/scenarios/tests/src/android/platform/test/scenario/generic/OpenAppMicrobenchmark.java37
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/health/scenarios/tests/Android.bp b/tests/health/scenarios/tests/Android.bp
index 69b1ff149..9ac9a3782 100644
--- a/tests/health/scenarios/tests/Android.bp
+++ b/tests/health/scenarios/tests/Android.bp
@@ -50,6 +50,7 @@ java_library_static {
"guava",
"longevity-device-lib",
"microbenchmark-device-lib",
+ "platform-test-options",
"platform-test-rules",
],
}
diff --git a/tests/health/scenarios/tests/src/android/platform/test/scenario/generic/OpenAppMicrobenchmark.java b/tests/health/scenarios/tests/src/android/platform/test/scenario/generic/OpenAppMicrobenchmark.java
new file mode 100644
index 000000000..8e950beb2
--- /dev/null
+++ b/tests/health/scenarios/tests/src/android/platform/test/scenario/generic/OpenAppMicrobenchmark.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2019 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 android.platform.test.scenario.generic;
+
+import android.platform.test.microbenchmark.Microbenchmark;
+import android.platform.test.rule.CompilationFilterRule;
+import android.platform.test.rule.DropCachesRule;
+import android.platform.test.rule.KillAppsRule;
+import android.platform.test.rule.PressHomeRule;
+
+import org.junit.Rule;
+import org.junit.rules.RuleChain;
+import org.junit.runner.RunWith;
+
+@RunWith(Microbenchmark.class)
+public class OpenAppMicrobenchmark extends OpenApp {
+ // Method-level rules
+ @Rule
+ public RuleChain rules =
+ RuleChain.outerRule(new KillAppsRule(mPkgOption.get()))
+ .around(new DropCachesRule())
+ .around(new CompilationFilterRule(mPkgOption.get()))
+ .around(new PressHomeRule());
+}