Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: LayoutTests/inspector-protocol/debugger/debugger-setEventListenerBreakpoint-backward-compatibility.html

Issue 1129473003: DevTools: respond with error when Debugger command is sent to disabled debugger agent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698