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

Unified Diff: content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java

Issue 2810373002: InstalledAppProviderImpl: Assert that code is run off the UI thread. (Closed)
Patch Set: Fix spelling of UI. Created 3 years, 7 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 | « content/public/android/java/src/org/chromium/content/browser/installedapp/InstalledAppProviderImpl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java
diff --git a/content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java b/content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java
index b2c2161f033856d71c5500de3f2eba6219ab7b05..881e9068afc59d479c99f9faa46dcfb17adc493a 100644
--- a/content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java
+++ b/content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java
@@ -12,15 +12,16 @@ import android.content.res.AssetManager;
import android.content.res.Resources;
import android.os.Bundle;
+import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.robolectric.res.builder.DefaultPackageManager;
+import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
import org.chromium.installedapp.mojom.InstalledAppProvider;
import org.chromium.installedapp.mojom.RelatedApplication;
@@ -294,6 +295,9 @@ public class InstalledAppProviderTest {
@Before
public void setUp() {
+ // Avoid triggering asserts in InstalledAppProviderImpl that check they are being run off
+ // the UI thread (since this is a single-threaded test).
+ ThreadUtils.setThreadAssertsDisabledForTesting(true);
mPackageManager = new FakePackageManager();
RuntimeEnvironment.setRobolectricPackageManager(mPackageManager);
mFrameUrlDelegate = new FakeFrameUrlDelegate(URL_ON_ORIGIN);
@@ -301,6 +305,11 @@ public class InstalledAppProviderTest {
new InstalledAppProviderTestImpl(mFrameUrlDelegate, RuntimeEnvironment.application);
}
+ @After
+ public void tearDown() {
+ ThreadUtils.setThreadAssertsDisabledForTesting(false);
+ }
+
/**
* Origin of the page using the API is missing certain parts of the URI.
*/
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/installedapp/InstalledAppProviderImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698