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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/cross-frame-access-parent-isolated-world.html

Issue 2630783003: PlzNavigate: Fix the http/tests/security/cross-frame-access-parent-isolated-world.html and http/tes… (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <script src="/js-test-resources/js-test.js"></script> 3 <script src="/js-test-resources/js-test.js"></script>
4 <body> 4 <body>
5 <p id="description"></p> 5 <p id="description"></p>
6 <p id="console"></p> 6 <p id="console"></p>
7 <iframe src="data:text/html,"></iframe> 7 <iframe src="data:text/html," onload="onFrameLoad()"></iframe>
8 <script> 8 <script>
9 // We should change the iframe src only after it finishes loading to avoid
10 // timing bugs due to PlzNavigate or cases where the browser handles all
11 // navigations.
12 var srcChanged = false;
13 function onFrameLoad() {
14 if (window.testRunner && !srcChanged) {
15 srcChanged = true;
16 testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
17 var iframe = document.getElementsByTagName('iframe')[0];
18 iframe.focus();
19 iframe.src = 'http://127.0.0.1:8080/security/resources/cross-frame-iframe-fo r-parent-isolated-world.html';
20 }
21 }
22
9 description('Tests that isolated worlds do not allow cross-origin frame access') ; 23 description('Tests that isolated worlds do not allow cross-origin frame access') ;
10 window.jsTestIsAsync = true; 24 window.jsTestIsAsync = true;
11 25
12 if (window.testRunner) { 26 if (window.testRunner) {
13 window.addEventListener('message', function(event) { 27 window.addEventListener('message', function(event) {
14 var message = JSON.parse(event.data); 28 var message = JSON.parse(event.data);
15 switch (message.type) { 29 switch (message.type) {
16 case 'debug': 30 case 'debug':
17 debug(message.message); 31 debug(message.message);
18 break; 32 break;
19 case 'finish': 33 case 'finish':
20 finishJSTest(); 34 finishJSTest();
21 break; 35 break;
22 } 36 }
23 }); 37 });
24
25 testRunner.setIsolatedWorldSecurityOrigin(2, 'chrome-extension://123');
26 var iframe = document.getElementsByTagName('iframe')[0];
27 iframe.focus();
28 iframe.src = 'http://127.0.0.1:8080/security/resources/cross-frame-iframe-fo r-parent-isolated-world.html';
29 } else { 38 } else {
30 testFailed('Test depends on LayoutTestController and must be run by DRT'); 39 testFailed('Test depends on LayoutTestController and must be run by DRT');
31 } 40 }
32 </script> 41 </script>
33 </body> 42 </body>
34 </html> 43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698