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

Side by Side Diff: LayoutTests/fast/css/fontface-properties.html

Issue 335333002: Make "descriptors" argument of FontFace constructor optional (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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="../../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: 'Ahem'; 6 font-family: 'Ahem';
7 src: url(../../resources/Ahem.ttf); 7 src: url(../../resources/Ahem.ttf);
8 font-style: italic; 8 font-style: italic;
9 font-weight: 300; 9 font-weight: 300;
10 unicode-range: U+0-3FF; 10 unicode-range: U+0-3FF;
(...skipping 14 matching lines...) Expand all
25 function runTests() { 25 function runTests() {
26 ahemFace = getDocumentFontFaces()[0]; 26 ahemFace = getDocumentFontFaces()[0];
27 shouldBeEqualToString('ahemFace.family', 'Ahem'); 27 shouldBeEqualToString('ahemFace.family', 'Ahem');
28 shouldBeEqualToString('ahemFace.style', 'italic'); 28 shouldBeEqualToString('ahemFace.style', 'italic');
29 shouldBeEqualToString('ahemFace.weight', '300'); 29 shouldBeEqualToString('ahemFace.weight', '300');
30 shouldBeEqualToString('ahemFace.unicodeRange', 'U+0-3FF'); 30 shouldBeEqualToString('ahemFace.unicodeRange', 'U+0-3FF');
31 shouldBeEqualToString('ahemFace.variant', 'small-caps'); 31 shouldBeEqualToString('ahemFace.variant', 'small-caps');
32 shouldBeEqualToString('ahemFace.featureSettings', "'dlig' 1"); 32 shouldBeEqualToString('ahemFace.featureSettings', "'dlig' 1");
33 33
34 debug(''); 34 debug('');
35 defaultFace = new FontFace('defaultFace', 'local(foo)', {}); 35 defaultFace = new FontFace('defaultFace', 'local(foo)');
36 shouldBeEqualToString('defaultFace.family', 'defaultFace'); 36 shouldBeEqualToString('defaultFace.family', 'defaultFace');
37 shouldBeEqualToString('defaultFace.style', 'normal'); 37 shouldBeEqualToString('defaultFace.style', 'normal');
38 shouldBeEqualToString('defaultFace.weight', 'normal'); 38 shouldBeEqualToString('defaultFace.weight', 'normal');
39 shouldBeEqualToString('defaultFace.stretch', 'normal'); 39 shouldBeEqualToString('defaultFace.stretch', 'normal');
40 shouldBeEqualToString('defaultFace.unicodeRange', 'U+0-10FFFF'); 40 shouldBeEqualToString('defaultFace.unicodeRange', 'U+0-10FFFF');
41 shouldBeEqualToString('defaultFace.variant', 'normal'); 41 shouldBeEqualToString('defaultFace.variant', 'normal');
42 shouldBeEqualToString('defaultFace.featureSettings', 'normal'); 42 shouldBeEqualToString('defaultFace.featureSettings', 'normal');
43 43
44 debug(''); 44 debug('');
45 constructedFace = new FontFace('constructedFace', 'local(bar)', { 45 constructedFace = new FontFace('constructedFace', 'local(bar)', {
46 'style': 'oblique', 46 'style': 'oblique',
47 'weight': 'bold', 47 'weight': 'bold',
48 'unicodeRange': 'U+100-1FF, U+ABCD', 48 'unicodeRange': 'U+100-1FF, U+ABCD',
49 'variant': 'small-caps', 49 'variant': 'small-caps',
50 'featureSettings': "'liga' 0" 50 'featureSettings': "'liga' 0"
51 }); 51 });
52 shouldBeEqualToString('constructedFace.family', 'constructedFace'); 52 shouldBeEqualToString('constructedFace.family', 'constructedFace');
53 shouldBeEqualToString('constructedFace.style', 'oblique'); 53 shouldBeEqualToString('constructedFace.style', 'oblique');
54 shouldBeEqualToString('constructedFace.weight', 'bold'); 54 shouldBeEqualToString('constructedFace.weight', 'bold');
55 shouldBeEqualToString('constructedFace.unicodeRange', 'U+100-1FF, U+ABCD'); 55 shouldBeEqualToString('constructedFace.unicodeRange', 'U+100-1FF, U+ABCD');
56 shouldBeEqualToString('constructedFace.variant', 'small-caps'); 56 shouldBeEqualToString('constructedFace.variant', 'small-caps');
57 shouldBeEqualToString('constructedFace.featureSettings', "'liga' 0"); 57 shouldBeEqualToString('constructedFace.featureSettings', "'liga' 0");
58 58
59 debug(''); 59 debug('');
60 modifiedFace = new FontFace('unmodified', 'local(baz)', {}); 60 modifiedFace = new FontFace('unmodified', 'local(baz)');
61 modifiedFace.family = 'modified'; 61 modifiedFace.family = 'modified';
62 modifiedFace.style = 'italic'; 62 modifiedFace.style = 'italic';
63 modifiedFace.weight = 900; 63 modifiedFace.weight = 900;
64 modifiedFace.unicodeRange = 'U+0-3FF'; 64 modifiedFace.unicodeRange = 'U+0-3FF';
65 modifiedFace.variant = 'small-caps'; 65 modifiedFace.variant = 'small-caps';
66 modifiedFace.featureSettings = "'dlig' 1, 'liga' 0"; 66 modifiedFace.featureSettings = "'dlig' 1, 'liga' 0";
67 shouldBeEqualToString('modifiedFace.family', 'modified'); 67 shouldBeEqualToString('modifiedFace.family', 'modified');
68 shouldBeEqualToString('modifiedFace.style', 'italic'); 68 shouldBeEqualToString('modifiedFace.style', 'italic');
69 shouldBeEqualToString('modifiedFace.weight', '900'); 69 shouldBeEqualToString('modifiedFace.weight', '900');
70 shouldBeEqualToString('modifiedFace.unicodeRange', 'U+0-3FF'); 70 shouldBeEqualToString('modifiedFace.unicodeRange', 'U+0-3FF');
71 shouldBeEqualToString('modifiedFace.variant', 'small-caps'); 71 shouldBeEqualToString('modifiedFace.variant', 'small-caps');
72 shouldBeEqualToString('modifiedFace.featureSettings', "'dlig' 1, 'liga' 0"); 72 shouldBeEqualToString('modifiedFace.featureSettings', "'dlig' 1, 'liga' 0");
73 73
74 debug(''); 74 debug('');
75 shouldThrow("new FontFace('test', 'invalid_src', {})"); 75 shouldThrow("new FontFace('test', 'invalid_src')");
76 face = new FontFace('test', 'local(foo)', {}); 76 face = new FontFace('test', 'local(foo)');
77 shouldThrow("face.style = ''"); 77 shouldThrow("face.style = ''");
78 shouldThrow("face.weight = 'a'"); 78 shouldThrow("face.weight = 'a'");
79 shouldThrow("face.unicodeRange = 'U+'"); 79 shouldThrow("face.unicodeRange = 'U+'");
80 shouldThrow("face.variant = '???'"); 80 shouldThrow("face.variant = '???'");
81 shouldThrow("face.featureSettings = null"); 81 shouldThrow("face.featureSettings = null");
82 } 82 }
83 83
84 if (document.fonts) 84 if (document.fonts)
85 runTests(); 85 runTests();
86 else { 86 else {
87 testFailed('document.fonts does not exist'); 87 testFailed('document.fonts does not exist');
88 } 88 }
89 </script> 89 </script>
90 </head> 90 </head>
91 <body> 91 <body>
92 </body> 92 </body>
93 </html> 93 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/fontface-arraybuffer.html ('k') | LayoutTests/fast/css/fontface-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698