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

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

Issue 2158843003: customtabs: Don't crash when the death notificaton is sent to a random thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 f7d47e18e05407f605eecb8e2be560a1fa680df2..503975dd7ccf817c29833d722ea1828f4d04231a 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
@@ -146,6 +146,30 @@ public class CustomTabsConnectionTest extends InstrumentationTestCase {
});
}
+ /*
+ * Tests that when the disconnection notification comes from a non-UI thread, Chrome doesn't
+ * crash. Non-regression test for crbug.com/623128.
+ */
+ @SmallTest
+ @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ public void testPrerenderAndDisconnectOnOtherThread() {
+ final CustomTabsSessionToken token = assertWarmupAndMayLaunchUrl(null, URL, true);
+ final Thread otherThread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ mCustomTabsConnection.cleanUpSession(token);
+ }
+ });
+
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ otherThread.start();
+ }
+ });
+ // Should not crash, hence no assertions below.
+ }
+
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
public void testMayLaunchUrlKeepsSpareRendererWithoutPrerendering() {
« 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