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 /* Test 1: Invalid font data */ | 5 /* Test 1: Invalid font data */ |
6 @font-face { | 6 @font-face { |
7 font-family: myfont1; | 7 font-family: myfont1; |
8 src: url('resources/invalidfont.png') format(opentype); | 8 src: url('resources/invalidfont.png') format(opentype); |
9 } | 9 } |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 </style> | 34 </style> |
35 <script> | 35 <script> |
36 description('Test download error cases.'); | 36 description('Test download error cases.'); |
37 | 37 |
38 window.jsTestIsAsync = true; | 38 window.jsTestIsAsync = true; |
39 | 39 |
40 function runTests() { | 40 function runTests() { |
41 document.fonts.addEventListener('loading', onLoading); | 41 document.fonts.addEventListener('loading', onLoading); |
42 document.fonts.addEventListener('loadingdone', onLoadingDone); | 42 document.fonts.addEventListener('loadingdone', onLoadingDone); |
43 document.fonts.addEventListener('loadingerror', onLoadingError); | 43 document.fonts.addEventListener('loadingerror', onLoadingError); |
44 document.fonts.ready().then(finish); | 44 document.fonts.ready.then(finish); |
45 } | 45 } |
46 | 46 |
47 var event; | 47 var event; |
48 var firedEvents = []; | 48 var firedEvents = []; |
49 | 49 |
50 function onLoading(e) { | 50 function onLoading(e) { |
51 firedEvents.push(e.type); | 51 firedEvents.push(e.type); |
52 } | 52 } |
53 | 53 |
54 function onLoadingDone(e) { | 54 function onLoadingDone(e) { |
(...skipping 25 matching lines...) Expand all Loading... |
80 </script> | 80 </script> |
81 </head> | 81 </head> |
82 <body> | 82 <body> |
83 <div style="font-family: myfont1">font1</div> | 83 <div style="font-family: myfont1">font1</div> |
84 <div style="font-family: myfont2">font2</div> | 84 <div style="font-family: myfont2">font2</div> |
85 <div style="font-family: myfont3">font3</div> | 85 <div style="font-family: myfont3">font3</div> |
86 <div style="font-family: myfont4">font4</div> | 86 <div style="font-family: myfont4">font4</div> |
87 <div style="font-family: myfont5">font5</div> | 87 <div style="font-family: myfont5">font5</div> |
88 </body> | 88 </body> |
89 </html> | 89 </html> |
OLD | NEW |