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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/img-src/img-src-4_1.sub.html

Issue 2772583004: Fixed external wpt csp img-src/* tests. (Closed)
Patch Set: Rebase-update 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
(Empty)
1 <!DOCTYPE HTML>
2 <meta http-equiv="Content-Security-Policy" content="img-src 'self' {{domains[www ]}}:{{ports[http][0]}}">
3 <html>
4 <head>
5 <title>img element src attribute must match src list.</title>
6 <script src='/resources/testharness.js'></script>
7 <script src='/resources/testharnessreport.js'></script>
8 </head>
9 <body>
10 <div id='log'/>
11
12 <script>
13 async_test(function(t) {
14 i = new Image();
15 i.onload = t.step_func_done();
16 i.onerror = t.unreached_func("The img should have loaded");
17 i.src = '/content-security-policy/support/pass.png';
18 }, "img-src for relative path should load");
19
20 async_test(function(t) {
21 i = new Image();
22 i.onload = t.unreached_func("Image from unapproved domain was loaded.");
23 i.onerror = t.step_func_done();
24 i.src = 'http://{{domains[www1]}}/content-security-policy/support/fail.p ng';
25 }, "img-src from unapproved domains should not load");
26
27 async_test(function(t) {
28 i = new Image();
29 i.onload = t.step_func_done();
30 i.onerror = t.unreached_func("The img should have loaded");
31 i.src = location.protocol + '//{{domains[www]}}:{{ports[http][0]}}/conte nt-security-policy/support/pass.png';
32 }, "img-src from approved domains should load");
33 </script>
34 </body>
35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698