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

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

Issue 2209303002: binding: Moves the check for the first access to the initial document into BindingSecurity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments. Created 4 years, 4 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/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

Powered by Google App Engine
This is Rietveld 408576698