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: Font1; | 6 font-family: Font1; |
7 src: local(Arial); | 7 src: local(Arial); |
8 } | 8 } |
9 | 9 |
10 @font-face { | 10 @font-face { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 checkResults(); | 69 checkResults(); |
70 | 70 |
71 debug('check entries'); | 71 debug('check entries'); |
72 faces = []; | 72 faces = []; |
73 for (entry of document.fonts.entries()) { | 73 for (entry of document.fonts.entries()) { |
74 shouldBeTrue('entry[0] === entry[1]'); | 74 shouldBeTrue('entry[0] === entry[1]'); |
75 faces.push(entry[1]); | 75 faces.push(entry[1]); |
76 } | 76 } |
77 checkResults(); | 77 checkResults(); |
78 | 78 |
| 79 shouldThrow('document.fonts.has(null)'); |
| 80 shouldThrow('document.fonts.has("Font1")'); |
| 81 shouldThrow('document.fonts.add(null)'); |
| 82 shouldThrow('document.fonts.add("Font1")'); |
| 83 shouldThrow('document.fonts.delete(null)'); |
| 84 shouldThrow('document.fonts.delete("Font1")'); |
| 85 |
79 shouldBeFalse('document.fonts.has(nonCssConnectedFace)'); | 86 shouldBeFalse('document.fonts.has(nonCssConnectedFace)'); |
80 shouldThrow('document.fonts.has("Font1")', '"TypeError: Failed to execute \'
has\' on \'FontFaceSet\': The argument is not a FontFace."'); | |
81 | 87 |
82 shouldNotThrow('document.fonts.add(faces[0])'); | 88 shouldNotThrow('document.fonts.add(faces[0])'); |
83 shouldBe('document.fonts.size', '3'); | 89 shouldBe('document.fonts.size', '3'); |
84 | 90 |
85 shouldBeFalse('document.fonts.delete(faces[0])'); | 91 shouldBeFalse('document.fonts.delete(faces[0])'); |
86 shouldBe('document.fonts.size', '3'); | 92 shouldBe('document.fonts.size', '3'); |
87 | 93 |
88 document.fonts.add(nonCssConnectedFace); | 94 document.fonts.add(nonCssConnectedFace); |
89 shouldBe('document.fonts.size', '4'); | 95 shouldBe('document.fonts.size', '4'); |
90 shouldBeTrue('document.fonts.has(nonCssConnectedFace)'); | 96 shouldBeTrue('document.fonts.has(nonCssConnectedFace)'); |
(...skipping 14 matching lines...) Expand all Loading... |
105 if (document.fonts) | 111 if (document.fonts) |
106 runTests(); | 112 runTests(); |
107 else | 113 else |
108 testFailed('document.fonts does not exist'); | 114 testFailed('document.fonts does not exist'); |
109 | 115 |
110 </script> | 116 </script> |
111 </head> | 117 </head> |
112 <body> | 118 <body> |
113 </body> | 119 </body> |
114 </html> | 120 </html> |
OLD | NEW |