| <!DOCTYPE html> |
| <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'; font-src 'none'"> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <link rel=preload href="../resources/Ahem.ttf" as=font crossorigin> |
| |
| <meta http-equiv="Content-Security-Policy" content="style-src 'none'"> |
| <link rel="stylesheet" href="../resources/dummy.css" crossorigin> |
| |
| <meta http-equiv="Content-Security-Policy" content="img-src 'none'"> |
| <img src="../resources/square.png" crossorigin> |
| |
| <script> |
| var t = async_test("Ensure preloads don't bypass CSP policies when multiple meta tags are in the markup"); |
| window.addEventListener("load", t.step_func(function() { |
| if (window.internals) { |
| assert_false(internals.isPreloaded('../resources/Ahem.ttf'), "fonts should not be preloaded"); |
| assert_false(internals.isPreloaded('../resources/dummy.css'), "css should not be preloaded"); |
| assert_false(internals.isPreloaded('../resources/square.png'), "imgs should not be preloaded"); |
| assert_true(internals.isPreloaded('../resources/testharness.js')); |
| assert_true(internals.isPreloaded('../resources/testharnessreport.js')); |
| t.done(); |
| } |
| })); |
| </script> |
| |