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

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

Issue 1879013002: 🍈 Unify application context usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix content tests. :( Created 4 years, 8 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
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 f28d1800da6b463a3e9c9ecb2856830039fc16d8..cc9f32439a8c72fccd34ede08162ed05d4e7f292 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
@@ -4,14 +4,14 @@
package org.chromium.android_webview.test;
+import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
+
import android.app.Instrumentation;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.util.Log;
-import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
-
import org.chromium.android_webview.AwBrowserContext;
import org.chromium.android_webview.AwBrowserProcess;
import org.chromium.android_webview.AwContents;
@@ -87,6 +87,8 @@ public class AwTestBase
super.setUp();
if (needsBrowserProcessStarted()) {
startBrowserProcess();
+ } else if (needsNativeLoaded()) {
+ getActivity();
Torne 2016/04/15 14:22:43 Can you explain what the test case change here doe
Peter Wen 2016/04/18 18:49:58 Added in comments.
}
}
@@ -108,6 +110,14 @@ public class AwTestBase
}
/**
+ * Override this to return true if native needs to be loaded.
+ * @return Whether the test runner activity must be created to load native.
+ */
+ protected boolean needsNativeLoaded() {
+ return false;
+ }
+
+ /**
* Runs a {@link Callable} on the main thread, blocking until it is
* complete, and returns the result. Calls
* {@link Instrumentation#waitForIdleSync()} first to help avoid certain

Powered by Google App Engine
This is Rietveld 408576698