OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/inspector-protocol-test.js"></script> | |
4 <script> | |
5 | |
6 function testFunction() | |
7 { | |
8 debugger; | |
9 } | |
10 | |
11 function test() | |
12 { | |
13 InspectorTest.sendCommand("Debugger.enable", {}); | |
14 | |
15 InspectorTest.eventHandler["Debugger.paused"] = handleDebuggerPausedOne; | |
16 | |
17 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(te
stFunction, 0)" }); | |
18 | |
19 var obsoleteTopFrameId; | |
20 | |
21 function handleDebuggerPausedOne(messageObject) | |
22 { | |
23 InspectorTest.log("Paused on 'debugger;'"); | |
24 | |
25 var topFrame = messageObject.params.callFrames[0]; | |
26 obsoleteTopFrameId = topFrame.callFrameId; | |
27 | |
28 InspectorTest.eventHandler["Debugger.paused"] = undefined; | |
29 | |
30 InspectorTest.sendCommand("Debugger.resume", { }, callbackResume); | |
31 } | |
32 | |
33 function callbackResume(response) | |
34 { | |
35 InspectorTest.log("resume"); | |
36 InspectorTest.log("restartFrame"); | |
37 InspectorTest.sendCommand("Debugger.restartFrame", { callFrameId: obsole
teTopFrameId }, callbackRestartFrame); | |
38 } | |
39 | |
40 function callbackRestartFrame(response) | |
41 { | |
42 logErrorResponse(response); | |
43 InspectorTest.log("evaluateOnFrame"); | |
44 InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId:
obsoleteTopFrameId, expression: "0"} , callbackEvaluate); | |
45 } | |
46 | |
47 function callbackEvaluate(response) | |
48 { | |
49 logErrorResponse(response); | |
50 InspectorTest.log("setVariableValue"); | |
51 InspectorTest.sendCommand("Debugger.setVariableValue", { callFrameId: ob
soleteTopFrameId, scopeNumber: 0, variableName: "a", newValue: { value: 0 } }, c
allbackSetVariableValue); | |
52 } | |
53 | |
54 function callbackSetVariableValue(response) | |
55 { | |
56 logErrorResponse(response); | |
57 InspectorTest.completeTest(); | |
58 } | |
59 | |
60 function logErrorResponse(response) | |
61 { | |
62 if (response.error) { | |
63 if (response.error.message.indexOf("Can only perform operation while
paused.") != -1) { | |
64 InspectorTest.log("PASS, error message as expected"); | |
65 return; | |
66 } | |
67 } | |
68 InspectorTest.log("FAIL, unexpected error message"); | |
69 InspectorTest.log(JSON.stringify(response)); | |
70 } | |
71 } | |
72 </script> | |
73 </head> | |
74 <body onLoad="runTest();"> | |
75 </body> | |
76 </html> | |
OLD | NEW |