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 |
11 /* Test 2: Download error */ | 11 /* Test 2: Download error */ |
12 @font-face { | 12 @font-face { |
13 font-family: myfont2; | 13 font-family: myfont2; |
14 src: url('resources/DownLoadErrorAhem.otf'); | 14 src: url('resources/DownLoadErrorAhem.otf'); |
15 } | 15 } |
16 | 16 |
17 /* Test 3: Empty data url */ | 17 /* Test 3: Empty data url */ |
18 @font-face { | 18 @font-face { |
19 font-family: myfont3; | 19 font-family: myfont3; |
20 src: url(data:application/x-truetype-font,) format(truetype); | 20 src: url(data:application/x-truetype-font,) format("truetype"); |
21 } | 21 } |
22 | 22 |
23 /* Test 4: Download error followed by existing local font */ | 23 /* Test 4: Download error followed by existing local font */ |
24 @font-face { | 24 @font-face { |
25 font-family: myfont4; | 25 font-family: myfont4; |
26 src: url('resources/DownLoadErrorAhem.otf'), local('Courier New'); | 26 src: url('resources/DownLoadErrorAhem.otf'), local('Courier New'); |
27 } | 27 } |
28 | 28 |
29 /* Test 5: Multiple errors */ | 29 /* Test 5: Multiple errors */ |
30 @font-face { | 30 @font-face { |
31 font-family: myfont5; | 31 font-family: myfont5; |
32 src: url('resources/DownLoadErrorAhem.otf'), url(data:application/x-truetype
-font,) format(truetype); | 32 src: url('resources/DownLoadErrorAhem.otf'), url(data:application/x-truetype
-font,) format("truetype"); |
33 } | 33 } |
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); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 if (document.fonts) | 78 if (document.fonts) |
79 runTests(); | 79 runTests(); |
80 else { | 80 else { |
81 testFailed('document.fonts does not exist'); | 81 testFailed('document.fonts does not exist'); |
82 finishJSTest(); | 82 finishJSTest(); |
83 } | 83 } |
84 </script> | 84 </script> |
85 </head> | 85 </head> |
86 </html> | 86 </html> |
OLD | NEW |