Merge "Verifying the event for pressing square button" into ub-launcher3-master

This commit is contained in:
TreeHugger Robot
2020-01-29 19:01:56 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.UserEventDispatcher;
import com.android.launcher3.model.AppLaunchTracker;
import com.android.launcher3.provider.RestoreDbTask;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.TraceHelper;
@@ -144,6 +145,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
@BinderThread
@Override
public void onOverviewToggle() {
TestLogging.recordEvent("onOverviewToggle");
mOverviewCommandHelper.onOverviewToggle();
}

View File

@@ -37,6 +37,7 @@ import java.util.regex.Pattern;
*/
public class Background extends LauncherInstrumentation.VisibleContainer {
private static final int ZERO_BUTTON_SWIPE_UP_GESTURE_DURATION = 500;
private static final Pattern SQUARE_BUTTON_EVENT = Pattern.compile("onOverviewToggle");
Background(LauncherInstrumentation launcher) {
super(launcher);
@@ -129,6 +130,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
}
case THREE_BUTTON:
mLauncher.expectEvent(SQUARE_BUTTON_EVENT);
mLauncher.runToState(
() -> mLauncher.waitForSystemUiObject("recent_apps").click(),
OVERVIEW_STATE_ORDINAL);
@@ -189,8 +191,10 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
case THREE_BUTTON:
// Double press the recents button.
UiObject2 recentsButton = mLauncher.waitForSystemUiObject("recent_apps");
mLauncher.expectEvent(SQUARE_BUTTON_EVENT);
mLauncher.runToState(() -> recentsButton.click(), OVERVIEW_STATE_ORDINAL);
mLauncher.getOverview();
mLauncher.expectEvent(SQUARE_BUTTON_EVENT);
recentsButton.click();
break;
}