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

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

Issue 1304963004: customtabs: Run the session cleanup code on the UI thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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/CustomTabsConnection.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/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 96f1d9f97bfcfec2ebd2e31d8918fdb7414b7197..9327531fbded268d3ebd472740f37b7f7fda329d 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
@@ -13,7 +13,7 @@ import android.support.customtabs.ICustomTabsCallback;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
-import org.chromium.base.test.util.DisabledTest;
+import org.chromium.base.ThreadUtils;
/** Tests for CustomTabsConnection. */
public class CustomTabsConnectionTest extends InstrumentationTestCase {
@@ -33,7 +33,16 @@ public class CustomTabsConnectionTest extends InstrumentationTestCase {
@Override
protected void tearDown() throws Exception {
super.tearDown();
- mCustomTabsConnection.cleanupAll();
+ cleanupSessions();
+ }
+
+ private void cleanupSessions() {
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ mCustomTabsConnection.cleanupAll();
+ }
+ });
}
/**
@@ -136,7 +145,7 @@ public class CustomTabsConnectionTest extends InstrumentationTestCase {
@SmallTest
public void testForgetsSession() {
ICustomTabsCallback cb = assertWarmupAndMayLaunchUrl(null, URL, true);
- mCustomTabsConnection.cleanupAll();
+ cleanupSessions();
assertWarmupAndMayLaunchUrl(cb, URL, false);
}
@@ -194,10 +203,8 @@ public class CustomTabsConnectionTest extends InstrumentationTestCase {
/**
* Tests that the mayLaunchUrl() throttling is reset after a long enough wait.
- * @SmallTest
- * crbug.com/523057
*/
- @DisabledTest
+ @SmallTest
public void testThrottlingIsReset() {
ICustomTabsCallback cb = assertWarmupAndMayLaunchUrl(null, URL, true);
mCustomTabsConnection.mayLaunchUrl(cb, Uri.parse(URL), null, null);
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698