summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-05-23 22:51:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-05-23 22:51:01 +0000
commitc625d35f53ad1ce220d6eedbb7681cf4369fdda5 (patch)
tree1e7c79ca6c55f277ba808d5941a4527f090ca451
parent2f8afb481e2fe5282e65de96f0cd4e523514bc0f (diff)
parenta0982886b84d4bc7dde92b6754df3c935dd5b262 (diff)
downloadplatform_testing-c625d35f53ad1ce220d6eedbb7681cf4369fdda5.tar.gz
Merge "Improve SystemUIJankTest for Notification scrolling performance" into pi-dev
-rw-r--r--tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java b/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java
index 5e015c071..0ed5a21ae 100644
--- a/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java
+++ b/tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java
@@ -377,6 +377,20 @@ public class SystemUiJankTests extends JankTestBase {
}
}
+ private void scrollListUp() {
+ mDevice.swipe(mDevice.getDisplayWidth() / 2,
+ mDevice.getDisplayHeight() / 2, mDevice.getDisplayWidth() / 2,
+ 0,
+ DEFAULT_SCROLL_STEPS);
+ }
+
+ private void scrollListDown() {
+ mDevice.swipe(mDevice.getDisplayWidth() / 2,
+ mDevice.getDisplayHeight() / 2, mDevice.getDisplayWidth() / 2,
+ mDevice.getDisplayHeight(),
+ DEFAULT_SCROLL_STEPS);
+ }
+
private void swipeDown() {
mDevice.swipe(mDevice.getDisplayWidth() / 2,
SWIPE_MARGIN, mDevice.getDisplayWidth() / 2,
@@ -421,6 +435,41 @@ public class SystemUiJankTests extends JankTestBase {
}
}
+ public void beforeNotificationListScroll() throws Exception {
+ prepareNotifications(GROUP_MODE_UNGROUPED);
+ mDevice.waitForIdle();
+ TimeResultLogger.writeTimeStampLogStart(String.format("%s-%s",
+ getClass().getSimpleName(), getName()), TIMESTAMP_FILE);
+ swipeDown();
+ mDevice.waitForIdle();
+ }
+
+ public void afterNotificationListScroll(Bundle metrics) throws Exception {
+ TimeResultLogger.writeTimeStampLogEnd(String.format("%s-%s",
+ getClass().getSimpleName(), getName()), TIMESTAMP_FILE);
+ cancelNotifications();
+ mDevice.waitForIdle();
+ swipeUp();
+ mDevice.waitForIdle();
+ TimeResultLogger.writeResultToFile(String.format("%s-%s",
+ getClass().getSimpleName(), getName()), RESULTS_FILE, metrics);
+ super.afterTest(metrics);
+ }
+
+ /** Measures jank while scrolling notification list */
+ @JankTest(expectedFrames = 100,
+ defaultIterationCount = 5,
+ beforeTest = "beforeNotificationListScroll", afterTest = "afterNotificationListScroll")
+ @GfxMonitor(processName = SYSTEMUI_PACKAGE)
+ public void testNotificationListScroll() {
+ for (int i = 0; i < INNER_LOOP; i++) {
+ scrollListUp();
+ mDevice.waitForIdle();
+ scrollListDown();
+ mDevice.waitForIdle();
+ }
+ }
+
public void beforeNotificationListPull_manyNotifications() throws Exception {
prepareNotifications(GROUP_MODE_UNGROUPED);
TimeResultLogger.writeTimeStampLogStart(String.format("%s-%s",