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

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

Issue 976393002: [Android WebView] Implement OnReceivedHttpError callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 08c6ebc7b8244df355e8272fdf9b7f95db466fe2..49af5c2928fc53bb851d964c32c08e85788c2407 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
@@ -273,6 +273,26 @@ public class AwTestBase
TimeUnit.MILLISECONDS);
}
+ public void waitForVisualStateCallback(final AwContents awContents) throws Exception {
+ final CallbackHelper ch = new CallbackHelper();
+ final int chCount = ch.getCallCount();
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ final long requestId = 666;
+ awContents.insertVisualStateCallback(requestId,
+ new AwContents.VisualStateCallback() {
+ @Override
+ public void onComplete(long id) {
+ assertEquals(requestId, id);
+ ch.notifyCalled();
+ }
+ });
+ }
+ });
+ ch.waitForCallback(chCount);
+ }
+
/**
* Checks the current test has |clazz| annotation. Note this swallows NoSuchMethodException
* and returns false in that case.

Powered by Google App Engine
This is Rietveld 408576698