Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function pseudoVisibility(resolve, reject, pseudo) | |
| 8 { | |
| 9 var parentNode = document.getElementById("parent-node"); | |
| 10 resolve(getComputedStyle(parentNode, ":" + pseudo).visibility); | |
| 11 } | |
| 12 | |
| 13 function pseudoIframeVisibility(resolve, reject, pseudo) | |
|
dgozman
2015/08/07 23:35:05
You never pass |pseudo| here. Remove?
pfeldman
2015/08/10 21:25:16
Done.
| |
| 14 { | |
| 15 var parentNode = frames[0].document.getElementById("frame-node"); | |
| 16 resolve(getComputedStyle(parentNode, ":" + pseudo).visibility); | |
| 17 } | |
| 18 | |
| 7 function test() | 19 function test() |
| 8 { | 20 { |
| 9 var treeOutline; | 21 var treeOutline; |
| 10 var parentNode; | 22 var parentNode; |
| 11 var childNode; | 23 var childNode; |
| 12 var frameNode; | 24 var frameNode; |
| 13 | 25 |
| 14 InspectorTest.runTestSuite([ | 26 InspectorTest.runTestSuite([ |
| 15 function testSetUp(next) | 27 function testSetUp(next) |
| 16 { | 28 { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 { | 118 { |
| 107 testPseudoToggle(parentNode.afterPseudoElement(), next); | 119 testPseudoToggle(parentNode.afterPseudoElement(), next); |
| 108 }, | 120 }, |
| 109 | 121 |
| 110 function testToggleHideShortcutOnInFrame(next) | 122 function testToggleHideShortcutOnInFrame(next) |
| 111 { | 123 { |
| 112 treeOutline.toggleHideElement(frameNode, callback); | 124 treeOutline.toggleHideElement(frameNode, callback); |
| 113 | 125 |
| 114 function callback() | 126 function callback() |
| 115 { | 127 { |
| 116 InspectorTest.addResult("=== Added hide shortcut in frame ==="); | 128 InspectorTest.invokePageFunctionPromise("pseudoIframeVisibility" , []).then(function(result) { |
| 117 InspectorTest.cssModel.computedStylePromise(frameNode.id).then(c allback2); | 129 InspectorTest.addResult("=== Added hide shortcut in frame == ="); |
| 118 } | 130 InspectorTest.addResult("=== Frame node is hidden ==="); |
| 119 | 131 InspectorTest.addResult("visibility: " + result + ";"); |
| 120 function callback2(style) | 132 next(); |
| 121 { | 133 }); |
| 122 InspectorTest.addResult("=== Frame node is hidden ==="); | |
| 123 InspectorTest.addResult(style.getLiveProperty("visibility").prop ertyText); | |
| 124 next(); | |
| 125 } | 134 } |
| 126 } | 135 } |
| 127 ]); | 136 ]); |
| 128 | 137 |
| 129 function testPseudoToggle(pseudoNode, next) | 138 function testPseudoToggle(pseudoNode, next) |
| 130 { | 139 { |
| 131 treeOutline.toggleHideElement(pseudoNode, callback); | 140 treeOutline.toggleHideElement(pseudoNode, callback); |
| 132 | |
| 133 function callback() | 141 function callback() |
| 134 { | 142 { |
| 135 InspectorTest.cssModel.computedStylePromise(pseudoNode.id).then(call back2); | 143 InspectorTest.invokePageFunctionPromise("pseudoVisibility", [pseudoN ode.pseudoType()]).then(function(result) { |
| 136 } | 144 InspectorTest.addResult("::" + pseudoNode.pseudoType() + " node visibility: '" + result + "'"); |
| 137 | 145 next(); |
| 138 function callback2(style) | 146 }); |
| 139 { | |
| 140 InspectorTest.addResult("::" + pseudoNode.pseudoType() + " node visi bility: '" + style.getLiveProperty("visibility").value + "'"); | |
| 141 next(); | |
| 142 } | 147 } |
| 143 } | 148 } |
| 144 } | 149 } |
| 145 </script> | 150 </script> |
| 146 <style> | 151 <style> |
| 147 #parent-node::before { | 152 #parent-node::before { |
| 148 content: "before"; | 153 content: "before"; |
| 149 } | 154 } |
| 150 | 155 |
| 151 #parent-node::after { | 156 #parent-node::after { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 163 <div id="parent-node">parent | 168 <div id="parent-node">parent |
| 164 <div style="visibility:hidden">hidden | 169 <div style="visibility:hidden">hidden |
| 165 <div id="child-node" style="visibility:visible">child</div> | 170 <div id="child-node" style="visibility:visible">child</div> |
| 166 </div> | 171 </div> |
| 167 </div> | 172 </div> |
| 168 | 173 |
| 169 <iframe src="resources/hide-shortcut-iframe.html" onload="runTest()"> | 174 <iframe src="resources/hide-shortcut-iframe.html" onload="runTest()"> |
| 170 | 175 |
| 171 </body> | 176 </body> |
| 172 </html> | 177 </html> |
| OLD | NEW |