Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / fontfaceset-load.html
blob0b7b10468be022a2803457caa4b5c6bafeed9ae8
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');
10 @font-face {
11 font-family: TestFont;
12 src: url(../../resources/Ahem.ttf);
13 unicode-range: u+41-5a; /* 'A'-'Z' */
16 @font-face {
17 font-family: TestFont;
18 src: url('resources/DownLoadErrorAhem.otf');
19 unicode-range: u+61-7a; /* 'a'-'z' */
21 </style>
22 <script>
23 description('Tests load() method of FontFaceSet.');
25 window.jsTestIsAsync = true;
27 function step1() {
28 document.fonts.load('10px TestFont', 'ABC.').then(step2);
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);
41 function step3(v) {
42 value = v;
43 shouldBeEqualToString('value.name', 'NetworkError');
44 document.fonts.load('InvalidFontDescription', 'abc.').catch(step4);
47 function step4(v) {
48 value = v;
49 shouldBeEqualToString('value.name', 'SyntaxError');
50 finishJSTest();
53 if (document.fonts)
54 step1();
55 else {
56 testFailed('document.fonts does not exist');
57 finishJSTest();
59 </script>
60 </head>
61 <body>
62 </body>
63 </html>