| 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 testClosedShadowRootChild(next) | 17 function testClosedShadowRootChild(next) |
| 18 { | 18 { |
| 19 InspectorTest.findNode(isClosedShadowRootChild, InspectorTest.select
ReloadAndDump.bind(null, next)); | 19 InspectorTest.findNode(isClosedShadowRootChild, InspectorTest.select
ReloadAndDump.bind(null, next)); |
| 20 }, | 20 }, |
| 21 | 21 |
| 22 function testUserAgentShadowRootChild(next) | 22 function testUserAgentShadowRootChild(next) |
| 23 { | 23 { |
| 24 InspectorTest.findNode(isUserAgentShadowRootChild, InspectorTest.sel
ectReloadAndDump.bind(null, next)); | 24 InspectorTest.findNode(isUserAgentShadowRootChild, InspectorTest.sel
ectReloadAndDump.bind(null, next)); |
| 25 }, | 25 }, |
| 26 ]); | 26 ]); |
| 27 | 27 |
| 28 function isClosedShadowRoot(node) | 28 function isClosedShadowRoot(node) |
| 29 { | 29 { |
| 30 return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRoot
Types.Closed; | 30 return node && node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.Clo
sed; |
| 31 } | 31 } |
| 32 | 32 |
| 33 function isUserAgentShadowRoot(node) | 33 function isUserAgentShadowRoot(node) |
| 34 { | 34 { |
| 35 return node && node.shadowRootType() === WebInspector.DOMNode.ShadowRoot
Types.UserAgent; | 35 return node && node.shadowRootType() === SDK.DOMNode.ShadowRootTypes.Use
rAgent; |
| 36 } | 36 } |
| 37 | 37 |
| 38 function isClosedShadowRootChild(node) | 38 function isClosedShadowRootChild(node) |
| 39 { | 39 { |
| 40 return isClosedShadowRoot(node.parentNode); | 40 return isClosedShadowRoot(node.parentNode); |
| 41 } | 41 } |
| 42 | 42 |
| 43 function isUserAgentShadowRootChild(node) | 43 function isUserAgentShadowRootChild(node) |
| 44 { | 44 { |
| 45 return isUserAgentShadowRoot(node.parentNode); | 45 return isUserAgentShadowRoot(node.parentNode); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 </script> | 49 </script> |
| 50 </head> | 50 </head> |
| 51 | 51 |
| 52 <body onload="runTest()"> | 52 <body onload="runTest()"> |
| 53 <p> | 53 <p> |
| 54 Tests that elements panel preserves selected shadow DOM node on page refresh. | 54 Tests that elements panel preserves selected shadow DOM node on page refresh. |
| 55 </p> | 55 </p> |
| 56 <span id="hostElement"></span><span id="closedHostElement"></span> | 56 <span id="hostElement"></span><span id="closedHostElement"></span> |
| 57 <script> | 57 <script> |
| 58 var root = document.getElementById("hostElement").createShadowRoot(); | 58 var root = document.getElementById("hostElement").createShadowRoot(); |
| 59 root.innerHTML = "<input type='text'>"; | 59 root.innerHTML = "<input type='text'>"; |
| 60 var closedRoot = document.getElementById("closedHostElement").attachShadow({mode
: 'closed'}); | 60 var closedRoot = document.getElementById("closedHostElement").attachShadow({mode
: 'closed'}); |
| 61 closedRoot.innerHTML = "<button></button>"; | 61 closedRoot.innerHTML = "<button></button>"; |
| 62 </script> | 62 </script> |
| 63 </body> | 63 </body> |
| 64 </html> | 64 </html> |
| OLD | NEW |