Added ViewCapture to all tests which implement AbstractLauncherUiTest.

This enables developers to watch failed tests in classes like
TaplTestsQuickstep in the go/web-hv tool.

Bug: 242867462
Test: Failed a test and verified that the TimeLapse bugreport entry
showed up properly in the go/web-hv tool.

Change-Id: Ic89af2a0e7102db52c52ddc668607a81c4809ed6
This commit is contained in:
Stefan Andonian
2023-04-21 19:05:47 +00:00
parent 4d559a6c92
commit fa8091661a
7 changed files with 115 additions and 13 deletions
@@ -62,6 +62,7 @@ import com.android.launcher3.util.rule.FailureWatcher;
import com.android.launcher3.util.rule.SamplerRule;
import com.android.launcher3.util.rule.ScreenRecordRule;
import com.android.launcher3.util.rule.TestStabilityRule;
import com.android.launcher3.util.rule.ViewCaptureRule;
import com.android.quickstep.views.RecentsView;
import org.junit.After;
@@ -115,10 +116,12 @@ public class FallbackRecentsTest {
Utilities.enableRunningInTestHarnessForTests();
}
final ViewCaptureRule viewCaptureRule = new ViewCaptureRule();
mOrderSensitiveRules = RuleChain
.outerRule(new SamplerRule())
.around(new NavigationModeSwitchRule(mLauncher))
.around(new FailureWatcher(mDevice, mLauncher));
.around(viewCaptureRule)
.around(new FailureWatcher(mDevice, mLauncher, viewCaptureRule.getViewCapture()));
mOtherLauncherActivity = context.getPackageManager().queryIntentActivities(
getHomeIntentInPackage(context),