| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <style id="style"> | 3 <style id="style"> |
| 4 #inspected { | 4 #inspected { |
| 5 background-color: green; | 5 background-color: green; |
| 6 } | 6 } |
| 7 </style> | 7 </style> |
| 8 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 8 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 9 <script src="../../../http/tests/inspector/elements-test.js"></script> | 9 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 10 <script> | 10 <script> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 { | 24 { |
| 25 if (method === "CSS.getComputedStyleForNode" && params.nodeId === nodeId
) | 25 if (method === "CSS.getComputedStyleForNode" && params.nodeId === nodeId
) |
| 26 ++backendCallCount; | 26 ++backendCallCount; |
| 27 } | 27 } |
| 28 | 28 |
| 29 function step1(node) | 29 function step1(node) |
| 30 { | 30 { |
| 31 var callsLeft = 2; | 31 var callsLeft = 2; |
| 32 nodeId = node.id; | 32 nodeId = node.id; |
| 33 InspectorTest.addSniffer(InspectorBackend.connection(), "_wrapCallbackAn
dSendMessageObject", onBackendCall, true); | 33 InspectorTest.addSniffer(InspectorBackend.connection(), "_wrapCallbackAn
dSendMessageObject", onBackendCall, true); |
| 34 WebInspector.cssModel.getComputedStyleAsync(nodeId, styleCallback); | 34 InspectorTest.cssModel.getComputedStyleAsync(nodeId, styleCallback); |
| 35 WebInspector.cssModel.getComputedStyleAsync(nodeId, styleCallback); | 35 InspectorTest.cssModel.getComputedStyleAsync(nodeId, styleCallback); |
| 36 function styleCallback() | 36 function styleCallback() |
| 37 { | 37 { |
| 38 if (--callsLeft) | 38 if (--callsLeft) |
| 39 return; | 39 return; |
| 40 InspectorTest.addResult("# of backend calls sent [2 requests]: " + b
ackendCallCount); | 40 InspectorTest.addResult("# of backend calls sent [2 requests]: " + b
ackendCallCount); |
| 41 InspectorTest.evaluateInPage("updateStyle()", step2); | 41 InspectorTest.evaluateInPage("updateStyle()", step2); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 function step2() | 45 function step2() |
| 46 { | 46 { |
| 47 WebInspector.cssModel.getComputedStyleAsync(nodeId, callback); | 47 InspectorTest.cssModel.getComputedStyleAsync(nodeId, callback); |
| 48 function callback() | 48 function callback() |
| 49 { | 49 { |
| 50 InspectorTest.addResult("# of backend calls sent [style update + ano
ther request]: " + backendCallCount); | 50 InspectorTest.addResult("# of backend calls sent [style update + ano
ther request]: " + backendCallCount); |
| 51 InspectorTest.completeTest(); | 51 InspectorTest.completeTest(); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 </script> | 55 </script> |
| 56 </head> | 56 </head> |
| 57 | 57 |
| 58 <body onload="runTest()"> | 58 <body onload="runTest()"> |
| 59 <p> | 59 <p> |
| 60 Tests that computed styles are cached across synchronous requests. | 60 Tests that computed styles are cached across synchronous requests. |
| 61 </p> | 61 </p> |
| 62 | 62 |
| 63 <div> | 63 <div> |
| 64 <div id="inspected">Test</div> | 64 <div id="inspected">Test</div> |
| 65 </div> | 65 </div> |
| 66 | 66 |
| 67 </body> | 67 </body> |
| 68 </html> | 68 </html> |
| OLD | NEW |