| Index: LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.html
|
| diff --git a/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.html b/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e17e877b1de34e22dde26807c2f4ae5ceb6baae1
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.html
|
| @@ -0,0 +1,70 @@
|
| +<html>
|
| +<head>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
|
| +<script>
|
| +
|
| +function TestFunction()
|
| +{
|
| + var a = 2;
|
| + debugger;
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + InspectorTest.sendCommand("Debugger.enable", {});
|
| +
|
| + InspectorTest.eventHandler["Debugger.paused"] = handleDebuggerPaused;
|
| +
|
| + InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(TestFunction, 0)" });
|
| +
|
| + function handleDebuggerPaused(messageObject)
|
| + {
|
| + var newVariableValue = 55;
|
| + InspectorTest.log("Paused on 'debugger;'");
|
| + InspectorTest.eventHandler["Debugger.paused"] = undefined;
|
| +
|
| + var topFrame = messageObject.params.callFrames[0];
|
| + var topFrameId = topFrame.callFrameId;
|
| +
|
| + InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { "callFrameId": topFrameId, "expression": "a = " + newVariableValue }, callbackChangeValue);
|
| +
|
| +
|
| + function callbackChangeValue(response)
|
| + {
|
| + InspectorTest.log("Variable value changed");
|
| + InspectorTest.sendCommand("Debugger.updateCallFrameScopes", { "callFrameId": topFrameId }, callbackUpdateScopes);
|
| + }
|
| + function callbackUpdateScopes(response)
|
| + {
|
| + InspectorTest.log("Scopes re-read again");
|
| + var localScope = response.result.scopeChain[0];
|
| + InspectorTest.sendCommand("Runtime.getProperties", { "objectId": localScope.object.objectId }, callbackGetProperties);
|
| + }
|
| + function callbackGetProperties(response)
|
| + {
|
| + InspectorTest.log("Scope variables downloaded anew");
|
| + var varNamedA;
|
| + var propertyList = response.result.result;
|
| + for (var i = 0; i < propertyList.length; i++) {
|
| + if (propertyList[i].name === "a") {
|
| + varNamedA = propertyList[i];
|
| + break;
|
| + }
|
| + }
|
| + if (varNamedA) {
|
| + var actualValue = varNamedA.value.value;
|
| + InspectorTest.log("New variable is " + actualValue + ", expected is " + newVariableValue + ", old was: 2");
|
| + InspectorTest.log(actualValue == newVariableValue ? "SUCCESS" : "FAIL");
|
| + } else {
|
| + InspectorTest.log("Failed to find variable in scope");
|
| + }
|
| + InspectorTest.completeTest();
|
| + }
|
| + }
|
| +
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onLoad="runTest();">
|
| +</body>
|
| +</html>
|
|
|