Index: LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level.html |
diff --git a/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level.html b/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level.html |
index e7d6756fe0f84f6888c46695c7887e2354692510..5d18a05596b24ae47252ecb29dcbdb1007a92147 100644 |
--- a/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level.html |
+++ b/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level.html |
@@ -15,8 +15,7 @@ |
+ "<scr" + "ipt>" |
+ "window.onload = function()" |
+ "{" |
- + "if (window.testRunner)" |
- + "testRunner.globalFlag = true;" |
+ + 'window.top.postMessage(\\\\\\"run test\\\\\\", \\\\\\"*\\\\\\");' |
+ "}" |
+ "</scr" + "ipt>" |
+ "</head>" |
@@ -36,25 +35,12 @@ |
var iframe = document.getElementById("aFrame"); |
iframe.src = url; |
- if (window.testRunner) { |
- setTimeout(pollForTest, 1); |
- } else { |
- log("To run the test, click the button below when the opened window finishes loading."); |
- var button = document.createElement("button"); |
- button.appendChild(document.createTextNode("Run Test")); |
- button.onclick = runTest; |
- document.body.appendChild(button); |
- } |
- } |
- |
- pollForTest = function() |
- { |
- if (!testRunner.globalFlag) { |
- setTimeout(pollForTest, 1); |
- return; |
- } |
- runTest(); |
- testRunner.notifyDone(); |
+ window.addEventListener('message', function () |
+ { |
+ runTest(); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ }); |
} |
runTest = function() |