Avoid firing activity if not necessary in IncognitoDataTestUtils.
IncognitoDataTestUtils#launchUrlInTab is called when we want to load a URL in Chrome tabbed activity. This chrome tabbed activity is fired once in the setUp method of the incognito leakage tests and in subsequent calls to the launchUrlInTab method. The reason for firing activity in the launchUrlInTab method is to bring back the ChromeTabbedActivity (which was fired in the setUp method), if the previous activity fired was of type CustomTabActivity. To make the code more readable no checks were introduced and chrome tabbed activity was fired un-conditionally. However due to this we have some instances were the application was killed due to memory pressure. This CL adds the check to fire a ChromeTabbedActivity only if the previous activity which was fired was CustomTabbedActivity. Bug: 1081748, 1084709, 1035770 Change-Id: I1a232c44767821af17de2d7a859b4ecab50dbc91 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213525 Commit-Queue: Rohit Agarwal <roagarwal@chromium.org> Reviewed-by:Peter Conn <peconn@chromium.org> Cr-Commit-Position: refs/heads/master@{#772595}
Showing
Please register or sign in to comment