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

Unified Diff: LayoutTests/http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open.html

Issue 494343003: Eliminate globalFlag usage from http security layout tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: consistify Created 6 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: LayoutTests/http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open.html
diff --git a/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open.html b/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open.html
index e5a57f93102c1ea91aeb56b1062bf93905843639..b4a2ff67f0f8291f39c34c34181b8161c0656713 100644
--- a/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open.html
+++ b/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open.html
@@ -16,8 +16,7 @@
+ "opener.document.getElementById(\"accessMe\").innerHTML = \"FAIL: Access from a window opened with a data: URL was allowed!\";"
+ "} catch (e) {"
+ "}"
- + "if (window.testRunner)"
- + "testRunner.globalFlag = true;" // Flag that the test has completed and we can close the window now
+ + "window.opener.postMessage('done', '*');"
+ "}"
+ "</scri" + "pt>"
+ "</head>"
@@ -26,18 +25,10 @@
+ "</body>"
+ "</html>";
+ window.addEventListener('message', function () {
+ closeWindowAndNotifyDone(openedWindow);
+ });
var openedWindow = window.open(url);
-
- if (window.testRunner) {
- setTimeout(waitForFlag, 1);
- function waitForFlag() {
- if (!testRunner.globalFlag) {
- setTimeout(waitForFlag, 1);
- return;
- }
- closeWindowAndNotifyDone(openedWindow);
- }
- }
}
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698