| Index: LayoutTests/inspector-protocol/css/css-get-platform-fonts.html | 
| diff --git a/LayoutTests/inspector-protocol/css/css-get-platform-fonts.html b/LayoutTests/inspector-protocol/css/css-get-platform-fonts.html | 
| index 9b9c98ef2bfea0d98e2be9a15b3ecf60f43288c0..09be5881aa2af67670ccf2e842d75de93f585d37 100644 | 
| --- a/LayoutTests/inspector-protocol/css/css-get-platform-fonts.html | 
| +++ b/LayoutTests/inspector-protocol/css/css-get-platform-fonts.html | 
| @@ -1,36 +1,50 @@ | 
| <html> | 
| <head> | 
| <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> | 
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/css-protocol-test.js"></script> | 
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/dom-protocol-test.js"></script> | 
| <script type="text/javascript"> | 
|  | 
| function test() | 
| { | 
| -    function sendCommand(command, properties, callback) { | 
| -        InspectorTest.sendCommand(command, properties || {}, commandCallback); | 
| -        function commandCallback(msg) | 
| -        { | 
| -            if (msg.error) { | 
| -                InspectorTest.log(msg.error.message); | 
| -                InspectorTest.completeTest(); | 
| -                return; | 
| -            } | 
| -            callback(msg.result); | 
| -        } | 
| -    } | 
| -    sendCommand("DOM.getDocument", {}, onGotDocument); | 
| +    var documentNodeId; | 
|  | 
| -    function onGotDocument(result) | 
| +    InspectorTest.requestDocumentNodeId(onDocumentNodeId); | 
| + | 
| +    function onDocumentNodeId(nodeId) | 
| { | 
| -        var root = result.root; | 
| -        sendCommand("DOM.querySelector", { "nodeId": root.nodeId , "selector": "#fancy" }, onGotNode); | 
| +        documentNodeId = nodeId; | 
| +        InspectorTest.runTestSuite([ | 
| +            function testFirstLetterPseudoClass(next) | 
| +            { | 
| +                platformFontsForElementWithSelector("#fancy", next); | 
| +            }, | 
| + | 
| +            function testSelectElementPlatformFonts(next) | 
| +            { | 
| +                platformFontsForElementWithSelector("select", next); | 
| +            } | 
| +        ]); | 
| } | 
|  | 
| -    function onGotNode(node) | 
| + | 
| +    function platformFontsForElementWithSelector(selector, callback) | 
| { | 
| -        sendCommand("CSS.getPlatformFontsForNode", { "nodeId": node.nodeId }, onGotComputedFonts); | 
| +        InspectorTest.requestNodeId(documentNodeId, selector, onNodeId); | 
| + | 
| +        function onNodeId(nodeId) | 
| +        { | 
| +            InspectorTest.sendCommandOrDie("CSS.getPlatformFontsForNode", { nodeId: nodeId }, onGotComputedFonts); | 
| +        } | 
| + | 
| +        function onGotComputedFonts(response) | 
| +        { | 
| +            dumpComputedFonts(response); | 
| +            callback(); | 
| +        } | 
| } | 
|  | 
| -    function onGotComputedFonts(response) | 
| +    function dumpComputedFonts(response) | 
| { | 
| var cssFamilyName = response.cssFamilyName; | 
| InspectorTest.log("cssFamilyName: " + cssFamilyName); | 
| @@ -41,7 +55,6 @@ function test() | 
| for (var i = 0; i < fonts.length; ++i) | 
| fonts[i].familyName = "<Some-family-name-" + i + ">"; | 
| InspectorTest.log(JSON.stringify(fonts)); | 
| -        InspectorTest.completeTest(); | 
| } | 
| }; | 
|  | 
| @@ -70,10 +83,13 @@ window.addEventListener("DOMContentLoaded", function () { | 
| <body> | 
|  | 
| <div id="fancy"> | 
| -First line. | 
| -<br> | 
| -Second line. | 
| +7chars.<br> | 
| +Some line with 29 characters. | 
| </div> | 
| +<select> | 
| +    <option>Short</option> | 
| +    <option selected>Option with a lot of chars.</option> | 
| +</select> | 
|  | 
| </body> | 
| </html> | 
|  |