Chromium Code Reviews| Index: LayoutTests/inspector/elements/inspect-mode-shadow-text.html |
| diff --git a/LayoutTests/inspector/elements/inspect-mode-shadow-text.html b/LayoutTests/inspector/elements/inspect-mode-shadow-text.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4ef5c3e58e8b68952e7164467c0fd24fa5d3b8e7 |
| --- /dev/null |
| +++ b/LayoutTests/inspector/elements/inspect-mode-shadow-text.html |
| @@ -0,0 +1,60 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/elements-test.js"></script> |
| + |
| +<script> |
| + |
| +function click() |
| +{ |
| + var target = document.getElementById("host"); |
| + var rect = target.getBoundingClientRect(); |
| + // Simulate the mouse click over the target to trigger an event dispatch. |
| + if (window.eventSender) { |
| + window.eventSender.mouseMoveTo(rect.left + 10, rect.top + 10); |
| + window.eventSender.mouseDown(); |
| + window.eventSender.mouseUp(); |
| + } |
| +} |
| + |
| +function test() |
| +{ |
| + WebInspector.inspectorView.showPanel("elements"); |
|
apavlov
2014/03/18 08:49:39
optional: I've seen fast/ tests using eventSender
apavlov
2014/03/18 08:49:39
Won't the Elements panel open automatically?
pfeldman
2014/03/18 09:15:46
Done.
pfeldman
2014/03/18 09:15:46
We will only reach the sender if harness is there
|
| + step1(); |
| + |
| + function step1() |
| + { |
| + WebInspector.domAgent.setInspectModeEnabled(true, false, step2); |
| + } |
| + |
| + function step2() |
| + { |
| + WebInspector.panels.elements.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step3); |
| + InspectorTest.evaluateInPage("click()"); |
| + } |
| + |
| + function step3() |
| + { |
| + WebInspector.panels.elements.treeOutline.removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step3); |
| + var selectedElement = WebInspector.panels.elements.treeOutline.selectedTreeElement; |
| + InspectorTest.addResult("Node selected: " + selectedElement.representedObject.getAttribute("id")); |
| + InspectorTest.completeTest(); |
| + } |
| +} |
| + |
| +</script> |
| +</head> |
| + |
| +<body onload="runTest()"> |
| + |
| +<p>Test that devtools can inspect text element under shadow root.</p> |
| + |
| +<div><div><div id="host"></div></div></div> |
| +<script> |
| + var host = document.querySelector('#host'); |
| + var sr = host.createShadowRoot(); |
| + sr.innerHTML = "Text Text Text<br>Text Text Text"; |
| +</script> |
| + |
| +</body> |
| +</html> |