Making the default launcher rule outer for the Portrait-Landscape one
Portrait-Landscape uses Launcher activity and needs it to be set up
correctly.
Change-Id: I13c9712647b3e45a259039d7968bb95cfe8158ef
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index bb19515..4243ed0 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -123,10 +123,6 @@
protected final LauncherActivityRule mActivityMonitor = new LauncherActivityRule();
@Rule
- public ShellCommandRule mDefaultLauncherRule =
- TestHelpers.isInLauncherProcess() ? ShellCommandRule.setDefaultLauncher() : null;
-
- @Rule
public ShellCommandRule mDisableHeadsUpNotification =
ShellCommandRule.disableHeadsUpNotification();
@@ -154,9 +150,13 @@
}
protected TestRule getRulesInsideActivityMonitor() {
- return RuleChain.
- outerRule(new PortraitLandscapeRunner(this)).
- around(new FailureWatcher(mDevice));
+ final RuleChain inner = RuleChain.outerRule(new PortraitLandscapeRunner(this))
+ .around(new FailureWatcher(mDevice));
+
+ return TestHelpers.isInLauncherProcess()
+ ? RuleChain.outerRule(ShellCommandRule.setDefaultLauncher())
+ .around(inner) :
+ inner;
}
@Rule