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

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: Fix callback arguments 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
« no previous file with comments | « no previous file | LayoutTests/fast/css/fontfaceset-set-operations-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 thisArg = {};
27 faces = [];
28 document.fonts.forEach(function(face, faceAgain, set) {
29 if (faces.length == 0) {
30 callbackArgs = arguments;
31 thisValue = this;
32 shouldBeTrue('callbackArgs[0] === callbackArgs[1]');
33 shouldBeTrue('callbackArgs[2] === document.fonts');
34 shouldBeTrue('thisValue === thisArg');
35 }
36 faces.push(face);
37 }, thisArg);
38 shouldBe('faces.length', '3');
39
40 shouldBeEqualToString('faces[0].family', 'Font1');
41 shouldBeEqualToString('faces[1].family', 'Font2');
42 shouldBeEqualToString('faces[2].family', 'Font3');
43
44 shouldBeTrue('document.fonts.has(faces[0])');
45 shouldBeTrue('document.fonts.has(faces[1])');
46 shouldBeTrue('document.fonts.has(faces[2])');
47 shouldBeFalse('document.fonts.has(new FontFace("MyFont", "local(Arial)", {}) )');
48 shouldThrow('document.fonts.has("Font1")', '"TypeError: Failed to execute \' has\' on \'FontFaceSet\': The argument is not a FontFace."');
49 }
50
51 if (document.fonts)
52 runTests();
53 else
54 testFailed('document.fonts does not exist');
55
56 </script>
57 </head>
58 <body>
59 </body>
60 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/fontfaceset-set-operations-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698