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