Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / fontfaceset-multiple-faces.html
blob387b531ab3cd27a10caa54074452fb5acb46dd8e
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <style>
5 @font-face {
6 font-family: TestFont;
7 src: local('Courier New');
10 @font-face {
11 font-family: TestFont;
12 src: url(../../resources/Ahem.ttf);
13 unicode-range: u+61-7a; /* 'a'-'z' */
15 </style>
16 <script>
17 description('Test load events for a font family consists of multiple @font-faces.');
19 window.jsTestIsAsync = true;
21 function runTests() {
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');
29 var event;
30 var firedEvents = [];
32 function onLoading(e) {
33 firedEvents.push(e.type);
36 function onLoadingDone(e) {
37 firedEvents.push(e.type);
38 event = e;
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);
49 function finish() {
50 shouldBe("firedEvents", "['loading', 'loadingdone']");
51 finishJSTest();
54 if (document.fonts)
55 runTests();
56 else {
57 testFailed('document.fonts does not exist');
58 finishJSTest();
60 </script>
61 </head>
62 <body>
63 </body>
64 </html>