Web Inspector: Remove recompileAllJSFunctions timer in ScriptDebugServer
[WebKit-https.git] / LayoutTests / inspector-protocol / debugger / setBreakpointByUrl-sourceURL.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 // sourceURL-test.js:
7 eval("function sourceURLFunction() {\n    var a = 1;\n    var b = 2;\n    var c = a+b;\n}\n//# sourceURL=sourceURL-test.js")
8
9 function test()
10 {
11     InspectorTest.sendCommand("Debugger.enable", {});
12
13     InspectorTest.eventHandler["Debugger.scriptParsed"] = function(messageObject)
14     {
15         if (/sourceURL-test\.js$/.test(messageObject.params.url)) {
16             InspectorTest.log("Found sourceURL-test.js");
17             var params = {url: messageObject.params.url, lineNumber: 3, columnNumber: 0};
18             InspectorTest.sendCommand("Debugger.setBreakpointByUrl", params, function(responseObject) {
19                 InspectorTest.checkForError(responseObject);
20                 InspectorTest.log("Running sourceURLFunction");
21                 InspectorTest.sendCommand("Runtime.evaluate", {expression: "sourceURLFunction()"});
22             });
23         }
24     }
25
26     InspectorTest.eventHandler["Debugger.paused"] = function(messageObject)
27     {
28         InspectorTest.log("Hit Breakpoint!");
29         var callFrameIdentifier = messageObject.params.callFrames[0].callFrameId;
30         InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "a"}, function(messageObject) {
31             InspectorTest.log("Evaluted value of `a` (expecting number 1) was: " + JSON.stringify(messageObject.result.result));
32             InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", {callFrameId: callFrameIdentifier, expression: "c"}, function(messageObject) {
33                 InspectorTest.log("Evaluted value of `c` (expecting undefined) was: " + JSON.stringify(messageObject.result.result));
34                 InspectorTest.completeTest();
35             });
36         });
37     }
38 }
39 </script>
40 </head>
41 <body onload="runTest()">
42 <p>Debugger.setBreakpointByUrl in Script named via sourceURL</p>
43 </body>
44 </html>