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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js

Issue 2574603002: DevTools: Fix Elements tab event listener removal (Closed)
Patch Set: add test 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/http/tests/inspector/elements-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js
index e293c62468665e71eaf20471f0ddbf609151ee5b..5888404a525324b05ad165f88c726d7b14661443 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements-test.js
@@ -443,9 +443,23 @@ InspectorTest.showEventListenersWidget = function()
return UI.viewManager.showView("elements.eventListeners");
}
-InspectorTest.expandAndDumpSelectedElementEventListeners = function(callback)
+InspectorTest.expandAndDumpSelectedElementEventListeners = function(callback, force)
{
- InspectorTest.expandAndDumpEventListeners(InspectorTest.eventListenersWidget()._eventListenersView, callback);
+ InspectorTest.expandAndDumpEventListeners(InspectorTest.eventListenersWidget()._eventListenersView, callback, force);
+}
+
+InspectorTest.removeFirstEventListener = function()
+{
+ const treeOutline = InspectorTest.eventListenersWidget()._eventListenersView._treeOutline;
lushnikov 2016/12/15 22:33:16 style: const -> var. We don't use consts so far
phulce 2016/12/16 18:41:56 Done.
+ const listenerTypes = treeOutline.rootElement().children();
+ for (let i = 0; i < listenerTypes.length; i++) {
+ const listeners = listenerTypes[i].children();
+ if (listeners.length && !listenerTypes[i].hidden) {
+ listeners[0].eventListener().remove();
+ listeners[0]._removeListenerBar();
+ break;
+ }
+ }
}
InspectorTest.dumpObjectPropertySectionDeep = function(section)

Powered by Google App Engine
This is Rietveld 408576698