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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/blink-contrib/combine-multiple-header-policies.html.asis

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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 HTTP/1.1 200 OK
2 Content-Type: text/html
3 Expires: Mon, 26 Jul 1997 05:00:00 GMT
4 Cache-Control: no-store, no-cache, must-revalidate
5 Cache-Control: post-check=0, pre-check=0, false
6 Pragma: no-cache
7 Set-Cookie: combine-multiple-policies=d0140e7d-3800-4842-b66d-370840a4569a; Path =/content-security-policy/blink-contrib
8 Content-Security-Policy: script-src 'self' 'unsafe-inline'; connect-src 'self'; style-src 'self'; report-uri /content-security-policy/support/report.py?op=put&r eportID=d0140e7d-3800-4842-b66d-370840a4569a
9 Content-Security-Policy: img-src 'none'
10
11 <!DOCTYPE html>
12 <html>
13
14 <head>
15 <!-- Programmatically converted from a WebKit Reftest, please forgive result ing idiosyncracies.-->
16 <meta http-equiv="Content-Security-Policy" content="img-src 'none'">
17 <title>combine-multiple-policies</title>
18 <script src="/resources/testharness.js"></script>
19 <script src="/resources/testharnessreport.js"></script>
20 <script src='../support/logTest.sub.js?logs=["TEST COMPLETE"]'></script>
21 <script src="../support/alertAssert.sub.js?alerts=[]"></script>
22 <!-- enforcing multiple policies:
23 Content-Security-Policy: script-src 'self' 'unsafe-inline'; connect-src 'self'; styls-src 'self'
24 Content-Security-Policy: img-src 'none'
25 -->
26 </head>
27
28 <body>
29 This test checks that we enforce all the supplied policies. This test passe if it doesn&apos;t alert fail and if the style doesn&apos;t apply.
30 Check that a SecurityPolicyViolationEvent is fired upon blocking an image.
31 <script>
32 var img = document.createElement('img');
33 img.src = '../support/fail.png';
34 img.onerror = function() {
35 log("TEST COMPLETE");
36 };
37 img.onload = function() {
38 log("FAIL");
39 };
40 document.body.appendChild(img);
41
42 </script>
43 <style>
44 body {
45 background-color: blue;
46 }
47
48 </style>
49 <script>
50 var el = document.querySelector('body');
51 test(function() {
52 assert_equals(window.getComputedStyle(el).color, "rgb(0, 0, 0)")
53 });
54
55 </script>
56 <div id="log"></div>
57 <script async defer src="../support/checkReport.sub.js?reportExists=true&amp ;reportField=violated-directive&amp;reportValue=style-src%20&apos;self&apos;"></ script>
58 </body>
59
60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698