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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java

Issue 1407413011: Removing AtomicReference using ThreadUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments and fixed. Created 5 years, 1 month 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 | chrome/android/javatests/src/org/chromium/chrome/browser/bookmark/ManageBookmarkActivityTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
index dd833332b31ca1fed7f64b32caf818b935077cf2..9dd82b182d2771363abe63dc68946a7797a17d31 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
@@ -19,6 +19,7 @@ import org.chromium.android_webview.AwContentsClient;
import org.chromium.android_webview.AwSettings;
import org.chromium.android_webview.test.util.GraphicsTestUtils;
import org.chromium.android_webview.test.util.JSUtils;
+import org.chromium.base.ThreadUtils;
import org.chromium.base.test.BaseActivityInstrumentationTestCase;
import org.chromium.base.test.util.InMemorySharedPreferences;
import org.chromium.base.test.util.MinAndroidSdkLevel;
@@ -35,7 +36,6 @@ import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
/**
* A base class for android_webview tests. WebView only runs on KitKat and later,
@@ -417,16 +417,13 @@ public class AwTestBase
}
public AwTestContainerView createAwTestContainerViewOnMainSync(
- final AwContentsClient client, final boolean supportsLegacyQuirks) throws Exception {
- final AtomicReference<AwTestContainerView> testContainerView =
- new AtomicReference<AwTestContainerView>();
- getInstrumentation().runOnMainSync(new Runnable() {
+ final AwContentsClient client, final boolean supportsLegacyQuirks) {
+ return ThreadUtils.runOnUiThreadBlockingNoException(new Callable<AwTestContainerView>() {
@Override
- public void run() {
- testContainerView.set(createAwTestContainerView(client, supportsLegacyQuirks));
+ public AwTestContainerView call() {
+ return createAwTestContainerView(client, supportsLegacyQuirks);
}
});
- return testContainerView.get();
}
public void destroyAwContentsOnMainSync(final AwContents awContents) {
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/bookmark/ManageBookmarkActivityTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698