Index: android_webview/javatests/src/org/chromium/android_webview/test/PopupWindowTest.java |
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/PopupWindowTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/PopupWindowTest.java |
index 3dabeb7f49aa0369859234c577118da4e5e2e177..6c5c793b38839680b702fb193a76ea04234bf789 100644 |
--- a/android_webview/javatests/src/org/chromium/android_webview/test/PopupWindowTest.java |
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/PopupWindowTest.java |
@@ -77,15 +77,23 @@ public class PopupWindowTest extends AwTestBase { |
+ " window.popupWindow.document.body.innerHTML = 'Hello from the parent!';" |
+ "}</script>"); |
+ final String popupPageHtml = CommonResources.makeHtmlPageFrom( |
+ "<title>" + POPUP_TITLE + "</title>", |
+ "This is a popup window"); |
+ |
triggerPopup(mParentContents, mParentContentsClient, mWebServer, parentPageHtml, |
- null, popupPath, "tryOpenWindow()"); |
+ popupPageHtml, popupPath, "tryOpenWindow()"); |
+ PopupInfo popupInfo = connectPendingPopup(mParentContents); |
+ assertEquals(POPUP_TITLE, getTitleOnUiThread(popupInfo.popupContents)); |
+ |
TestCallbackHelperContainer.OnPageFinishedHelper onPageFinishedHelper = |
- connectPendingPopup(mParentContents).popupContentsClient.getOnPageFinishedHelper(); |
+ popupInfo.popupContentsClient.getOnPageFinishedHelper(); |
final int onPageFinishedCallCount = onPageFinishedHelper.getCallCount(); |
+ |
executeJavaScriptAndWaitForResult(mParentContents, mParentContentsClient, |
"modifyDomOfPopup()"); |
+ // Test that |waitForCallback| does not time out. |
onPageFinishedHelper.waitForCallback(onPageFinishedCallCount); |
- assertEquals("about:blank", onPageFinishedHelper.getUrl()); |
} |
@SmallTest |