| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 5 <script src="./elements-panel-shadow-selection-on-refresh.js"></script> |
| 6 <script> |
| 7 |
| 8 function test() |
| 9 { |
| 10 InspectorTest.runTestSuite([ |
| 11 function setup(next) |
| 12 { |
| 13 WebInspector.settingForTest("showUAShadowDOM").set(true); |
| 14 InspectorTest.expandElementsTree(next); |
| 15 }, |
| 16 |
| 17 function testOpenShadowRoot(next) |
| 18 { |
| 19 InspectorTest.findNode(isOpenShadowRoot, InspectorTest.selectReloadA
ndDump.bind(null, next)); |
| 20 }, |
| 21 |
| 22 function testClosedShadowRoot(next) |
| 23 { |
| 24 InspectorTest.findNode(isClosedShadowRoot, InspectorTest.selectReloa
dAndDump.bind(null, next)); |
| 25 }, |
| 26 ]); |
| 27 |
| 28 function isOpenShadowRoot(node) |
| 29 { |
| 30 return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRoot
Types.Open; |
| 31 } |
| 32 |
| 33 function isClosedShadowRoot(node) |
| 34 { |
| 35 return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRoot
Types.Closed; |
| 36 } |
| 37 } |
| 38 |
| 39 </script> |
| 40 </head> |
| 41 |
| 42 <body onload="runTest()"> |
| 43 <p> |
| 44 Tests that elements panel preserves selected shadow DOM node on page refresh. |
| 45 </p> |
| 46 <span id="hostElement"></span><span id="closedHostElement"></span> |
| 47 <script> |
| 48 var root = document.getElementById("hostElement").createShadowRoot(); |
| 49 root.innerHTML = "<input type='text'>"; |
| 50 var closedRoot = document.getElementById("closedHostElement").attachShadow({mode
: 'closed'}); |
| 51 closedRoot.innerHTML = "<button></button>"; |
| 52 </script> |
| 53 </body> |
| 54 </html> |
| OLD | NEW |