Web Inspector: Remove recompileAllJSFunctions timer in ScriptDebugServer
[WebKit-https.git] / LayoutTests / inspector-protocol / debugger / breakpoint-eval-with-exception.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
4 <script src="resources/breakpoint.js"></script>
5 <script>
6 function test()
7 {
8     InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
9     {
10         if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
11             InspectorTest.log("Found breakpoint.js");
12             var breakpoint = {
13                 location: {
14                     scriptId: messageObject.params.scriptId,
15                     lineNumber: 3,
16                     columnNumber: 0
17                 }
18             };
19             InspectorTest.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorTest.checkForError);
20             InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorTest.checkForError);
21             InspectorTest.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"}, function() {
22                 completeTest();
23             });
24         }
25     }
26
27     InspectorTest.eventHandler["Debugger.paused"] = onBreakpointHit;
28
29     function onBreakpointHit(messageObject)
30     {
31         InspectorTest.log("PASS: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
32
33         // Make sure we do not pause again in the debugger.
34         InspectorTest.eventHandler["Debugger.paused"] = onPausedOnException;
35
36         InspectorTest.sendCommand("Runtime.evaluate", {expression: "this.should.trigger.an.exception"}, function(messageObject) {
37             InspectorTest.checkForError(messageObject);
38             InspectorTest.log("PASS: The debugger should not stop on the exception thrown by a console command while paused on a breakpoint.");
39             InspectorTest.sendCommand("Debugger.resume");
40         });
41     }
42
43     function onPausedOnException(messageObject)
44     {
45         InspectorTest.log("FAIL: Should not break on exceptions while paused on a breakpoint.");
46         completeTest();
47     }
48
49     function completeTest()
50     {
51         // InspectorTest.sendCommand("Debugger.resume", {});
52         // Reset the pauseOnException state before ending the test.
53         InspectorTest.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
54         InspectorTest.sendCommand("Debugger.disable");
55         InspectorTest.completeTest();
56     }
57
58     InspectorTest.sendCommand("Debugger.enable", {});
59 }
60 </script>
61 </head>
62 <body onload="runTest()">
63 <p>While being paused on a breakpoint the debugger should ignore the exceptions from console commands.</p>
64 </body>
65 </html>