| 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: Test1; | 6 font-family: Test1; |
| 7 src: url('../../resources/Ahem.ttf'); | 7 src: url('../../resources/Ahem.ttf'); |
| 8 unicode-range: U+41-5A; /* 'A'-'Z' */ | 8 unicode-range: U+41-5A; /* 'A'-'Z' */ |
| 9 } | 9 } |
| 10 @font-face { | 10 @font-face { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 description('Tests that only necessary fonts are loaded when font faces have ove
rlapping unicode ranges.'); | 37 description('Tests that only necessary fonts are loaded when font faces have ove
rlapping unicode ranges.'); |
| 38 | 38 |
| 39 window.jsTestIsAsync = true; | 39 window.jsTestIsAsync = true; |
| 40 | 40 |
| 41 function getDocumentFontFaces() { | 41 function getDocumentFontFaces() { |
| 42 var faces = []; | 42 var faces = []; |
| 43 document.fonts.forEach(function(face) { faces.push(face); }); | 43 document.fonts.forEach(function(face) { faces.push(face); }); |
| 44 return faces; | 44 return faces; |
| 45 } | 45 } |
| 46 | 46 |
| 47 document.fonts.ready().then(function() { | 47 document.fonts.ready.then(function() { |
| 48 faces = getDocumentFontFaces(); | 48 faces = getDocumentFontFaces(); |
| 49 shouldBe('faces.length', '6'); | 49 shouldBe('faces.length', '6'); |
| 50 shouldBeEqualToString('faces[0].status', 'unloaded'); | 50 shouldBeEqualToString('faces[0].status', 'unloaded'); |
| 51 shouldBeEqualToString('faces[1].status', 'loaded'); | 51 shouldBeEqualToString('faces[1].status', 'loaded'); |
| 52 shouldBeEqualToString('faces[2].status', 'loaded'); | 52 shouldBeEqualToString('faces[2].status', 'loaded'); |
| 53 shouldBeEqualToString('faces[3].status', 'unloaded'); | 53 shouldBeEqualToString('faces[3].status', 'unloaded'); |
| 54 shouldBeEqualToString('faces[4].status', 'unloaded'); | 54 shouldBeEqualToString('faces[4].status', 'unloaded'); |
| 55 shouldBeEqualToString('faces[5].status', 'loaded'); | 55 shouldBeEqualToString('faces[5].status', 'loaded'); |
| 56 finishJSTest(); | 56 finishJSTest(); |
| 57 }); | 57 }); |
| 58 </script> | 58 </script> |
| 59 </head> | 59 </head> |
| 60 <body> | 60 <body> |
| 61 <p style="font-family: Test1">I</p> | 61 <p style="font-family: Test1">I</p> |
| 62 <p style="font-family: Test2">J</p> | 62 <p style="font-family: Test2">J</p> |
| 63 <p style="font-family: Test3">K</p> | 63 <p style="font-family: Test3">K</p> |
| 64 </body> | 64 </body> |
| 65 </html> | 65 </html> |
| OLD | NEW |