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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/cascade/cross-origin-window-open.html

Issue 2792213002: Prevent layout tests from being broken by data URL deprecation. (Closed)
Patch Set: Created 3 years, 8 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 <head> 3 <head>
4 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script> 5 <script src="/resources/testharnessreport.js"></script>
6 <script src="/security/contentSecurityPolicy/resources/cascade-helper.js"></sc ript> 6 <script src="/security/contentSecurityPolicy/resources/cascade-helper.js"></sc ript>
7 <meta http-equiv="content-security-policy" content="img-src 'none'"> 7 <meta http-equiv="content-security-policy" content="img-src 'none'">
8 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
11 async_test(t => { 11 async_test(t => {
12 assert_blocked_image_in_document(t, document, "http://example.test:8000/reso urces/square.png?img-in-top-level"); 12 assert_blocked_image_in_document(t, document, "http://example.test:8000/reso urces/square.png?img-in-top-level");
13 }, "Image loaded in top-level blocked."); 13 }, "Image loaded in top-level blocked.");
14 14
15 async_test(t => { 15 async_test(t => {
16 window.addEventListener("message", t.step_func(e => { 16 window.addEventListener("message", t.step_func(e => {
17 assert_equals(e.data, "blocked"); 17 assert_equals(e.data, "blocked");
18 t.done(); 18 t.done();
19 })); 19 }));
20 20
21 window.open("data:text/html,<script>" + 21 var win = window.open("about:blank");
22 " var i = document.createElement('img');" + 22 win.document.write(
23 " i.onload = _ => opener.postMessage('loaded', '*');" + 23 "<script>" +
24 " i.onerror = _ => opener.postMessage('blocked', '*');" + 24 " var i = document.createElement('img');" +
25 " i.src = 'http://example.test:8000/resources/square.png?data-f rame'" + 25 " i.onload = _ => opener.postMessage('loaded', '*');" +
26 "</scr" + "ipt>"); 26 " i.onerror = _ => opener.postMessage('blocked', '*');" +
27 " i.src = 'http://example.test:8000/resources/square.png?data-frame'" +
28 "</scr" + "ipt>");
27 }, "Image loaded via data: window blocked."); 29 }, "Image loaded via data: window blocked.");
28 </script> 30 </script>
29 </body> 31 </body>
30 </html> 32 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/cascade/cross-origin-with-own-policy-window-open.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698