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

Side by Side Diff: LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../resources/cross-frame-access.js"></script> 3 <script src="../resources/cross-frame-access.js"></script>
4 <script> 4 <script>
5 var openedWindow; 5 var openedWindow;
6 6
7 window.onload = function() 7 window.onload = function()
8 { 8 {
9 if (window.testRunner) { 9 if (window.testRunner) {
10 testRunner.dumpAsText(); 10 testRunner.dumpAsText();
11 testRunner.waitUntilDone(); 11 testRunner.waitUntilDone();
12 testRunner.setCanOpenWindows(); 12 testRunner.setCanOpenWindows();
13 } 13 }
14 14
15 window.addEventListener('message', function ()
16 {
17 runTest();
18 closeWindowAndNotifyDone(openedWindow);
19 });
15 openedWindow = window.open("http://localhost:8000/security/dataURL/r esources/foreign-domain-data-url-accessee-opened-frame.html"); 20 openedWindow = window.open("http://localhost:8000/security/dataURL/r esources/foreign-domain-data-url-accessee-opened-frame.html");
16
17 if (window.testRunner) {
18 setTimeout(pollForTest, 1);
19 } else {
20 log("To run the test, click the button below when the opened win dow finishes loading.");
21 var button = document.createElement("button");
22 button.appendChild(document.createTextNode("Run Test"));
23 button.onclick = runTest;
24 document.body.appendChild(button);
25 }
26 }
27
28 pollForTest = function()
29 {
30 if (!testRunner.globalFlag) {
31 setTimeout(pollForTest, 1);
32 return;
33 }
34 runTest();
35 closeWindowAndNotifyDone(openedWindow);
36 } 21 }
37 22
38 runTest = function() 23 runTest = function()
39 { 24 {
40 try { 25 try {
41 openedWindow[0].document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a data: URL embed in a frame window.open'ed on fore ign domain allowed."; 26 openedWindow[0].document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a data: URL embed in a frame window.open'ed on fore ign domain allowed.";
42 log("FAIL: Cross frame access to a data: URL embed in a frame wi ndow.open'ed on foreign domain allowed."); 27 log("FAIL: Cross frame access to a data: URL embed in a frame wi ndow.open'ed on foreign domain allowed.");
43 return; 28 return;
44 } catch (e) { 29 } catch (e) {
45 } 30 }
46 log("PASS: Cross frame access to a data: URL embed in a frame window .open'ed on foreign domain denied!"); 31 log("PASS: Cross frame access to a data: URL embed in a frame window .open'ed on foreign domain denied!");
47 } 32 }
48 </script> 33 </script>
49 </head> 34 </head>
50 <body> 35 <body>
51 <pre id="console"></pre> 36 <pre id="console"></pre>
52 </body> 37 </body>
53 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698