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

Side by Side Diff: LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe.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 window.onload = function() 5 window.onload = function()
6 { 6 {
7 if (window.testRunner) { 7 if (window.testRunner) {
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 testRunner.dumpChildFramesAsText(); 9 testRunner.dumpChildFramesAsText();
10 testRunner.waitUntilDone(); 10 testRunner.waitUntilDone();
11 } 11 }
12 12
13 if (window.testRunner) { 13 window.addEventListener('message', function ()
14 setTimeout(pollForTest, 1); 14 {
15 } else { 15 runTest();
16 log("To run the test, click the button below when the opened win dow finishes loading."); 16 testRunner.notifyDone();
17 var button = document.createElement("button"); 17 });
18 button.appendChild(document.createTextNode("Run Test"));
19 button.onclick = runTest;
20 document.body.appendChild(button);
21 }
22 }
23
24 pollForTest = function()
25 {
26 if (!testRunner.globalFlag) {
27 setTimeout(pollForTest, 1);
28 return;
29 }
30 runTest();
31 testRunner.notifyDone();
32 } 18 }
33 19
34 runTest = function() 20 runTest = function()
35 { 21 {
36 try { 22 try {
37 window[0][0].document.getElementById('accessMe').innerHTML = "FA IL: Cross frame access to a data: URL embed in a frame on a foreign domain allow ed."; 23 window[0][0].document.getElementById('accessMe').innerHTML = "FA IL: Cross frame access to a data: URL embed in a frame on a foreign domain allow ed.";
38 log("FAIL: Cross frame access to a data: URL embed in a frame on a foreign domain allowed."); 24 log("FAIL: Cross frame access to a data: URL embed in a frame on a foreign domain allowed.");
39 return; 25 return;
40 } catch (e) { 26 } catch (e) {
41 } 27 }
42 log("PASS: Cross frame access to a data: URL embed in a frame on a f oreign domain denied!"); 28 log("PASS: Cross frame access to a data: URL embed in a frame on a f oreign domain denied!");
43 } 29 }
44 </script> 30 </script>
45 </head> 31 </head>
46 <body> 32 <body>
47 <p>The scenario for this test is that you have an iframe with content from a foreign domain. In that foreign content 33 <p>The scenario for this test is that you have an iframe with content from a foreign domain. In that foreign content
48 is an iframe which loads a data: URL. This tests that this main documen t does not have access to that 34 is an iframe which loads a data: URL. This tests that this main documen t does not have access to that
49 data: URL loaded iframe.</p> 35 data: URL loaded iframe.</p>
50 <iframe src="http://localhost:8000/security/dataURL/resources/foreign-domain -data-url-accessee-iframe.html" style="width: 400px; height:200px;"></iframe> 36 <iframe src="http://localhost:8000/security/dataURL/resources/foreign-domain -data-url-accessee-iframe.html" style="width: 400px; height:200px;"></iframe>
51 <pre id="console"></pre> 37 <pre id="console"></pre>
52 </body> 38 </body>
53 </html> 39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698