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

Unified Diff: LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url.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-data-url-to-data-url.html
diff --git a/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url.html b/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url.html
index a3abd56ab1626e6a33ca3ac4c695bb697c46d447..955095816976661d1f4c0a682e286bef0cbadd61 100644
--- a/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url.html
+++ b/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-to-data-url.html
@@ -17,8 +17,7 @@
var innerURLSecondPart = "ipt>"
+ "function fireSentinel() {"
- + "if (window.testRunner)"
- + "testRunner.globalFlag = true;"
+ + "window.parent.postMessage(\"perform test\", \"*\");"
+ "}"
+ "</scr";
@@ -34,20 +33,9 @@
+ "<head>"
+ "<scr" + "ipt>"
+ "function loaded() {"
+ + "window.addEventListener('message', performTest);"
+ "var iframe = document.getElementById('inner');"
+ "iframe.src = '" + innerURLFirstPart + "' + '" + innerURLSecondPart + "' + '" + innerURLThirdPart + "';"
- + "if (window.testRunner) {"
- + "setTimeout(waitForFlag, 1);"
- + "function waitForFlag() {"
- + "if (!testRunner.globalFlag) {"
- + "setTimeout(waitForFlag, 1);"
- + "return;"
- + "}"
- + "performTest();"
- + "}"
- + "} else {"
- + "document.getElementById('console').innerHTML = 'Click the button when all the subframes have finished loading.';"
- + "}"
+ "}"
+ "function performTest() {"
+ "try {"
@@ -62,7 +50,6 @@
+ "<body onload='loaded();'>"
+ "<iframe id='inner' name='inner'></iframe>"
+ "<p>Inner iframe.</p>"
- + "<button onclick='performTest();'>Test</button>"
+ "<pre id='console'></pre>"
+ "</body>"
+ "</html>";

Powered by Google App Engine
This is Rietveld 408576698