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

Side by Side 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: follow code review 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/debugger/updateCallFrameScopes-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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;
17
18 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(Te stFunction, 0)" });
19
20 function handleDebuggerPaused(messageObject)
21 {
22 var newVariableValue = 55;
23 InspectorTest.log("Paused on 'debugger;'");
24 InspectorTest.eventHandler["Debugger.paused"] = undefined;
25
26 var topFrame = messageObject.params.callFrames[0];
27 var topFrameId = topFrame.callFrameId;
28
29 InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { "callFrameId ": topFrameId, "expression": "a = " + newVariableValue }, callbackChangeValue);
30
31
32 function callbackChangeValue(response)
33 {
34 InspectorTest.log("Variable value changed");
35 InspectorTest.sendCommand("Debugger.updateCallFrameScopes", { "callF rameId": topFrameId }, callbackUpdateScopes);
36 }
37 function callbackUpdateScopes(response)
38 {
39 InspectorTest.log("Scopes re-read again");
40 var localScope = response.result.scopeChain[0];
41 InspectorTest.sendCommand("Runtime.getProperties", { "objectId": loc alScope.object.objectId }, callbackGetProperties);
42 }
43 function callbackGetProperties(response)
44 {
45 InspectorTest.log("Scope variables downloaded anew");
46 var varNamedA;
47 var propertyList = response.result.result;
48 for (var i = 0; i < propertyList.length; i++) {
49 if (propertyList[i].name === "a") {
50 varNamedA = propertyList[i];
51 break;
52 }
53 }
54 if (varNamedA) {
55 var actualValue = varNamedA.value.value;
56 InspectorTest.log("New variable is " + actualValue + ", expected is " + newVariableValue + ", old was: 2");
57 InspectorTest.log(actualValue == newVariableValue ? "SUCCESS" : "FAIL");
58 } else {
59 InspectorTest.log("Failed to find variable in scope");
60 }
61 InspectorTest.completeTest();
62 }
63 }
64
65 }
66 </script>
67 </head>
68 <body onLoad="runTest();">
69 </body>
70 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/debugger/updateCallFrameScopes-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698