| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 4 <script> |
| 5 |
| 6 function test() |
| 7 { |
| 8 InspectorTest.startDumpingProtocolMessages(); |
| 9 InspectorTest.sendCommand("Debugger.enable", {}, setEventListenerBreakpoint)
; |
| 10 |
| 11 function finishIfError(message) |
| 12 { |
| 13 if (message.result) |
| 14 return; |
| 15 testRunner.logToStderr("FAIL: finishIfError"); |
| 16 InspectorTest.log("FAIL: " + JSON.stringify(message)); |
| 17 InspectorTest.completeTest(); |
| 18 } |
| 19 |
| 20 function setEventListenerBreakpoint(message) |
| 21 { |
| 22 finishIfError(message); |
| 23 InspectorTest.log("PASS: Debugger was enabled"); |
| 24 InspectorTest.sendCommand("DOMDebugger.setEventListenerBreakpoint", {'ev
entName':'click'}, disableDOMAgent); |
| 25 } |
| 26 |
| 27 function disableDOMAgent(message) |
| 28 { |
| 29 finishIfError(message); |
| 30 InspectorTest.log("PASS: Listener was set and we expect that DOM agent w
as silently enabled."); |
| 31 InspectorTest.sendCommand("DOM.disable", {}, disableDOMAgent2); |
| 32 } |
| 33 |
| 34 function disableDOMAgent2(message) |
| 35 { |
| 36 finishIfError(message); |
| 37 InspectorTest.log("PASS: DOM agent was disabled successfully."); |
| 38 InspectorTest.sendCommand("DOM.disable", {}, finish); |
| 39 } |
| 40 |
| 41 function finish(message) |
| 42 { |
| 43 if (!message.error) { |
| 44 testRunner.logToStderr("FAIL: finish"); |
| 45 InspectorTest.log("FAIL: we expected an error but it wasn't happen."
); |
| 46 InspectorTest.completeTest(); |
| 47 return; |
| 48 } |
| 49 |
| 50 InspectorTest.log("PASS: The second attempt to disable DOM agent failed
as expected."); |
| 51 InspectorTest.completeTest(); |
| 52 } |
| 53 } |
| 54 </script> |
| 55 </head> |
| 56 <body onLoad="runTest();"> |
| 57 </body> |
| 58 </html> |
| OLD | NEW |