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

Unified Diff: blimp/client/app/android/javatests/src/org/chromium/blimp/BlimpNativeInstrumentationTestCase.java

Issue 2124143002: Fix blimp native Java tests on platforms with assert. (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 | « no previous file | blimp/client/app/android/javatests/src/org/chromium/blimp/core/BlimpContentsTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/app/android/javatests/src/org/chromium/blimp/BlimpNativeInstrumentationTestCase.java
diff --git a/blimp/client/app/android/javatests/src/org/chromium/blimp/BlimpNativeInstrumentationTestCase.java b/blimp/client/app/android/javatests/src/org/chromium/blimp/BlimpNativeInstrumentationTestCase.java
index 8061f82ec88b768efedb54823807d5b69b8a7101..179138e52bbd0cf98b66653c00211616082f17fb 100644
--- a/blimp/client/app/android/javatests/src/org/chromium/blimp/BlimpNativeInstrumentationTestCase.java
+++ b/blimp/client/app/android/javatests/src/org/chromium/blimp/BlimpNativeInstrumentationTestCase.java
@@ -6,6 +6,7 @@ package org.chromium.blimp;
import android.test.InstrumentationTestCase;
+import org.chromium.base.ThreadUtils;
import org.chromium.base.library_loader.ProcessInitException;
import java.util.concurrent.Semaphore;
@@ -20,13 +21,22 @@ public class BlimpNativeInstrumentationTestCase extends InstrumentationTestCase
@Override
public void setUp() throws ProcessInitException {
- BlimpLibraryLoader.startAsync(
- getInstrumentation().getTargetContext(), new BlimpLibraryLoader.Callback() {
- public void onStartupComplete(boolean success) {
- mSuccess = success;
- mNativeReadySemaphore.release();
- }
- });
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ BlimpLibraryLoader.startAsync(getInstrumentation().getTargetContext(),
+ new BlimpLibraryLoader.Callback() {
+ public void onStartupComplete(boolean success) {
+ mSuccess = success;
+ mNativeReadySemaphore.release();
+ }
+ });
+ } catch (ProcessInitException e) {
+ throw new RuntimeException("Failed to initialize process.");
+ }
+ }
+ });
}
/**
« no previous file with comments | « no previous file | blimp/client/app/android/javatests/src/org/chromium/blimp/core/BlimpContentsTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698