Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.html

Issue 19064004: Support re-reading scope variables in protocol and on backed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: clean Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..22269187f2f3d847e45bc349459a54a3fe40a0b4
--- /dev/null
+++ b/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.html
@@ -0,0 +1,71 @@
+<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;
yurys 2013/07/16 07:45:05 style: handleDebuggerPaused here an in other place
Peter.Rybin 2013/07/16 12:02:27 Done.
+
+ InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(TestFunction, 0)" });
+
+ function HandleDebuggerPaused(messageObject)
+ {
+ InspectorTest.log("Paused on 'debugger;'");
+ InspectorTest.eventHandler["Debugger.paused"] = undefined;
+
+ var topFrame = messageObject.params.callFrames[0];
+ var topFrameId = topFrame.callFrameId;
+
+ var useMutableLocalVariables = true;
+ 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.
+ InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { "callFrameId": topFrameId, "expression": "a = 55" }, callbackChangeValue);
+ else
+ InspectorTest.sendCommand("Debugger.setVariableValue", { "callFrameId": topFrameId, "scopeNumber": 0, "variableName": "a", "newValue": { value: 55 } }, 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];
yurys 2013/07/16 07:45:05 Wrong alignment here and below.
Peter.Rybin 2013/07/16 12:02:27 Done.
+ 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) {
+ InspectorTest.log("New variable is " + varNamedA.value.value + ", expected is 55, old was: 2");
+ } else {
+ InspectorTest.log("Failed to find variable in scope");
+ }
+ InspectorTest.completeTest();
+ }
+ }
+
+}
+</script>
+</head>
+<body onLoad="runTest();">
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698