idlharness.https.html (1007B)
1 <!DOCTYPE html> 2 <title>Font Loading API IDL tests</title> 3 <meta name="timeout" content="long"> 4 <link rel="help" href="https://drafts.csswg.org/css-font-loading/#fontfacesetloadevent"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/resources/WebIDLParser.js"></script> 8 <script src="/resources/idlharness.js"></script> 9 <script> 10 'use strict'; 11 12 idl_test( 13 ['css-font-loading'], 14 ['dom', 'html', 'cssom'], 15 idl_array => { 16 idl_array.add_objects({ 17 Document: ['document'], 18 FontFace: ['fontFace'], 19 FontFaceSetLoadEvent: ['fontFaceSetLoadEvent'], 20 FontFaceSet: ['document.fonts'], 21 }); 22 self.fontFace = new FontFace("family", "src"); 23 // The `fontFace.loaded` promise will be rejected, so handle that to 24 // avoid an unhandled promise rejection manifesting as a harness error. 25 self.fontFace.loaded.catch(() => {}); 26 self.fontFaceSetLoadEvent = new FontFaceSetLoadEvent("type"); 27 } 28 ); 29 </script>