Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: third_party/WebKit/LayoutTests/inspector/elements/event-listener-sidebar-remove.html

Issue 2574603002: DevTools: Fix Elements tab event listener removal (Closed)
Patch Set: address feedback Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..9deabf444fb2b1443d1d780a876f883bfb514c9a
--- /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>
+
+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>

Powered by Google App Engine
This is Rietveld 408576698