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

Side by Side Diff: LayoutTests/http/tests/security/cross-frame-access-enumeration.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.waitUntilDone(); 9 testRunner.waitUntilDone();
10 } 10 }
11 11
12 if (window.testRunner) { 12 window.addEventListener('message', function ()
13 setTimeout(pollForTest, 1); 13 {
14 } else { 14 runTest();
15 log("To run the test, click the button below when the frame fini shes loading."); 15 if (window.testRunner)
16 var button = document.createElement("button"); 16 testRunner.notifyDone();
17 button.appendChild(document.createTextNode("Run Test")); 17 });
18 button.onclick = runTest;
19 document.body.appendChild(button);
20 }
21 } 18 }
22 19
23 pollForTest = function()
24 {
25 if (!testRunner.globalFlag) {
26 setTimeout(pollForTest, 1);
27 return;
28 }
29 runTest();
30 testRunner.notifyDone();
31 }
32
33 runTest = function() 20 runTest = function()
34 { 21 {
35 // Test enumerating the Window object 22 // Test enumerating the Window object
36 var b_win = document.getElementsByTagName("iframe")[0].contentWindow ; 23 var b_win = document.getElementsByTagName("iframe")[0].contentWindow ;
37 try { 24 try {
38 for (var k in b_win) { 25 for (var k in b_win) {
39 if (k == "customWindowProperty") { 26 if (k == "customWindowProperty") {
40 log("FAIL: Cross frame access by enumerating the window object was allowed."); 27 log("FAIL: Cross frame access by enumerating the window object was allowed.");
41 return; 28 return;
42 } 29 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 89 }
103 } 90 }
104 </script> 91 </script>
105 </head> 92 </head>
106 <body> 93 <body>
107 <p>This tests that variable names can't be enumerated cross domain (see http ://bugs.webkit.org/show_bug.cgi?id=16387)</p> 94 <p>This tests that variable names can't be enumerated cross domain (see http ://bugs.webkit.org/show_bug.cgi?id=16387)</p>
108 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for -enumeration-test.html"></iframe> 95 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for -enumeration-test.html"></iframe>
109 <pre id="console"></pre> 96 <pre id="console"></pre>
110 </body> 97 </body>
111 </html> 98 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698