diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-24 07:27:23 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-24 07:27:23 +0000 |
commit | cfd0b0464d78edd16e791399febf7384ad08b4eb (patch) | |
tree | 1e7c79ca6c55f277ba808d5941a4527f090ca451 | |
parent | 5b6fb5f166524914b52fa28f9d5366f514b72f99 (diff) | |
parent | c625d35f53ad1ce220d6eedbb7681cf4369fdda5 (diff) | |
download | platform_testing-cfd0b0464d78edd16e791399febf7384ad08b4eb.tar.gz |
Snap for 4801384 from c625d35f53ad1ce220d6eedbb7681cf4369fdda5 to pi-release
Change-Id: I6a1f3473d5c3acf8861ae31179350978a263cf33
-rw-r--r-- | tests/jank/UbSystemUiJankTests/src/android/platform/systemui/tests/jank/SystemUiJankTests.java | 49 |
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", |