Loading quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java +7 −3 Original line number Diff line number Diff line Loading @@ -18,13 +18,17 @@ package com.android.quickstep; import com.android.launcher3.ui.AbstractLauncherUiTest; import org.junit.Rule; import org.junit.rules.RuleChain; import org.junit.rules.TestRule; /** * Base class for all instrumentation tests that deal with Quickstep. */ public abstract class AbstractQuickStepTest extends AbstractLauncherUiTest { @Rule public TestRule mNavigationModeSwitcher = new NavigationModeSwitchRule(mLauncher); @Override protected TestRule getRulesInsideActivityMonitor() { return RuleChain. outerRule(new NavigationModeSwitchRule(mLauncher)). around(super.getRulesInsideActivityMonitor()); } } tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +11 −6 Original line number Diff line number Diff line Loading @@ -65,8 +65,8 @@ import com.android.launcher3.util.rule.ShellCommandRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.rules.RuleChain; import org.junit.rules.TestRule; import org.junit.rules.TestWatcher; import org.junit.runners.model.Statement; import java.io.IOException; Loading Loading @@ -94,7 +94,8 @@ public abstract class AbstractLauncherUiTest { protected MainThreadExecutor mMainThreadExecutor = new MainThreadExecutor(); protected final UiDevice mDevice = UiDevice.getInstance(getInstrumentation()); protected final LauncherInstrumentation mLauncher; protected final LauncherInstrumentation mLauncher = new LauncherInstrumentation(getInstrumentation()); protected Context mTargetContext; protected String mTargetPackage; Loading @@ -105,11 +106,9 @@ public abstract class AbstractLauncherUiTest { throw new RuntimeException(e); } if (TestHelpers.isInLauncherProcess()) Utilities.enableRunningInTestHarnessForTests(); mLauncher = new LauncherInstrumentation(getInstrumentation()); } @Rule public LauncherActivityRule mActivityMonitor = new LauncherActivityRule(); protected final LauncherActivityRule mActivityMonitor = new LauncherActivityRule(); @Rule public ShellCommandRule mDefaultLauncherRule = Loading Loading @@ -163,8 +162,14 @@ public abstract class AbstractLauncherUiTest { } } : base; protected TestRule getRulesInsideActivityMonitor() { return new FailureWatcher(this); } @Rule public TestWatcher mFailureWatcher = new FailureWatcher(this); public TestRule mOrderSensitiveRules = RuleChain. outerRule(mActivityMonitor). around(getRulesInsideActivityMonitor()); public UiDevice getDevice() { return mDevice; Loading Loading
quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java +7 −3 Original line number Diff line number Diff line Loading @@ -18,13 +18,17 @@ package com.android.quickstep; import com.android.launcher3.ui.AbstractLauncherUiTest; import org.junit.Rule; import org.junit.rules.RuleChain; import org.junit.rules.TestRule; /** * Base class for all instrumentation tests that deal with Quickstep. */ public abstract class AbstractQuickStepTest extends AbstractLauncherUiTest { @Rule public TestRule mNavigationModeSwitcher = new NavigationModeSwitchRule(mLauncher); @Override protected TestRule getRulesInsideActivityMonitor() { return RuleChain. outerRule(new NavigationModeSwitchRule(mLauncher)). around(super.getRulesInsideActivityMonitor()); } }
tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +11 −6 Original line number Diff line number Diff line Loading @@ -65,8 +65,8 @@ import com.android.launcher3.util.rule.ShellCommandRule; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.rules.RuleChain; import org.junit.rules.TestRule; import org.junit.rules.TestWatcher; import org.junit.runners.model.Statement; import java.io.IOException; Loading Loading @@ -94,7 +94,8 @@ public abstract class AbstractLauncherUiTest { protected MainThreadExecutor mMainThreadExecutor = new MainThreadExecutor(); protected final UiDevice mDevice = UiDevice.getInstance(getInstrumentation()); protected final LauncherInstrumentation mLauncher; protected final LauncherInstrumentation mLauncher = new LauncherInstrumentation(getInstrumentation()); protected Context mTargetContext; protected String mTargetPackage; Loading @@ -105,11 +106,9 @@ public abstract class AbstractLauncherUiTest { throw new RuntimeException(e); } if (TestHelpers.isInLauncherProcess()) Utilities.enableRunningInTestHarnessForTests(); mLauncher = new LauncherInstrumentation(getInstrumentation()); } @Rule public LauncherActivityRule mActivityMonitor = new LauncherActivityRule(); protected final LauncherActivityRule mActivityMonitor = new LauncherActivityRule(); @Rule public ShellCommandRule mDefaultLauncherRule = Loading Loading @@ -163,8 +162,14 @@ public abstract class AbstractLauncherUiTest { } } : base; protected TestRule getRulesInsideActivityMonitor() { return new FailureWatcher(this); } @Rule public TestWatcher mFailureWatcher = new FailureWatcher(this); public TestRule mOrderSensitiveRules = RuleChain. outerRule(mActivityMonitor). around(getRulesInsideActivityMonitor()); public UiDevice getDevice() { return mDevice; Loading