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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/preload/multiple-meta-csp.html

Issue 2834733003: Separate preaload matching from MemoryCache (Closed)
Patch Set: fix Created 3 years, 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-in line'; font-src 'none'"> 2 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-in line'; font-src 'none'">
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <link rel=preload href="../resources/Ahem.ttf" as=font crossorigin> 5 <link rel=preload href="../resources/Ahem.ttf" as=font crossorigin>
6 6
7 <meta http-equiv="Content-Security-Policy" content="style-src 'none'"> 7 <meta http-equiv="Content-Security-Policy" content="style-src 'none'">
8 <link rel="stylesheet" href="../resources/dummy.css" crossorigin> 8 <link rel="stylesheet" href="../resources/dummy.css" crossorigin>
9 9
10 <meta http-equiv="Content-Security-Policy" content="img-src 'none'"> 10 <meta http-equiv="Content-Security-Policy" content="img-src 'none'">
11 <img src="../resources/square.png" crossorigin> 11 <img src="../resources/square.png" crossorigin>
12 12
13 <script> 13 <script>
14 var t = async_test("Ensure preloads don't bypass CSP policies when multiple meta tags are in the markup"); 14 var t = async_test("Ensure preloads don't bypass CSP policies when multiple meta tags are in the markup");
15 window.addEventListener("load", t.step_func(function() { 15 window.addEventListener("load", t.step_func(function() {
16 if (window.internals) { 16 if (window.internals) {
17 assert_false(internals.isPreloaded('../resources/Ahem.ttf'), "fonts shou ld not be preloaded"); 17 assert_false(internals.isPreloaded('../resources/Ahem.ttf'), "fonts shou ld not be preloaded");
18 assert_false(internals.isPreloaded('../resources/dummy.css'), "css shoul d not be preloaded"); 18 assert_false(internals.isPreloaded('../resources/dummy.css'), "css shoul d not be preloaded");
19 assert_false(internals.isPreloaded('../resources/square.png'), "imgs sho uld not be preloaded"); 19 assert_false(internals.isPreloaded('../resources/square.png'), "imgs sho uld not be preloaded");
20 assert_true(internals.isPreloaded('../resources/testharness.js'));
21 assert_true(internals.isPreloaded('../resources/testharnessreport.js'));
22 t.done(); 20 t.done();
23 } 21 }
24 })); 22 }));
25 </script> 23 </script>
26 24
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698