| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 | 3 |
| 4 <link rel="stylesheet" href="resources/styles-new-API.css"> | 4 <link rel="stylesheet" href="resources/styles-new-API.css"> |
| 5 | 5 |
| 6 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 6 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 7 <script src="../../../http/tests/inspector/elements-test.js"></script> | 7 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 8 <script src="../styles/styles-test.js"></script> | 8 <script src="../styles/styles-test.js"></script> |
| 9 <script> | 9 <script> |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 { | 72 { |
| 73 if (error) { | 73 if (error) { |
| 74 InspectorTest.addResult("error: " + error); | 74 InspectorTest.addResult("error: " + error); |
| 75 InspectorTest.completeTest(); | 75 InspectorTest.completeTest(); |
| 76 return; | 76 return; |
| 77 } | 77 } |
| 78 | 78 |
| 79 resultStyles.matchedCSSRules = matchedCSSRules; | 79 resultStyles.matchedCSSRules = matchedCSSRules; |
| 80 resultStyles.pseudoElements = pseudoElements; | 80 resultStyles.pseudoElements = pseudoElements; |
| 81 resultStyles.inherited = inherited; | 81 resultStyles.inherited = inherited; |
| 82 callback(resultStyles); | |
| 83 } | 82 } |
| 84 | 83 |
| 85 function nodeCallback(node) | 84 function nodeCallback(node) |
| 86 { | 85 { |
| 87 bodyId = node.id; | 86 bodyId = node.id; |
| 88 InspectorTest.CSSAgent.getComputedStyleForNode(node.id, computed
Callback); | 87 var promises = [ |
| 89 InspectorTest.CSSAgent.getInlineStylesForNode(node.id, inlineCal
lback); | 88 InspectorTest.CSSAgent.getComputedStyleForNode(node.id, comp
utedCallback), |
| 90 InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, false, f
alse, matchedCallback); | 89 InspectorTest.CSSAgent.getInlineStylesForNode(node.id, inlin
eCallback), |
| 90 InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, fals
e, false, matchedCallback) |
| 91 ]; |
| 92 Promise.all(promises).then(callback.bind(null, resultStyles)); |
| 91 } | 93 } |
| 92 InspectorTest.selectNodeWithId("mainBody", nodeCallback); | 94 InspectorTest.selectNodeWithId("mainBody", nodeCallback); |
| 93 }, | 95 }, |
| 94 | 96 |
| 95 function test_forcedState(next) | 97 function test_forcedState(next) |
| 96 { | 98 { |
| 97 InspectorTest.CSSAgent.forcePseudoState(bodyId, ["hover"]); | 99 InspectorTest.CSSAgent.forcePseudoState(bodyId, ["hover"]); |
| 98 InspectorTest.CSSAgent.getMatchedStylesForNode(bodyId, false, false,
matchedCallback); | 100 InspectorTest.CSSAgent.getMatchedStylesForNode(bodyId, false, false,
matchedCallback); |
| 99 | 101 |
| 100 function matchedCallback(error, matchedRules) | 102 function matchedCallback(error, matchedRules) |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 277 |
| 276 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-
weight: normal; width: 85%; background-image: url(bar.png)"> | 278 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-
weight: normal; width: 85%; background-image: url(bar.png)"> |
| 277 <p> | 279 <p> |
| 278 Tests that InspectorCSSAgent API methods work as expected. | 280 Tests that InspectorCSSAgent API methods work as expected. |
| 279 </p> | 281 </p> |
| 280 <table width="50%" id="thetable"> | 282 <table width="50%" id="thetable"> |
| 281 </table> | 283 </table> |
| 282 <h1 id="toggle">H1</h1> | 284 <h1 id="toggle">H1</h1> |
| 283 </body> | 285 </body> |
| 284 </html> | 286 </html> |
| OLD | NEW |