OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <style> | 4 <style> |
5 @font-face { | 5 @font-face { |
6 font-family: TestFont1; | 6 font-family: TestFont1; |
7 src: local('Courier New'); | 7 src: local('Courier New'); |
8 } | 8 } |
9 | 9 |
10 @font-face { | 10 @font-face { |
(...skipping 14 matching lines...) Expand all Loading... |
25 </style> | 25 </style> |
26 <script> | 26 <script> |
27 description('Test load events for fonts.loadFont() with multiple font families.'
); | 27 description('Test load events for fonts.loadFont() with multiple font families.'
); |
28 | 28 |
29 window.jsTestIsAsync = true; | 29 window.jsTestIsAsync = true; |
30 | 30 |
31 function runTests() { | 31 function runTests() { |
32 document.fonts.addEventListener('loading', onLoading); | 32 document.fonts.addEventListener('loading', onLoading); |
33 document.fonts.addEventListener('loadingdone', onLoadingDone); | 33 document.fonts.addEventListener('loadingdone', onLoadingDone); |
34 document.fonts.addEventListener('loadingerror', onLoadingError); | 34 document.fonts.addEventListener('loadingerror', onLoadingError); |
35 document.fonts.ready().then(finish); | 35 document.fonts.ready.then(finish); |
36 | 36 |
37 document.fonts.load('10px TestFont1, TestFont2, TestFont3, TestFont4', 'abc'
).catch(function() {}); | 37 document.fonts.load('10px TestFont1, TestFont2, TestFont3, TestFont4', 'abc'
).catch(function() {}); |
38 } | 38 } |
39 | 39 |
40 var event; | 40 var event; |
41 var firedEvents = []; | 41 var firedEvents = []; |
42 | 42 |
43 function onLoading(e) { | 43 function onLoading(e) { |
44 firedEvents.push(e.type); | 44 firedEvents.push(e.type); |
45 } | 45 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 runTests(); | 81 runTests(); |
82 else { | 82 else { |
83 testFailed('document.fonts does not exist'); | 83 testFailed('document.fonts does not exist'); |
84 finishJSTest(); | 84 finishJSTest(); |
85 } | 85 } |
86 </script> | 86 </script> |
87 </head> | 87 </head> |
88 <body> | 88 <body> |
89 </body> | 89 </body> |
90 </html> | 90 </html> |
OLD | NEW |