| 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", {}, setEventListenerBreakpointW
henDOMDisabled); | |
| 10 | |
| 11 function finishIfError(message) | |
| 12 { | |
| 13 if (message.result) | |
| 14 return; | |
| 15 InspectorTest.log("FAIL: " + JSON.stringify(message)); | |
| 16 InspectorTest.completeTest(); | |
| 17 } | |
| 18 | |
| 19 function setEventListenerBreakpointWhenDOMDisabled(message) | |
| 20 { | |
| 21 finishIfError(message); | |
| 22 InspectorTest.log("PASS: Debugger was enabled"); | |
| 23 InspectorTest.sendCommand("DOMDebugger.setEventListenerBreakpoint", {'ev
entName':'click'}, enableDOMAgent); | |
| 24 } | |
| 25 | |
| 26 function enableDOMAgent(message) | |
| 27 { | |
| 28 InspectorTest.log("Error on attempt to set event listener breakpoint whe
n DOM is disabled: " + message.error.message); | |
| 29 InspectorTest.sendCommand("DOM.enable", {}, setEventListenerBreakpoint); | |
| 30 } | |
| 31 | |
| 32 function setEventListenerBreakpoint(message) | |
| 33 { | |
| 34 finishIfError(message); | |
| 35 InspectorTest.log("PASS: DOM was enabled"); | |
| 36 InspectorTest.sendCommand("DOMDebugger.setEventListenerBreakpoint", {'ev
entName':'click'}, disableDOMAgent); | |
| 37 } | |
| 38 | |
| 39 | |
| 40 function disableDOMAgent(message) | |
| 41 { | |
| 42 finishIfError(message); | |
| 43 InspectorTest.log("PASS: Listener was set."); | |
| 44 InspectorTest.sendCommand("DOM.disable", {}, disableDOMAgent2); | |
| 45 } | |
| 46 | |
| 47 function disableDOMAgent2(message) | |
| 48 { | |
| 49 finishIfError(message); | |
| 50 InspectorTest.log("PASS: DOM agent was disabled successfully."); | |
| 51 InspectorTest.sendCommand("DOM.disable", {}, finish); | |
| 52 } | |
| 53 | |
| 54 function finish(message) | |
| 55 { | |
| 56 if (!message.error) { | |
| 57 InspectorTest.log("FAIL: we expected an error but it wasn't happen."
); | |
| 58 InspectorTest.completeTest(); | |
| 59 return; | |
| 60 } | |
| 61 | |
| 62 InspectorTest.log("PASS: The second attempt to disable DOM agent failed
as expected."); | |
| 63 InspectorTest.completeTest(); | |
| 64 } | |
| 65 } | |
| 66 </script> | |
| 67 </head> | |
| 68 <body onLoad="runTest();"> | |
| 69 </body> | |
| 70 </html> | |
| OLD | NEW |