Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3884)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java

Issue 2431833002: customtabs: Re-Create a spare renderer on Tab close. (Closed)
Patch Set: Make FindBugs happy. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
index 11399477672866f4e1742ae5c1d0f4f5605c3aa9..29f1f048abb2e30e6db6e1e71c9a88b5e70c7683 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -54,6 +54,7 @@ import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.TabsOpenedFromExternalAppTest;
+import org.chromium.chrome.browser.WarmupManager;
import org.chromium.chrome.browser.appmenu.AppMenuHandler;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
import org.chromium.chrome.browser.metrics.PageLoadMetrics;
@@ -1146,6 +1147,35 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
});
}
+ @SmallTest
+ @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ public void testRecreateSpareRendererOnTabClose() throws Exception {
+ Context context = getInstrumentation().getTargetContext().getApplicationContext();
+ warmUpAndWait();
+
+ try {
+ startCustomTabActivityWithIntent(
+ CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage));
+ } catch (InterruptedException e) {
+ fail();
+ }
+
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ assertFalse(WarmupManager.getInstance().hasSpareWebContents());
+ final CustomTabActivity activity = (CustomTabActivity) getActivity();
+ activity.finishAndClose(false);
+ }
+ });
+ CriteriaHelper.pollUiThread(new Criteria("No new spare renderer") {
+ @Override
+ public boolean isSatisfied() {
+ return WarmupManager.getInstance().hasSpareWebContents();
+ }
+ }, 2000, 200);
+ }
+
/**
* Tests that prerendering accepts a referrer, and that this is not lost when launching the
* Custom Tab.
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698