3 <script src=
"../../resources/js-test.js"></script>
7 src: local('Courier New');
11 font-family: TestFont;
12 src: url(../../resources/Ahem.ttf);
13 unicode-range: u+
41-
5a; /* 'A'-'Z' */
17 font-family: TestFont;
18 src: url('resources/DownLoadErrorAhem.otf');
19 unicode-range: u+
61-
7a; /* 'a'-'z' */
23 description('Tests load() method of FontFaceSet.');
25 window
.jsTestIsAsync
= true;
28 document
.fonts
.load('10px TestFont', 'ABC.').then(step2
);
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
);
43 shouldBeEqualToString('value.name', 'NetworkError');
44 document
.fonts
.load('InvalidFontDescription', 'abc.').catch(step4
);
49 shouldBeEqualToString('value.name', 'SyntaxError');
56 testFailed('document.fonts does not exist');