Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-remove.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-remove.html b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-remove.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f75defaceb597375c58d6a424bd1daae1f512ea6 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-remove.html |
| @@ -0,0 +1,73 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/elements-test.js"></script> |
| +<script> |
| +// window.debugTest = true; |
|
lushnikov
2016/12/15 22:33:16
let's kill this
phulce
2016/12/16 18:41:56
whoops! done
|
| +function setupEventListeners() |
| +{ |
| + function f() {} |
| + function g() {} |
| + var button = document.getElementById("node"); |
| + button.addEventListener("click", f, false); |
| + button.addEventListener("mouseover", f, false); |
| + var sibling = document.getElementById("node-sibling"); |
| + sibling.addEventListener("click", g, false); |
| + sibling.addEventListener("mouseover", g, false); |
| +} |
| + |
| +function test() |
| +{ |
| + Common.settingForTest("showEventListenersForAncestors").set(false); |
| + |
| + |
| + function step1() |
| + { |
| + InspectorTest.selectNodeWithId("node", function () { |
| + InspectorTest.expandAndDumpSelectedElementEventListeners(step2); |
| + }); |
| + } |
| + |
| + function step2() |
| + { |
| + InspectorTest.removeFirstEventListener(); |
| + InspectorTest.addResult("Listeners after removal:"); |
| + InspectorTest.expandAndDumpSelectedElementEventListeners(step3, true); |
| + } |
| + |
| + function step3() |
| + { |
| + InspectorTest.selectNodeWithId("node-sibling", function () { |
| + InspectorTest.addResult("Listeners for sibling node:"); |
| + InspectorTest.expandAndDumpSelectedElementEventListeners(step4); |
| + }); |
| + } |
| + |
| + function step4() |
| + { |
| + InspectorTest.completeTest(); |
| + } |
| + |
| + step1(); |
| +} |
| + |
| +function onloadHandler() |
| +{ |
| + setupEventListeners(); |
| + runTest(); |
| +} |
| +</script> |
| +</head> |
| + |
| + |
| + |
| +<body onload="onloadHandler()"> |
| +<p> |
| +Tests removing event listeners in the Elements sidebar panel. |
| +</p> |
| + |
| +<button id="node">Inspect Me</button> |
| +<button id="node-sibling">Inspect Sibling</button> |
| + |
| +</body> |
| +</html> |