Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource s/protocol-test.js"></script> | |
| 4 <script> | |
| 5 | |
| 6 function TestFunction() | |
| 7 { | |
| 8 var a = 2; | |
| 9 debugger; | |
| 10 } | |
| 11 | |
| 12 function test() | |
| 13 { | |
| 14 InspectorTest.sendCommand("Debugger.enable", {}); | |
| 15 | |
| 16 InspectorTest.eventHandler["Debugger.paused"] = HandleDebuggerPaused; | |
|
yurys
2013/07/16 07:45:05
style: handleDebuggerPaused here an in other place
Peter.Rybin
2013/07/16 12:02:27
Done.
| |
| 17 | |
| 18 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(Te stFunction, 0)" }); | |
| 19 | |
| 20 function HandleDebuggerPaused(messageObject) | |
| 21 { | |
| 22 InspectorTest.log("Paused on 'debugger;'"); | |
| 23 InspectorTest.eventHandler["Debugger.paused"] = undefined; | |
| 24 | |
| 25 var topFrame = messageObject.params.callFrames[0]; | |
| 26 var topFrameId = topFrame.callFrameId; | |
| 27 | |
| 28 var useMutableLocalVariables = true; | |
| 29 if (useMutableLocalVariables) | |
|
yurys
2013/07/16 07:45:05
Remove this check, it is always true.
Peter.Rybin
2013/07/16 12:02:27
Done.
| |
| 30 InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { "callFra meId": topFrameId, "expression": "a = 55" }, callbackChangeValue); | |
| 31 else | |
| 32 InspectorTest.sendCommand("Debugger.setVariableValue", { "callFrameI d": topFrameId, "scopeNumber": 0, "variableName": "a", "newValue": { value: 55 } }, callbackChangeValue); | |
| 33 | |
| 34 | |
| 35 function callbackChangeValue(response) | |
| 36 { | |
| 37 InspectorTest.log("Variable value changed"); | |
| 38 InspectorTest.sendCommand("Debugger.updateCallFrameScopes", { "callF rameId": topFrameId }, callbackUpdateScopes); | |
| 39 } | |
| 40 function callbackUpdateScopes(response) | |
| 41 { | |
| 42 InspectorTest.log("Scopes re-read again"); | |
| 43 var localScope = response.result.scopeChain[0]; | |
|
yurys
2013/07/16 07:45:05
Wrong alignment here and below.
Peter.Rybin
2013/07/16 12:02:27
Done.
| |
| 44 InspectorTest.sendCommand("Runtime.getProperties", { "objectId": localScope.object.objectId }, callbackGetProperties); | |
| 45 } | |
| 46 function callbackGetProperties(response) | |
| 47 { | |
| 48 InspectorTest.log("Scope variables downloaded anew"); | |
| 49 var varNamedA; | |
| 50 var propertyList = response.result.result; | |
| 51 for (var i = 0; i < propertyList.length; i++) { | |
| 52 if (propertyList[i].name === "a") { | |
| 53 varNamedA = propertyList[i]; | |
| 54 break; | |
| 55 } | |
| 56 } | |
| 57 if (varNamedA) { | |
| 58 InspectorTest.log("New variable is " + varNamedA.value.value + ", expected is 55, old was: 2"); | |
| 59 } else { | |
| 60 InspectorTest.log("Failed to find variable in scope"); | |
| 61 } | |
| 62 InspectorTest.completeTest(); | |
| 63 } | |
| 64 } | |
| 65 | |
| 66 } | |
| 67 </script> | |
| 68 </head> | |
| 69 <body onLoad="runTest();"> | |
| 70 </body> | |
| 71 </html> | |
| OLD | NEW |