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

Side by Side Diff: LayoutTests/fast/css/font-face-unicode-range-overlap-load.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
« no previous file with comments | « no previous file | LayoutTests/fast/css/font-face-unicode-range-overlap-load-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 @font-face { 5 @font-face {
6 font-family: Test1; 6 font-family: Test1;
7 src: url('../../resources/Ahem.ttf'); 7 src: url('../../resources/Ahem.ttf');
8 unicode-range: U+41-5A; /* 'A'-'Z' */ 8 unicode-range: U+41-5A; /* 'A'-'Z' */
9 } 9 }
10 @font-face { 10 @font-face {
(...skipping 26 matching lines...) Expand all
37 description('Tests that only necessary fonts are loaded when font faces have ove rlapping unicode ranges.'); 37 description('Tests that only necessary fonts are loaded when font faces have ove rlapping unicode ranges.');
38 38
39 window.jsTestIsAsync = true; 39 window.jsTestIsAsync = true;
40 40
41 function getDocumentFontFaces() { 41 function getDocumentFontFaces() {
42 var faces = []; 42 var faces = [];
43 document.fonts.forEach(function(face) { faces.push(face); }); 43 document.fonts.forEach(function(face) { faces.push(face); });
44 return faces; 44 return faces;
45 } 45 }
46 46
47 document.fonts.ready().then(function() { 47 document.fonts.ready.then(function() {
48 faces = getDocumentFontFaces(); 48 faces = getDocumentFontFaces();
49 shouldBe('faces.length', '6'); 49 shouldBe('faces.length', '6');
50 shouldBeEqualToString('faces[0].status', 'unloaded'); 50 shouldBeEqualToString('faces[0].status', 'unloaded');
51 shouldBeEqualToString('faces[1].status', 'loaded'); 51 shouldBeEqualToString('faces[1].status', 'loaded');
52 shouldBeEqualToString('faces[2].status', 'loaded'); 52 shouldBeEqualToString('faces[2].status', 'loaded');
53 shouldBeEqualToString('faces[3].status', 'unloaded'); 53 shouldBeEqualToString('faces[3].status', 'unloaded');
54 shouldBeEqualToString('faces[4].status', 'unloaded'); 54 shouldBeEqualToString('faces[4].status', 'unloaded');
55 shouldBeEqualToString('faces[5].status', 'loaded'); 55 shouldBeEqualToString('faces[5].status', 'loaded');
56 finishJSTest(); 56 finishJSTest();
57 }); 57 });
58 </script> 58 </script>
59 </head> 59 </head>
60 <body> 60 <body>
61 <p style="font-family: Test1">I</p> 61 <p style="font-family: Test1">I</p>
62 <p style="font-family: Test2">J</p> 62 <p style="font-family: Test2">J</p>
63 <p style="font-family: Test3">K</p> 63 <p style="font-family: Test3">K</p>
64 </body> 64 </body>
65 </html> 65 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/font-face-unicode-range-overlap-load-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698