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

Side by Side 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 unified diff | Download patch
OLDNEW
1 var initialize_ElementTest = function() { 1 var initialize_ElementTest = function() {
2 2
3 InspectorTest.preloadPanel("elements"); 3 InspectorTest.preloadPanel("elements");
4 4
5 InspectorTest.inlineStyleSection = function() 5 InspectorTest.inlineStyleSection = function()
6 { 6 {
7 return UI.panels.elements._stylesWidget._sectionBlocks[0].sections[0]; 7 return UI.panels.elements._stylesWidget._sectionBlocks[0].sections[0];
8 } 8 }
9 9
10 InspectorTest.computedStyleWidget = function() 10 InspectorTest.computedStyleWidget = function()
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 { 436 {
437 UI.viewManager.showView("elements.eventListeners"); 437 UI.viewManager.showView("elements.eventListeners");
438 return self.runtime.sharedInstance(Elements.EventListenersWidget); 438 return self.runtime.sharedInstance(Elements.EventListenersWidget);
439 } 439 }
440 440
441 InspectorTest.showEventListenersWidget = function() 441 InspectorTest.showEventListenersWidget = function()
442 { 442 {
443 return UI.viewManager.showView("elements.eventListeners"); 443 return UI.viewManager.showView("elements.eventListeners");
444 } 444 }
445 445
446 InspectorTest.expandAndDumpSelectedElementEventListeners = function(callback) 446 InspectorTest.expandAndDumpSelectedElementEventListeners = function(callback, fo rce)
447 { 447 {
448 InspectorTest.expandAndDumpEventListeners(InspectorTest.eventListenersWidget ()._eventListenersView, callback); 448 InspectorTest.expandAndDumpEventListeners(InspectorTest.eventListenersWidget ()._eventListenersView, callback, force);
449 }
450
451 InspectorTest.removeFirstEventListener = function()
452 {
453 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.
454 const listenerTypes = treeOutline.rootElement().children();
455 for (let i = 0; i < listenerTypes.length; i++) {
456 const listeners = listenerTypes[i].children();
457 if (listeners.length && !listenerTypes[i].hidden) {
458 listeners[0].eventListener().remove();
459 listeners[0]._removeListenerBar();
460 break;
461 }
462 }
449 } 463 }
450 464
451 InspectorTest.dumpObjectPropertySectionDeep = function(section) 465 InspectorTest.dumpObjectPropertySectionDeep = function(section)
452 { 466 {
453 function domNodeToString(node) { 467 function domNodeToString(node) {
454 if (node) 468 if (node)
455 return "'" + node.textContent + "'"; 469 return "'" + node.textContent + "'";
456 else 470 else
457 return "null"; 471 return "null";
458 } 472 }
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 InspectorTest.dumpAnimationTimeline = function(timeline) 985 InspectorTest.dumpAnimationTimeline = function(timeline)
972 { 986 {
973 for (var ui of timeline._uiAnimations) { 987 for (var ui of timeline._uiAnimations) {
974 InspectorTest.addResult(ui.animation().type()); 988 InspectorTest.addResult(ui.animation().type());
975 InspectorTest.addResult(ui._nameElement.innerHTML); 989 InspectorTest.addResult(ui._nameElement.innerHTML);
976 InspectorTest.addResult(ui._svg.innerHTML); 990 InspectorTest.addResult(ui._svg.innerHTML);
977 } 991 }
978 } 992 }
979 993
980 }; 994 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698