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

Side by Side Diff: LayoutTests/http/tests/webfont/fontfaceset-status-attribute.html

Issue 816923002: Switch FontFaceSet#ready from a method to an attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../js-test-resources/js-test.js"></script> 3 <script src="../../js-test-resources/js-test.js"></script>
4 <style> 4 <style>
5 @font-face { 5 @font-face {
6 font-family: 'TestFont'; 6 font-family: 'TestFont';
7 src: url(slow-ahem-loading.cgi); 7 src: url(slow-ahem-loading.cgi);
8 } 8 }
9 </style> 9 </style>
10 <script> 10 <script>
11 description('Test for FontFaceSet.status attribute'); 11 description('Test for FontFaceSet.status attribute');
12 12
13 window.jsTestIsAsync = true; 13 window.jsTestIsAsync = true;
14 14
15 function runTests() { 15 function runTests() {
16 shouldBeFalse("document.fonts.check('10px TestFont')"); 16 shouldBeFalse("document.fonts.check('10px TestFont')");
17 shouldBeEqualToString("document.fonts.status", "loaded"); 17 shouldBeEqualToString("document.fonts.status", "loaded");
18 document.fonts.load('10px TestFont').then(onsuccess); 18 document.fonts.load('10px TestFont').then(onsuccess);
19 shouldBeEqualToString("document.fonts.status", "loading"); 19 shouldBeEqualToString("document.fonts.status", "loading");
20 } 20 }
21 21
22 function onsuccess() { 22 function onsuccess() {
23 shouldBeTrue("document.fonts.check('10px TestFont')"); 23 shouldBeTrue("document.fonts.check('10px TestFont')");
24 document.fonts.ready().then(onFontsReady); 24 document.fonts.ready.then(onFontsReady);
25 } 25 }
26 26
27 function onFontsReady() { 27 function onFontsReady() {
28 shouldBeEqualToString("document.fonts.status", "loaded"); 28 shouldBeEqualToString("document.fonts.status", "loaded");
29 finishJSTest(); 29 finishJSTest();
30 } 30 }
31 31
32 if (document.fonts) 32 if (document.fonts)
33 runTests(); 33 runTests();
34 else { 34 else {
35 testFailed('document.fonts does not exist'); 35 testFailed('document.fonts does not exist');
36 finishJSTest(); 36 finishJSTest();
37 } 37 }
38 </script> 38 </script>
39 </head> 39 </head>
40 <body> 40 <body>
41 </body> 41 </body>
42 </html> 42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698