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

Side by Side Diff: LayoutTests/fast/css/fontloader-loadingdone.html

Issue 23717059: [Font Load Events] Implement FontFaceSet methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months 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 | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../js/resources/js-test-pre.js"></script> 3 <script src="../js/resources/js-test-pre.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.notifyWhenFontsReady(function() { 31 document.fonts.ready().then(function() {
32 debug('notifyWhenFontsReady() callback'); 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 <script src="../js/resources/js-test-post.js"></script> 52 <script src="../js/resources/js-test-post.js"></script>
53 </body> 53 </body>
54 </html> 54 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/fontloader-events.html ('k') | LayoutTests/fast/css/fontloader-loadingdone-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698