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

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

Issue 2784543003: Fixed wpt content-security-policy/style-src tests (Closed)
Patch Set: CR changes 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="style-src
5 'sha256-7kQ1KhZCpEzWtsa0RSpbIL7FU3kPNhE3IJMaNeTclMU='
6 'sha384-OliBBQtittDq3qDaEttMlHG1viNf50PLjSlvXirHZHpeKApMClrTJz+7 VB5RTWdN'
7 'sha512-4/SpqCV0WGbb2QZXBViFlnms4M0I+aUGg9/tIhr10twU89nlMSBLOhi3 cVli39kyBZbUAlzk9xcVTMy+JDY+VA=='">
8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script>
10
11 <script>
12 var t = async_test("All style elements should load because they have prope r hashes");
13 document.addEventListener("securitypolicyviolation", t.unreached_func("Sho uld not trigger a security policy violation"));
14 </script>
15
16 <style>#content1 { margin-left: 2px; }</style>
17 <style>#content2 { margin-left: 2px; }</style>
18 <style>#content3 { margin-left: 2px; }</style>
19 </head>
20 <body>
21 <div id='log'></div>
22
23 <div id="content1">Lorem ipsum</div>
24 <div id="content2">Lorem ipsum</div>
25 <div id="content3">Lorem ipsum</div>
26
27 <script>
28 function make_assert(contentId) {
29 var contentEl = document.getElementById(contentId);
30 var marginLeftVal = getComputedStyle(contentEl).getPropertyValue('margin -left');
31 assert_true(marginLeftVal == "2px")
32 }
33 t.step(function() {
34 make_assert("content1");
35 make_assert("content2");
36 make_assert("content3");
37 t.done();
38 });
39 </script>
40
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698