Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c6cff24 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enabling quick switch test" into ub-launcher3-master

parents 05a3a0b8 db185f6b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.quickstep;

import static com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName;
import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
import static com.android.launcher3.util.rule.TestStabilityRule.UNBUNDLED_POSTSUBMIT;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -40,6 +42,7 @@ import com.android.launcher3.tapl.Overview;
import com.android.launcher3.tapl.OverviewTask;
import com.android.launcher3.tapl.TestHelpers;
import com.android.launcher3.ui.TaplTestsLauncher3;
import com.android.launcher3.util.rule.TestStabilityRule;
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
import com.android.quickstep.views.RecentsView;

@@ -268,7 +271,8 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
    @Test
    @NavigationModeSwitch
    @PortraitLandscape
    @Ignore // b/143285809
    // b/143285809 Remove @Stability on 02/21/20 if the test doesn't flake.
    @TestStabilityRule.Stability(flavors = LOCAL | UNBUNDLED_POSTSUBMIT)
    public void testQuickSwitchFromApp() throws Exception {
        startTestActivity(2);
        startTestActivity(3);
+6 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.os.SystemClock;
import android.view.MotionEvent;

import androidx.annotation.NonNull;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.UiObject2;

import com.android.launcher3.testing.TestProtocol;
@@ -179,9 +180,12 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
                    endX = startX;
                    endY = 0;
                }
                final boolean launcherIsVisible =
                        mLauncher.hasLauncherObject(By.textStartsWith(""));
                final boolean isZeroButton = mLauncher.getNavigationModel()
                        == LauncherInstrumentation.NavigationModel.ZERO_BUTTON;
                mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState,
                        mLauncher.getNavigationModel()
                                == LauncherInstrumentation.NavigationModel.ZERO_BUTTON
                        launcherIsVisible && isZeroButton
                                ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE
                                : LauncherInstrumentation.GestureScope.OUTSIDE
                );
+1 −1
Original line number Diff line number Diff line
@@ -797,7 +797,7 @@ public final class LauncherInstrumentation {
        return mDevice.hasObject(getLauncherObjectSelector(resId));
    }

    private boolean hasLauncherObject(BySelector selector) {
    boolean hasLauncherObject(BySelector selector) {
        return mDevice.hasObject(makeLauncherSelector(selector));
    }