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

Side by Side Diff: LayoutTests/fast/css/fontfaceset-loadingdone.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="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 <style> 4 <style>
5 body { 5 body {
6 font-family: serif; 6 font-family: serif;
7 } 7 }
8 @font-face { 8 @font-face {
9 font-family: 'ahem'; 9 font-family: 'ahem';
10 src: url(../../resources/Ahem.ttf); 10 src: url(../../resources/Ahem.ttf);
(...skipping 10 matching lines...) Expand all
21 21
22 window.jsTestIsAsync = true; 22 window.jsTestIsAsync = true;
23 23
24 function runTests() { 24 function runTests() {
25 document.fonts.onloadingdone = function() { 25 document.fonts.onloadingdone = function() {
26 debug('loadingdone'); 26 debug('loadingdone');
27 testDiv = document.getElementById('test'); 27 testDiv = document.getElementById('test');
28 shouldBeEqualToString('window.getComputedStyle(testDiv, 0).width', '48px '); 28 shouldBeEqualToString('window.getComputedStyle(testDiv, 0).width', '48px ');
29 }; 29 };
30 30
31 document.fonts.ready().then(function() { 31 document.fonts.ready.then(function() {
32 debug('ready() promise fulfilled'); 32 debug('ready promise fulfilled');
33 shouldBeEqualToString('window.getComputedStyle(testDiv, 0).width', '48px '); 33 shouldBeEqualToString('window.getComputedStyle(testDiv, 0).width', '48px ');
34 finishJSTest(); 34 finishJSTest();
35 }); 35 });
36 } 36 }
37 37
38 if (document.fonts) 38 if (document.fonts)
39 runTests(); 39 runTests();
40 else { 40 else {
41 testFailed('document.fonts does not exist'); 41 testFailed('document.fonts does not exist');
42 finishJSTest(); 42 finishJSTest();
43 } 43 }
44 </script> 44 </script>
45 </head> 45 </head>
46 <body> 46 <body>
47 <div id=test> 47 <div id=test>
48 <a href="#"> 48 <a href="#">
49 <span>aaa</span> 49 <span>aaa</span>
50 </a> 50 </a>
51 </div> 51 </div>
52 </body> 52 </body>
53 </html> 53 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698