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

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

Issue 970883002: [Android WebView] Synthesize a fake page loading event on page source modification (Re-land) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed findbugs warning 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 619979c9ae93a8fd1cdf29eb2af3e09d0faef2ab..08c6ebc7b8244df355e8272fdf9b7f95db466fe2 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
@@ -528,7 +528,11 @@ public class AwTestBase
});
final String parentUrl = testWebServer.setResponse("/popupParent.html", mainHtml, null);
- testWebServer.setResponse(popupPath, popupHtml, null);
+ if (popupHtml != null) {
+ testWebServer.setResponse(popupPath, popupHtml, null);
+ } else {
+ testWebServer.setResponseWithNoContentStatus(popupPath);
+ }
parentAwContentsClient.getOnCreateWindowHelper().setReturnValue(true);
loadUrlSync(parentAwContents, parentAwContentsClient.getOnPageFinishedHelper(), parentUrl);
@@ -542,9 +546,24 @@ public class AwTestBase
}
/**
+ * POD object for holding references to helper objects of a popup window.
+ */
+ public static class PopupInfo {
+ public final TestAwContentsClient popupContentsClient;
+ public final AwTestContainerView popupContainerView;
+ public final AwContents popupContents;
+ public PopupInfo(TestAwContentsClient popupContentsClient,
+ AwTestContainerView popupContainerView, AwContents popupContents) {
+ this.popupContentsClient = popupContentsClient;
+ this.popupContainerView = popupContainerView;
+ this.popupContents = popupContents;
+ }
+ }
+
+ /**
* Supplies the popup window with AwContents then waits for the popup window to finish loading.
*/
- public AwContents connectPendingPopup(final AwContents parentAwContents) throws Exception {
+ public PopupInfo connectPendingPopup(final AwContents parentAwContents) throws Exception {
TestAwContentsClient popupContentsClient;
AwTestContainerView popupContainerView;
final AwContents popupContents;
@@ -564,6 +583,6 @@ public class AwTestBase
int callCount = onPageFinishedHelper.getCallCount();
onPageFinishedHelper.waitForCallback(callCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS);
- return popupContents;
+ return new PopupInfo(popupContentsClient, popupContainerView, popupContents);
}
}

Powered by Google App Engine
This is Rietveld 408576698