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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/style-src/style-src-3_3.html

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 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>href of link with rel=stylesheet must be in src list</title>
5 <script src='/resources/testharness.js'></script>
6 <script src='/resources/testharnessreport.js'></script>
7 <script>
8 var head = document.getElementsByTagName('head')[0];
9 var link = document.createElement('link');
10 link.setAttribute('rel', 'stylesheet');
11 link.setAttribute('type', 'text/css');
12 link.setAttribute('href', location.protocol +
13 '//www1.' +
14 location.hostname +
15 ':' +
16 location.port +
17 '/content-security-policy/style-src/3_3.css');
18 head.appendChild(link);
19
20 onload = function doTest() {
21 test(function() {
22 var text = document.getElementById("content");
23 assert_true(getComputedStyle(text).marginLeft != "2px", "Style sheet loaded from origin not in style-src directive should be blocked");
24 });
25 }
26 </script>
27 </head>
28 <body>
29 <h1>href of link with rel=stylesheet must be in src list</h1>
30 <div id='log'></div>
31
32 <div id="content">This text should not have a margin-left of 2</div>
33
34 <script async defer src='../support/checkReport.sub.js?reportField=violated- directive&reportValue=style-src%20%27self%27'></script>
35
36 </body>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698