Keep ViewCaptureRule logic self-contained.

This will make it easier for other apps / processes to integrate the
ViewCapture logic into their integrated testing frameworks.

Bug: 270158224
Test: Verified that a zip file was generated properly and was able to be
loaded into go/web-hv properly.

Change-Id: Ib3e4a0b60497937b750126590071884882b22917
This commit is contained in:
Stefan Andonian
2023-05-23 23:44:39 +00:00
parent f898ee474c
commit eec7a9d90f
4 changed files with 81 additions and 64 deletions

View File

@@ -216,11 +216,10 @@ public abstract class AbstractLauncherUiTest {
}
protected TestRule getRulesInsideActivityMonitor() {
final ViewCaptureRule viewCaptureRule = new ViewCaptureRule();
final RuleChain inner = RuleChain
.outerRule(new PortraitLandscapeRunner(this))
.around(viewCaptureRule)
.around(new FailureWatcher(mDevice, mLauncher, viewCaptureRule.getViewCapture()));
.around(new ViewCaptureRule())
.around(new FailureWatcher(mDevice, mLauncher));
return TestHelpers.isInLauncherProcess()
? RuleChain.outerRule(ShellCommandRule.setDefaultLauncher()).around(inner)