Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / webfont / fontfaceset-status-attribute.html
1 <html>
2 <head>
3 <script src="../../js-test-resources/js-test.js"></script>
4 <style>
5   @font-face {
6     font-family: 'TestFont';
7     src: url(slow-ahem-loading.cgi);
8   }
9 </style>
10 <script>
11 description('Test for FontFaceSet.status attribute');
12
13 window.jsTestIsAsync = true;
14
15 function runTests() {
16     shouldBeFalse("document.fonts.check('10px TestFont')");
17     shouldBeEqualToString("document.fonts.status", "loaded");
18     document.fonts.load('10px TestFont').then(onsuccess);
19     shouldBeEqualToString("document.fonts.status", "loading");
20 }
21
22 function onsuccess() {
23     shouldBeTrue("document.fonts.check('10px TestFont')");
24     document.fonts.ready().then(onFontsReady);
25 }
26
27 function onFontsReady() {
28     shouldBeEqualToString("document.fonts.status", "loaded");
29     finishJSTest();
30 }
31
32 if (document.fonts)
33     runTests();
34 else {
35     testFailed('document.fonts does not exist');
36     finishJSTest();
37 }
38 </script>
39 </head>
40 <body>
41 </body>
42 </html>