OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
5 <script> | 5 <script> |
6 function documentClickHandler(event) { console.log("click - document - attribute
"); } | 6 function documentClickHandler(event) { console.log("click - document - attribute
"); } |
7 | 7 |
8 function setupEventListeners() | 8 function setupEventListeners() |
9 { | 9 { |
10 function f() {} | 10 function f() {} |
(...skipping 18 matching lines...) Expand all Loading... |
29 function EventListenerImpl() { document.addEventListener("click", this, true
); } | 29 function EventListenerImpl() { document.addEventListener("click", this, true
); } |
30 EventListenerImpl.prototype.toString = function() { return "EventListenerImp
l"; } | 30 EventListenerImpl.prototype.toString = function() { return "EventListenerImp
l"; } |
31 EventListenerImpl.prototype.handleEvent = function() { console.log("click -
document - handleEvent"); } | 31 EventListenerImpl.prototype.handleEvent = function() { console.log("click -
document - handleEvent"); } |
32 new EventListenerImpl(); | 32 new EventListenerImpl(); |
33 } | 33 } |
34 | 34 |
35 function test() | 35 function test() |
36 { | 36 { |
37 var sidebarPane = WebInspector.panels.elements.sidebarPanes.eventListeners; | 37 var sidebarPane = WebInspector.panels.elements.sidebarPanes.eventListeners; |
38 | 38 |
39 WebInspector.settingForTest("eventListenersFilter").set("all"); | 39 WebInspector.settingForTest("showEventListenersForAncestors").set(true); |
40 InspectorTest.selectNodeWithId("node", step1); | 40 InspectorTest.selectNodeWithId("node", step1); |
41 | 41 |
42 function step1() | 42 function step1() |
43 { | 43 { |
44 InspectorTest.expandAndDumpSelectedElementEventListeners(step2); | 44 InspectorTest.expandAndDumpSelectedElementEventListeners(step2); |
45 } | 45 } |
46 | 46 |
47 function step2() | 47 function step2() |
48 { | 48 { |
49 InspectorTest.selectNodeWithId("node-without-listeners", step3); | 49 InspectorTest.selectNodeWithId("node-without-listeners", step3); |
50 } | 50 } |
51 | 51 |
52 function step3() | 52 function step3() |
53 { | 53 { |
54 var eventListenersWidget = InspectorTest.eventListenersWidget(); | 54 WebInspector.settingForTest("showEventListenersForAncestors").set(false)
; |
55 eventListenersWidget._settingsSelectElement.selectedIndex = 1; | |
56 eventListenersWidget._changeSetting(); | |
57 InspectorTest.addResult("Listeners for selected node only(should be no l
isteners):"); | 55 InspectorTest.addResult("Listeners for selected node only(should be no l
isteners):"); |
58 InspectorTest.expandAndDumpSelectedElementEventListeners(step4); | 56 InspectorTest.expandAndDumpSelectedElementEventListeners(step4); |
59 } | 57 } |
60 | 58 |
61 function step4() | 59 function step4() |
62 { | 60 { |
63 InspectorTest.completeTest(); | 61 InspectorTest.completeTest(); |
64 } | 62 } |
65 } | 63 } |
66 | 64 |
67 function onloadHandler() | 65 function onloadHandler() |
68 { | 66 { |
69 setupEventListeners(); | 67 setupEventListeners(); |
70 runTest(); | 68 runTest(); |
71 } | 69 } |
72 </script> | 70 </script> |
73 </head> | 71 </head> |
74 | 72 |
75 <body onload="onloadHandler()"> | 73 <body onload="onloadHandler()"> |
76 <p> | 74 <p> |
77 Tests event listeners output in the Elements sidebar panel. | 75 Tests event listeners output in the Elements sidebar panel. |
78 </p> | 76 </p> |
79 | 77 |
80 <button id="node">Inspect Me</button> | 78 <button id="node">Inspect Me</button> |
81 | 79 |
82 <div id="node-without-listeners"></div> | 80 <div id="node-without-listeners"></div> |
83 | 81 |
84 </body> | 82 </body> |
85 </html> | 83 </html> |
OLD | NEW |