3 <script src=
"../../resources/js-test.js"></script>
7 src: local('Courier New');
11 font-family: TestFont;
12 src: url(../../resources/Ahem.ttf);
13 unicode-range: u+
61-
7a; /* 'a'-'z' */
17 description('Test load events for a font family consists of multiple @font-faces.');
19 window
.jsTestIsAsync
= true;
22 document
.fonts
.addEventListener('loading', onLoading
);
23 document
.fonts
.addEventListener('loadingdone', onLoadingDone
);
24 document
.fonts
.ready
.then(finish
);
26 document
.fonts
.load('10px TestFont', 'abc');
32 function onLoading(e
) {
33 firedEvents
.push(e
.type
);
36 function onLoadingDone(e
) {
37 firedEvents
.push(e
.type
);
39 shouldBe("event.fontfaces.length", "2");
40 shouldBeEqualToString("event.fontfaces[0].status", "loaded");
41 shouldBeEqualToString("event.fontfaces[1].status", "loaded");
42 shouldBeTrue("document.fonts.check('10px TestFont')");
45 function onLoadingError(e
) {
46 firedEvents
.push(e
.type
);
50 shouldBe("firedEvents", "['loading', 'loadingdone']");
57 testFailed('document.fonts does not exist');