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