| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <meta charset=utf-8> |
| 3 <meta http-equiv="Content-Security-Policy" content="font-src {{domains[www1]}}:{
{ports[http][0]}}"> |
| 4 <head> |
| 5 <title>Test font loads if it matches font-src.</title> |
| 6 <script src='/resources/testharness.js'></script> |
| 7 <script src='/resources/testharnessreport.js'></script> |
| 8 </head> |
| 9 <body> |
| 10 <div id="log"/> |
| 11 <script> |
| 12 async_test(function(t) { |
| 13 document.addEventListener("securitypolicyviolation", t.unreached_func("Loa
ding allowed fonts should not trigger a violation.")); |
| 14 var link = document.createElement('link'); |
| 15 link.rel="preload"; |
| 16 link.as="font"; |
| 17 link.href="http://{{domains[www1]}}:{{ports[http][0]}}/content-security-po
licy/support/Ahem.ttf"; |
| 18 link.onload = t.step_func_done(); |
| 19 link.onerror = t.unreached_func("Should have loaded the font."); |
| 20 document.getElementsByTagName('head')[0].appendChild(link); |
| 21 }, "Test font loads if it matches font-src."); |
| 22 </script> |
| 23 </body> |
| OLD | NEW |