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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/css/css-get-platform-fonts.html

Issue 2919123002: Reland of DevTools: require enabling CSS domain before running CSS.* commands. (Closed)
Patch Set: Created 3 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script type="text/javascript" src="../../http/tests/inspector-protocol/css-prot ocol-test.js"></script> 4 <script type="text/javascript" src="../../http/tests/inspector-protocol/css-prot ocol-test.js"></script>
5 <script type="text/javascript" src="../../http/tests/inspector-protocol/dom-prot ocol-test.js"></script> 5 <script type="text/javascript" src="../../http/tests/inspector-protocol/dom-prot ocol-test.js"></script>
6 <script type="text/javascript"> 6 <script type="text/javascript">
7 7
8 function test() 8 function test()
9 { 9 {
10 var documentNodeId; 10 var documentNodeId;
(...skipping 10 matching lines...) Expand all
21 }, 21 },
22 22
23 function testSelectElementPlatformFonts(next) 23 function testSelectElementPlatformFonts(next)
24 { 24 {
25 platformFontsForElementWithSelector("select", next); 25 platformFontsForElementWithSelector("select", next);
26 } 26 }
27 ]); 27 ]);
28 } 28 }
29 29
30 30
31 function platformFontsForElementWithSelector(selector, callback) 31 async function platformFontsForElementWithSelector(selector, callback)
32 { 32 {
33 InspectorTest.requestNodeId(documentNodeId, selector, onNodeId); 33 var nodeId = await InspectorTest.requestNodeId(documentNodeId, selector) ;
34 34 await InspectorTest.sendCommandOrDie("CSS.enable", { });
35 function onNodeId(nodeId) 35 var response = await InspectorTest.sendCommandOrDie("CSS.getPlatformFont sForNode", { nodeId: nodeId });
36 { 36 dumpComputedFonts(response);
37 InspectorTest.sendCommandOrDie("CSS.getPlatformFontsForNode", { node Id: nodeId }, onGotComputedFonts); 37 callback();
38 }
39
40 function onGotComputedFonts(response)
41 {
42 dumpComputedFonts(response);
43 callback();
44 }
45 } 38 }
46 39
47 function dumpComputedFonts(response) 40 function dumpComputedFonts(response)
48 { 41 {
49 var fonts = response.fonts; 42 var fonts = response.fonts;
50 fonts.sort(function(a, b) { 43 fonts.sort(function(a, b) {
51 return b.glyphCount - a.glyphCount; 44 return b.glyphCount - a.glyphCount;
52 }); 45 });
53 for (var i = 0; i < fonts.length; ++i) 46 for (var i = 0; i < fonts.length; ++i)
54 fonts[i].familyName = "<Some-family-name-" + i + ">"; 47 fonts[i].familyName = "<Some-family-name-" + i + ">";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 7chars.<br> 90 7chars.<br>
98 Some line with 29 characters. 91 Some line with 29 characters.
99 </div> 92 </div>
100 <select> 93 <select>
101 <option>Short</option> 94 <option>Short</option>
102 <option selected>Option with a lot of chars.</option> 95 <option selected>Option with a lot of chars.</option>
103 </select> 96 </select>
104 97
105 </body> 98 </body>
106 </html> 99 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698