Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: LayoutTests/fast/css/fontfaceset-set-operations.html

Issue 137253005: [Font Load Events] Partial implementation of SetClass operations for FontFaceSet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <style>
5 @font-face {
6 font-family: Font1;
7 src: local(Arial);
8 }
9
10 @font-face {
11 font-family: Font2;
12 src: local(Arial);
13 }
14
15 @font-face {
16 font-family: Font3;
17 src: local(Arial);
18 }
19 </style>
20 <script>
21 description('Tests set operations of FontFaceSet.');
22
23 function runTests() {
24 shouldBe('document.fonts.size', '3');
25
26 faces = [];
27 document.fonts.forEach(function(face) { faces.push(face); });
28 shouldBe('faces.length', '3');
29
30 shouldBeEqualToString('faces[0].family', 'Font1');
31 shouldBeEqualToString('faces[1].family', 'Font2');
32 shouldBeEqualToString('faces[2].family', 'Font3');
33
34 shouldBeTrue('document.fonts.has(faces[0])');
35 shouldBeTrue('document.fonts.has(faces[1])');
36 shouldBeTrue('document.fonts.has(faces[2])');
37 shouldBeFalse('document.fonts.has(new FontFace("MyFont", "local(Arial)", {}) )');
38 shouldThrow('document.fonts.has("Font1")', '"TypeError: Failed to execute \' has\' on \'FontFaceSet\': The argument is not a FontFace."');
39 }
40
41 if (document.fonts)
42 runTests();
43 else
44 testFailed('document.fonts does not exist');
45
46 </script>
47 </head>
48 <body>
49 </body>
50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698