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

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

Issue 2100013004: M52 fix2 for "Allowing prerendering on cellular also disables throttling." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | « no previous file | 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/CustomTabsConnectionTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java
index 05b142bd36fa584338c78c36f705df71bcf8884b..abf7f8c339cb87475a6f9030043dee7cc7918d05 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java
@@ -463,8 +463,7 @@ public class CustomTabsConnectionTest extends InstrumentationTestCase {
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
public void testBanningWorks() {
mCustomTabsConnection.ban(mContext, Process.myUid());
- final CustomTabsSessionToken token =
- CustomTabsSessionToken.createDummySessionTokenForTesting();
+ final ICustomTabsCallback token = new CustomTabsTestUtils.DummyCallback();
assertTrue(mCustomTabsConnection.newSession(token));
assertTrue(mCustomTabsConnection.mayLaunchUrl(token, Uri.parse(URL), null, null));
@@ -472,8 +471,10 @@ public class CustomTabsConnectionTest extends InstrumentationTestCase {
@Override
public void run() {
assertSpareWebContentsNotNullAndDestroy();
- String referrer = mCustomTabsConnection.getReferrerForSession(token).getUrl();
- assertNull(mCustomTabsConnection.takePrerenderedUrl(token, URL, referrer));
+ String referrer = mCustomTabsConnection.getReferrerForSession(
+ token.asBinder()).getUrl();
+ assertNull(
+ mCustomTabsConnection.takePrerenderedUrl(token.asBinder(), URL, referrer));
}
});
}
@@ -482,19 +483,19 @@ public class CustomTabsConnectionTest extends InstrumentationTestCase {
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
public void testBanningDisabledForCellular() {
mCustomTabsConnection.ban(mContext, Process.myUid());
- final CustomTabsSessionToken token =
- CustomTabsSessionToken.createDummySessionTokenForTesting();
+ final ICustomTabsCallback token = new CustomTabsTestUtils.DummyCallback();
assertTrue(mCustomTabsConnection.newSession(token));
- mCustomTabsConnection.setShouldPrerenderOnCellularForSession(token, true);
+ mCustomTabsConnection.setShouldPrerenderOnCellularForSession(token.asBinder(), true);
assertTrue(mCustomTabsConnection.mayLaunchUrl(token, Uri.parse(URL), null, null));
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
assertNull(mCustomTabsConnection.takeSpareWebContents());
- String referrer = mCustomTabsConnection.getReferrerForSession(token).getUrl();
+ String referrer = mCustomTabsConnection.getReferrerForSession(
+ token.asBinder()).getUrl();
WebContents prerender = mCustomTabsConnection.takePrerenderedUrl(
- token, URL, referrer);
+ token.asBinder(), URL, referrer);
assertNotNull(prerender);
prerender.destroy();
}
@@ -504,9 +505,9 @@ public class CustomTabsConnectionTest extends InstrumentationTestCase {
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
public void testCellularPrerenderingDoesntOverrideSettings() throws Exception {
- CustomTabsSessionToken token = CustomTabsSessionToken.createDummySessionTokenForTesting();
+ final ICustomTabsCallback token = new CustomTabsTestUtils.DummyCallback();
assertTrue(mCustomTabsConnection.newSession(token));
- mCustomTabsConnection.setShouldPrerenderOnCellularForSession(token, true);
+ mCustomTabsConnection.setShouldPrerenderOnCellularForSession(token.asBinder(), true);
mCustomTabsConnection.warmup(0);
// Needs the browser process to be initialized.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698