| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../http/tests/inspector-protocol/resources/p
rotocol-test.js"></script> | 3 <script type="text/javascript" src="../http/tests/inspector-protocol/resources/p
rotocol-test.js"></script> |
| 4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 function sendCommand(command, properties, callback) { | 8 function sendCommand(command, properties, callback) { |
| 9 InspectorTest.sendCommand(command, properties || {}, commandCallback); | 9 InspectorTest.sendCommand(command, properties || {}, commandCallback); |
| 10 function commandCallback(msg) | 10 function commandCallback(msg) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 sendCommand("DOM.querySelector", { "nodeId": root.nodeId , "selector": "
#fancy" }, onGotNode); | 25 sendCommand("DOM.querySelector", { "nodeId": root.nodeId , "selector": "
#fancy" }, onGotNode); |
| 26 } | 26 } |
| 27 | 27 |
| 28 function onGotNode(node) | 28 function onGotNode(node) |
| 29 { | 29 { |
| 30 sendCommand("CSS.getPlatformFontsForNode", { "nodeId": node.nodeId }, on
GotComputedFonts); | 30 sendCommand("CSS.getPlatformFontsForNode", { "nodeId": node.nodeId }, on
GotComputedFonts); |
| 31 } | 31 } |
| 32 | 32 |
| 33 function onGotComputedFonts(response) | 33 function onGotComputedFonts(response) |
| 34 { | 34 { |
| 35 var cssFamilyName = response.cssFamilyName; |
| 36 InspectorTest.log("cssFamilyName: " + cssFamilyName); |
| 35 var fonts = response.fonts; | 37 var fonts = response.fonts; |
| 36 fonts.sort(function(a, b) { | 38 fonts.sort(function(a, b) { |
| 37 return b.glyphCount - a.glyphCount; | 39 return b.glyphCount - a.glyphCount; |
| 38 }); | 40 }); |
| 39 for (var i = 0; i < fonts.length; ++i) | 41 for (var i = 0; i < fonts.length; ++i) |
| 40 fonts[i].familyName = "<Some-family-name-" + i + ">"; | 42 fonts[i].familyName = "<Some-family-name-" + i + ">"; |
| 41 InspectorTest.log(JSON.stringify(fonts)); | 43 InspectorTest.log(JSON.stringify(fonts)); |
| 42 InspectorTest.completeTest(); | 44 InspectorTest.completeTest(); |
| 43 } | 45 } |
| 44 }; | 46 }; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 68 <body> | 70 <body> |
| 69 | 71 |
| 70 <div id="fancy"> | 72 <div id="fancy"> |
| 71 First line. | 73 First line. |
| 72 <br> | 74 <br> |
| 73 Second line. | 75 Second line. |
| 74 </div> | 76 </div> |
| 75 | 77 |
| 76 </body> | 78 </body> |
| 77 </html> | 79 </html> |
| OLD | NEW |