Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
| 3 <meta name="timeout" content="long"> | 3 <meta name="timeout" content="long"> |
| 4 <title>Cross-origin behavior of Window and Location</title> | 4 <title>Cross-origin behavior of Window and Location</title> |
| 5 <link rel="author" title="Bobby Holley (:bholley)" href="bobbyholley@gmail.com"> | 5 <link rel="author" title="Bobby Holley (:bholley)" href="bobbyholley@gmail.com"> |
| 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/#security-window"> | 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/#security-window"> |
| 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#security-location "> | 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#security-location "> |
| 8 <!-- | 8 <!-- |
| 9 The original code lives at | 9 The original code lives at |
| 10 https://github.com/w3c/web-platform-tests/tree/master/html/browsers/origin/cross -origin-objects | 10 https://github.com/w3c/web-platform-tests/tree/master/html/browsers/origin/cross -origin-objects |
| 11 | 11 |
| 12 TODO(yukishiino): Redesign the security model of DOM-V8 binding code and fix all the failing test cases. | 12 TODO(yukishiino): Redesign the security model of DOM-V8 binding code and fix all the failing test cases. |
| 13 --> | 13 --> |
| 14 <script> | |
| 15 // This test needs to run on 'web-platform.test:8000'. | |
| 16 if (document.location.hostname != "web-platform.test") | |
| 17 document.location = document.location.protocol + "//web-platform.test:8000" + document.location.pathname; | |
| 18 if (window.testRunner) | |
| 19 window.testRunner.setCanOpenWindows(); | |
| 20 </script> | |
| 21 <script src="/resources/testharness.js"></script> | 14 <script src="/resources/testharness.js"></script> |
| 22 <script src="/resources/testharnessreport.js"></script> | 15 <script src="/resources/testharnessreport.js"></script> |
| 23 <div id=log></div> | 16 <div id=log></div> |
| 24 <iframe id="B"></iframe> | 17 <iframe id="B"></iframe> |
| 25 <iframe id="C"></iframe> | 18 <iframe id="C"></iframe> |
| 26 <script> | 19 <script> |
| 27 | 20 |
| 21 // This test needs to run on 'web-platform.test:8000'. | |
| 22 if (document.location.hostname != "web-platform.test") { | |
| 23 document.location = document.location.protocol + "//web-platform.test:8000" + document.location.pathname; | |
|
tkent
2015/06/17 07:41:16
Do we setup httpd for web-platform.test:8000 durin
Yuki
2015/06/17 08:25:16
I don't know what magic is happening, but all the
tkent
2015/06/18 00:41:38
ok, probably the magic is true because try bots ra
| |
| 24 } else { // The main content of the test. | |
| 25 | |
| 26 if (window.testRunner) | |
| 27 window.testRunner.setCanOpenWindows(); | |
| 28 | |
| 28 /* | 29 /* |
| 29 * Setup boilerplate. This gives us a same-origin window "B" and a cross-origin | 30 * Setup boilerplate. This gives us a same-origin window "B" and a cross-origin |
| 30 * window "C". | 31 * window "C". |
| 31 */ | 32 */ |
| 32 | 33 |
| 33 setup({explicit_done: true}); | 34 setup({explicit_done: true}); |
| 34 path = location.pathname.substring(0, location.pathname.lastIndexOf('/')) + '/re sources/frame.html'; | 35 path = location.pathname.substring(0, location.pathname.lastIndexOf('/')) + '/re sources/frame.html'; |
| 35 var B = document.getElementById('B').contentWindow; | 36 var B = document.getElementById('B').contentWindow; |
| 36 var C = document.getElementById('C').contentWindow; | 37 var C = document.getElementById('C').contentWindow; |
| 37 B.frameElement.uriToLoad = path; | 38 B.frameElement.uriToLoad = path; |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 function runNextTest() { | 340 function runNextTest() { |
| 340 var entry = testList.shift(); | 341 var entry = testList.shift(); |
| 341 test(entry[0], entry[1]); | 342 test(entry[0], entry[1]); |
| 342 if (testList.length != 0) | 343 if (testList.length != 0) |
| 343 reloadSubframes(runNextTest); | 344 reloadSubframes(runNextTest); |
| 344 else | 345 else |
| 345 doDocumentDomainTest(done); // Asynchronous. | 346 doDocumentDomainTest(done); // Asynchronous. |
| 346 } | 347 } |
| 347 reloadSubframes(runNextTest); | 348 reloadSubframes(runNextTest); |
| 348 | 349 |
| 350 } // if (document.location.hostname != "web-platform.test") | |
| 351 | |
| 349 </script> | 352 </script> |
| OLD | NEW |