Restoring starting capturing existing activity.

ag/24138143 made the rule to produce empty captures in many cases.

ag/24138143 aimed to fix a leak that was caused by a local var
alreadyOpenActivity still referring the activity when the leak check
executes.

Fixing that by moving the variable to a method startCapturingExistingActivity.

Bug: 291638593
Test: local, presubmit
Flag: N/A
Change-Id: I281202488c6c85e2e2c5b5b3300e26d808167104
This commit is contained in:
Vadim Tryshev committed 2023-07-24 19:09:48 +00:00
1 parent 6eb4af3f45
commit 101ea3e4e5
3 files changed
+17 -3

No files matched your search

@@ -201,7 +201,8 @@ public abstract class AbstractLauncherUiTest {
}
protected TestRule getRulesInsideActivityMonitor() {
final ViewCaptureRule viewCaptureRule = new ViewCaptureRule();
final ViewCaptureRule viewCaptureRule = new ViewCaptureRule(
Launcher.ACTIVITY_TRACKER::getCreatedActivity);
final RuleChain inner = RuleChain
.outerRule(new PortraitLandscapeRunner(this))
.around(new FailureWatcher(mLauncher, viewCaptureRule::getViewCaptureData))