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> | 4 <script> |
5 | 5 |
6 function eventListenerSuicidal(event) | 6 function eventListenerSuicidal(event) |
7 { | 7 { |
8 event.target.removeEventListener("wheel", eventListenerSuicidal); | 8 event.target.removeEventListener("wheel", eventListenerSuicidal); |
9 } | 9 } |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 target.dispatchEvent(wheelEvent); | 60 target.dispatchEvent(wheelEvent); |
61 } | 61 } |
62 | 62 |
63 function test() | 63 function test() |
64 { | 64 { |
65 ConsoleModel.consoleModel.addEventListener(ConsoleModel.ConsoleModel.Events.
MessageAdded, InspectorTest.safeWrap(onConsoleMessage)); | 65 ConsoleModel.consoleModel.addEventListener(ConsoleModel.ConsoleModel.Events.
MessageAdded, InspectorTest.safeWrap(onConsoleMessage)); |
66 step1(); | 66 step1(); |
67 | 67 |
68 function step1() | 68 function step1() |
69 { | 69 { |
70 InspectorTest.mainTarget.logAgent().startViolationsReport([ | 70 InspectorTest.mainTarget._dispatcher.logAgent().startViolationsReport([ |
71 {name: 'blockedEvent', threshold: 30000}]); | 71 {name: 'blockedEvent', threshold: 30000}]); |
72 InspectorTest.evaluateInPage("dispatchEvents()", step2); | 72 InspectorTest.evaluateInPage("dispatchEvents()", step2); |
73 } | 73 } |
74 | 74 |
75 function step2() | 75 function step2() |
76 { | 76 { |
77 InspectorTest.mainTarget.logAgent().startViolationsReport([ | 77 InspectorTest.mainTarget._dispatcher.logAgent().startViolationsReport([ |
78 {name: 'blockedEvent', threshold: 0.001}]); | 78 {name: 'blockedEvent', threshold: 0.001}]); |
79 InspectorTest.addResult("There should be no warnings above this line"); | 79 InspectorTest.addResult("There should be no warnings above this line"); |
80 InspectorTest.evaluateInPage("dispatchEvents()", () => InspectorTest.com
pleteTest()); | 80 InspectorTest.evaluateInPage("dispatchEvents()", () => InspectorTest.com
pleteTest()); |
81 } | 81 } |
82 | 82 |
83 function onConsoleMessage(event) | 83 function onConsoleMessage(event) |
84 { | 84 { |
85 var message = event.data; | 85 var message = event.data; |
86 var text = message.messageText; | 86 var text = message.messageText; |
87 InspectorTest.addResult(text.replace(/ \d+ ms/, " <number> ms")); | 87 InspectorTest.addResult(text.replace(/ \d+ ms/, " <number> ms")); |
88 } | 88 } |
89 } | 89 } |
90 </script> | 90 </script> |
91 </head> | 91 </head> |
92 <body onload="runTest()"> | 92 <body onload="runTest()"> |
93 <p>Tests that console warnings are issued for a blocked event listener and that | 93 <p>Tests that console warnings are issued for a blocked event listener and that |
94 there is no crash when an offending listener is removed by the handler.</p> | 94 there is no crash when an offending listener is removed by the handler.</p> |
95 </div> | 95 </div> |
96 </body> | 96 </body> |
97 </html> | 97 </html> |
OLD | NEW |