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

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

Issue 196383035: Fix promise resolution of FontFaceSet#load() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: naming Created 6 years, 9 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-load-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: TestFont;
7 src: local('Courier New');
8 }
9
10 @font-face {
11 font-family: TestFont;
12 src: url(../../resources/Ahem.ttf);
13 unicode-range: u+41-5a; /* 'A'-'Z' */
14 }
15
16 @font-face {
17 font-family: TestFont;
18 src: url('resources/DownLoadErrorAhem.otf');
19 unicode-range: u+61-7a; /* 'a'-'z' */
20 }
21 </style>
22 <script>
23 description('Tests load() method of FontFaceSet.');
24
25 window.jsTestIsAsync = true;
26
27 function step1() {
28 document.fonts.load('10px TestFont', 'ABC.').then(step2);
29 }
30
31 function step2(v) {
32 value = v;
33 shouldBe('value.length', '2');
34 shouldBeEqualToString('value[0].unicodeRange', 'U+0-10FFFF');
35 shouldBeEqualToString('value[1].unicodeRange', 'U+41-5A');
36 shouldBeEqualToString('value[0].status', 'loaded');
37 shouldBeEqualToString('value[1].status', 'loaded');
38 document.fonts.load('10px TestFont', 'abc.').catch(step3);
39 }
40
41 function step3(v) {
42 value = v;
43 shouldBeEqualToString('value.name', 'NetworkError');
44 document.fonts.load('InvalidFontDescription', 'abc.').catch(step4);
45 }
46
47 function step4(v) {
48 value = v;
49 shouldBeEqualToString('value.name', 'SyntaxError');
50 finishJSTest();
51 }
52
53 if (document.fonts)
54 step1();
55 else {
56 testFailed('document.fonts does not exist');
57 finishJSTest();
58 }
59 </script>
60 </head>
61 <body>
62 </body>
63 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/fontfaceset-load-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698