| Index: LayoutTests/inspector-protocol/debugger/debugger-setEventListenerBreakpoint-backward-compatibility.html
|
| diff --git a/LayoutTests/inspector-protocol/debugger/debugger-setEventListenerBreakpoint-backward-compatibility.html b/LayoutTests/inspector-protocol/debugger/debugger-setEventListenerBreakpoint-backward-compatibility.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a0363a289fc81db574087b2722de5acf49d51074
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector-protocol/debugger/debugger-setEventListenerBreakpoint-backward-compatibility.html
|
| @@ -0,0 +1,58 @@
|
| +<html>
|
| +<head>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| +<script>
|
| +
|
| +function test()
|
| +{
|
| + InspectorTest.startDumpingProtocolMessages();
|
| + InspectorTest.sendCommand("Debugger.enable", {}, setEventListenerBreakpoint);
|
| +
|
| + function finishIfError(message)
|
| + {
|
| + if (message.result)
|
| + return;
|
| + testRunner.logToStderr("FAIL: finishIfError");
|
| + InspectorTest.log("FAIL: " + JSON.stringify(message));
|
| + InspectorTest.completeTest();
|
| + }
|
| +
|
| + function setEventListenerBreakpoint(message)
|
| + {
|
| + finishIfError(message);
|
| + InspectorTest.log("PASS: Debugger was enabled");
|
| + InspectorTest.sendCommand("DOMDebugger.setEventListenerBreakpoint", {'eventName':'click'}, disableDOMAgent);
|
| + }
|
| +
|
| + function disableDOMAgent(message)
|
| + {
|
| + finishIfError(message);
|
| + InspectorTest.log("PASS: Listener was set and we expect that DOM agent was silently enabled.");
|
| + InspectorTest.sendCommand("DOM.disable", {}, disableDOMAgent2);
|
| + }
|
| +
|
| + function disableDOMAgent2(message)
|
| + {
|
| + finishIfError(message);
|
| + InspectorTest.log("PASS: DOM agent was disabled successfully.");
|
| + InspectorTest.sendCommand("DOM.disable", {}, finish);
|
| + }
|
| +
|
| + function finish(message)
|
| + {
|
| + if (!message.error) {
|
| + testRunner.logToStderr("FAIL: finish");
|
| + InspectorTest.log("FAIL: we expected an error but it wasn't happen.");
|
| + InspectorTest.completeTest();
|
| + return;
|
| + }
|
| +
|
| + InspectorTest.log("PASS: The second attempt to disable DOM agent failed as expected.");
|
| + InspectorTest.completeTest();
|
| + }
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onLoad="runTest();">
|
| +</body>
|
| +</html>
|
|
|