font-face-reject.html (804B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <link rel="author" title="Dominik Röttsches" href="drott@chromium.org"> 4 <link rel="help" href="https://drafts.csswg.org/css-font-loading/#font-face-load"> 5 <meta name="assert" content="Ensure that a UA triggered font load (through the use in the test div) leads to rejecting 6 the promise." /> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script> 10 promise_test(function(t) { 11 var testFontFace = new FontFace('TestFontFace', 'local("nonexistentfont-9a1a9f78-c8d4-11e9-af16-448a5b2c326f")'); 12 document.fonts.add(testFontFace); 13 return promise_rejects_dom(t, 'NetworkError', testFontFace.loaded); 14 }) 15 </script> 16 <body> 17 <div style="font-family: TestFontFace;">a</div> 18 </html>