diff options
author | Vadim Tryshev <vadimt@google.com> | 2018-09-13 14:56:49 -0700 |
---|---|---|
committer | Vadim Tryshev <vadimt@google.com> | 2018-09-13 14:56:49 -0700 |
commit | ee598ada7995e6797298617efad2dac42fb73bab (patch) | |
tree | 9bb706897deb5d4a96ab563ce495307a002370b4 /tests | |
parent | abbf01b782f8b9c00d7defd2b04183fca1855752 (diff) | |
download | packages_apps_Trebuchet-ee598ada7995e6797298617efad2dac42fb73bab.tar.gz packages_apps_Trebuchet-ee598ada7995e6797298617efad2dac42fb73bab.tar.bz2 packages_apps_Trebuchet-ee598ada7995e6797298617efad2dac42fb73bab.zip |
Adding logging to debug jank test problems
Bug: 110103162
Test: TaplTests
Change-Id: I0bae4f2242031ebcdbb24638f61a6b8d37b162e2
Diffstat (limited to 'tests')
4 files changed, 16 insertions, 3 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java b/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java index dd286bd1f..42817c1af 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java +++ b/tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java @@ -17,9 +17,9 @@ package com.android.launcher3.tapl; import android.graphics.Point; -import androidx.test.uiautomator.UiObject2; import androidx.annotation.NonNull; +import androidx.test.uiautomator.UiObject2; /** * Operations on AllApps opened from Overview. @@ -44,6 +44,7 @@ public final class AllAppsFromOverview extends AllApps { allAppsContainer, "search_container_all_apps"); final Point start = qsb.getVisibleCenter(); final int endY = (int) (mLauncher.getDevice().getDisplayHeight() * 0.6); + LauncherInstrumentation.log("AllAppsFromOverview.switchBackToOverview before swipe"); mLauncher.swipe(start.x, start.y, start.x, endY); return new Overview(mLauncher); diff --git a/tests/tapl/com/android/launcher3/tapl/AppIcon.java b/tests/tapl/com/android/launcher3/tapl/AppIcon.java index 17bf5fcec..ea47503eb 100644 --- a/tests/tapl/com/android/launcher3/tapl/AppIcon.java +++ b/tests/tapl/com/android/launcher3/tapl/AppIcon.java @@ -43,6 +43,7 @@ public final class AppIcon { * Clicks the icon to launch its app. */ public Background launch() { + LauncherInstrumentation.log("AppIcon.launch before click"); LauncherInstrumentation.assertTrue( "Launching an app didn't open a new window: " + mIcon.getText(), mIcon.clickAndWait(Until.newWindow(), LauncherInstrumentation.WAIT_TIME_MS)); diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 434e421b6..441fc65bd 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -24,6 +24,7 @@ import android.app.UiAutomation; import android.os.Bundle; import android.os.Parcelable; import android.provider.Settings; +import android.util.Log; import android.view.accessibility.AccessibilityEvent; import androidx.annotation.NonNull; @@ -47,6 +48,8 @@ import java.util.concurrent.TimeoutException; */ public final class LauncherInstrumentation { + private static final String TAG = "Tapl"; + // Types for launcher containers that the user is interacting with. "Background" is a // pseudo-container corresponding to inactive launcher covered by another app. enum ContainerType { @@ -119,6 +122,10 @@ public final class LauncherInstrumentation { return mSwipeUpEnabledOverride != null ? mSwipeUpEnabledOverride : mSwipeUpEnabled; } + static void log(String message) { + Log.d(TAG, message); + } + private static void fail(String message) { Assert.fail("http://go/tapl : " + message); } @@ -144,6 +151,7 @@ public final class LauncherInstrumentation { } private UiObject2 verifyContainerType(ContainerType containerType) { + log("verifyContainerType: " + containerType); switch (containerType) { case WORKSPACE: { waitUntilGone(APPS_RES_ID); diff --git a/tests/tapl/com/android/launcher3/tapl/Overview.java b/tests/tapl/com/android/launcher3/tapl/Overview.java index db0e6c5db..9841274d6 100644 --- a/tests/tapl/com/android/launcher3/tapl/Overview.java +++ b/tests/tapl/com/android/launcher3/tapl/Overview.java @@ -17,14 +17,14 @@ package com.android.launcher3.tapl; import android.graphics.Point; + +import androidx.annotation.NonNull; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; import java.util.Collections; import java.util.List; -import androidx.annotation.NonNull; - /** * Overview pane. */ @@ -46,6 +46,7 @@ public final class Overview extends LauncherInstrumentation.VisibleContainer { */ public void flingForward() { final UiObject2 overview = verifyActiveContainer(); + LauncherInstrumentation.log("Overview.flingForward before fling"); overview.fling(Direction.LEFT, DEFAULT_FLING_SPEED); mLauncher.waitForIdle(); verifyActiveContainer(); @@ -56,6 +57,7 @@ public final class Overview extends LauncherInstrumentation.VisibleContainer { */ public void flingBackward() { final UiObject2 overview = verifyActiveContainer(); + LauncherInstrumentation.log("Overview.flingBackward before fling"); overview.fling(Direction.RIGHT, DEFAULT_FLING_SPEED); mLauncher.waitForIdle(); verifyActiveContainer(); @@ -95,6 +97,7 @@ public final class Overview extends LauncherInstrumentation.VisibleContainer { // Swipe from navbar to the top. final UiObject2 navBar = mLauncher.getSystemUiObject("navigation_bar_frame"); final Point start = navBar.getVisibleCenter(); + LauncherInstrumentation.log("Overview.switchToAllApps before swipe"); mLauncher.swipe(start.x, start.y, start.x, 0); return new AllAppsFromOverview(mLauncher); |