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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/style-src/style-src-hash-default-src-allowed.html

Issue 2784543003: Fixed wpt content-security-policy/style-src tests (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
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsaf e-inline'; default-src
5 'sha1-uCtW0zq0h0gWRvJCsjWCAgrNkNQ='
Mike West 2017/03/29 08:38:01 Ditto.
andypaicu 2017/03/29 09:55:32 Done
6 'sha256-nxymsvltRxuUc1siDoJx5xeVJN458uBYKe3mBbSqpLk='
7 'sha384-q/ooQaWFna3mtP50ztOBzmeyG8Y4ataEWq2BFynU6I5aJ8HqneKEJAfd 70PCzBth'
8 'sha512-wyqpPU/EH8aoDLYcabrPiA1ELbCmF7eSqaHK7+GsDElGv4L/brV7LsKZ 1cb2u/YWpw0w4An4sbEMnqv8g8Hy8Q=='">
9 <script src="/resources/testharness.js"></script>
10 <script src="/resources/testharnessreport.js"></script>
11
12 <script>
13 var t = async_test("All style elements should load because they have prope r hashes")
14 document.addEventListener("securitypolicyviolation", t.unreached_func("Sho uld not trigger a security policy violation"));
15 </script>
16
17 <style>#content1 { margin-left: 2px; }</style>
18 <style>#content2 { margin-left: 2px; }</style>
19 <style>#content3 { margin-left: 2px; }</style>
20 <style>#content4 { margin-left: 2px; }</style>
21 </head>
22 <body>
23 <div id='log'></div>
24
25 <div id="content1">Lorem ipsum</div>
26 <div id="content2">Lorem ipsum</div>
27 <div id="content3">Lorem ipsum</div>
28 <div id="content4">Lorem ipsum</div>
29
30 <script>
31 function make_assert(contentId) {
32 var contentEl = document.getElementById(contentId);
33 var marginLeftVal = getComputedStyle(contentEl).getPropertyValue('margin -left');
34 assert_true(marginLeftVal == "2px")
35 }
36 t.step(function() {
37 make_assert("content1");
38 make_assert("content2");
39 make_assert("content3");
40 make_assert("content4");
41 t.done();
42 });
43 </script>
44
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698