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

Side by Side Diff: LayoutTests/http/tests/security/cross-frame-access-location-get.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 wind ow finishes 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 }
22
23 pollForTest = function()
24 {
25 if (!testRunner.globalFlag) {
26 setTimeout(pollForTest, 1);
27 return;
28 }
29 runTest();
30 testRunner.notifyDone();
31 } 18 }
32 19
33 runTest = function() 20 runTest = function()
34 { 21 {
35 window.targetWindow = frames[0]; 22 window.targetWindow = frames[0];
36 23
37 log("\n----- tests for getting window.location's properties -----\n" ); 24 log("\n----- tests for getting window.location's properties -----\n" );
38 25
39 shouldBeTrue("canGet('targetWindow.location')"); 26 shouldBeTrue("canGet('targetWindow.location')");
40 shouldBe("toString('targetWindow.location', '')", "''"); 27 shouldBe("toString('targetWindow.location', '')", "''");
(...skipping 29 matching lines...) Expand all
70 shouldBeTrue("canGet('targetWindow.location.replace')"); 57 shouldBeTrue("canGet('targetWindow.location.replace')");
71 58
72 } 59 }
73 </script> 60 </script>
74 </head> 61 </head>
75 <body> 62 <body>
76 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for -location-get-test.html"></iframe> 63 <iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for -location-get-test.html"></iframe>
77 <pre id="console"></pre> 64 <pre id="console"></pre>
78 </body> 65 </body>
79 </html> 66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698