gecko-dev/testing/web-platform/tests/css/css-font-loading/idlharness.https.html
Philip Jägenstedt 05f7e73e35 Bug 1526370 [wpt PR 15170] - [css-font-loading] Handle a fontFace.loaded promise rejection in idlharness test, a=testonly
Automatic update from web-platform-tests
[css-font-loading] Handle a fontFace.loaded promise rejection in idlharness test (#15170)

Fixes https://github.com/web-platform-tests/wpt/issues/14862.
--

wpt-commits: c575a40b789f5c3db95dfe5aa575ce17d02afc74
wpt-pr: 15170
2019-02-14 11:38:27 +00:00

28 lines
970 B
HTML

<!DOCTYPE html>
<title>Font Loading API IDL tests</title>
<link rel="help" href="https://drafts.csswg.org/css-font-loading/#fontfacesetloadevent">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<script>
'use strict';
idl_test(
['css-font-loading'],
['dom', 'html', 'cssom'],
idl_array => {
idl_array.add_objects({
Document: ['document'],
FontFace: ['fontFace'],
FontFaceSetLoadEvent: ['fontFaceSetLoadEvent'],
FontFaceSet: ['document.fonts'],
});
self.fontFace = new FontFace("family", "src");
// The `fontFace.loaded` promise will be rejected, so handle that to
// avoid an unhandled promise rejection manifesting as a harness error.
self.fontFace.loaded.catch(() => {});
self.fontFaceSetLoadEvent = new FontFaceSetLoadEvent("type");
}
);
</script>