| 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 12 matching lines...) Expand all Loading... |
| 23 function onBackendCall(domain, method, params) | 23 function onBackendCall(domain, method, params) |
| 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(InspectorTest.connection, "_wrapCallbackAndSend
MessageObject", onBackendCall, true); |
| 34 InspectorTest.cssModel.computedStylePromise(nodeId).then(styleCallback); | 34 InspectorTest.cssModel.computedStylePromise(nodeId).then(styleCallback); |
| 35 InspectorTest.cssModel.computedStylePromise(nodeId).then(styleCallback); | 35 InspectorTest.cssModel.computedStylePromise(nodeId).then(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 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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 |