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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.html

Issue 2968523003: [DevTools] Migrate inspector-protocol/debugger tests to new harness (Closed)
Patch Set: all tests Created 3 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
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource s/inspector-protocol-test.js"></script>
4 <script>
5
6 function TestFunction()
7 {
8 var a = 2;
9 debugger;
10 debugger;
11 }
12
13 function test()
14 {
15 var newVariableValue = 55;
16
17 InspectorTest.sendCommand("Debugger.enable", {});
18
19 InspectorTest.eventHandler["Debugger.paused"] = handleDebuggerPaused;
20
21 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(Te stFunction, 0)" });
22
23 function handleDebuggerPaused(messageObject)
24 {
25 InspectorTest.log("Paused on 'debugger;'");
26 InspectorTest.eventHandler["Debugger.paused"] = undefined;
27
28 var topFrame = messageObject.params.callFrames[0];
29 var topFrameId = topFrame.callFrameId;
30 InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { "callFrameId ": topFrameId, "expression": "a = " + newVariableValue }, callbackChangeValue);
31 }
32
33 function callbackChangeValue(response)
34 {
35 InspectorTest.log("Variable value changed");
36 InspectorTest.eventHandler["Debugger.paused"] = callbackGetBacktrace;
37 InspectorTest.sendCommand("Debugger.resume", { });
38 }
39
40 function callbackGetBacktrace(response)
41 {
42 InspectorTest.log("Stacktrace re-read again");
43 var localScope = response.params.callFrames[0].scopeChain[0];
44 InspectorTest.sendCommand("Runtime.getProperties", { "objectId": localSc ope.object.objectId }, callbackGetProperties);
45 }
46
47 function callbackGetProperties(response)
48 {
49 InspectorTest.log("Scope variables downloaded anew");
50 var varNamedA;
51 var propertyList = response.result.result;
52 for (var i = 0; i < propertyList.length; i++) {
53 if (propertyList[i].name === "a") {
54 varNamedA = propertyList[i];
55 break;
56 }
57 }
58 if (varNamedA) {
59 var actualValue = varNamedA.value.value;
60 InspectorTest.log("New variable is " + actualValue + ", expected is " + newVariableValue + ", old was: 2");
61 InspectorTest.log(actualValue == newVariableValue ? "SUCCESS" : "FAI L");
62 } else {
63 InspectorTest.log("Failed to find variable in scope");
64 }
65 InspectorTest.completeTest();
66 }
67 }
68 </script>
69 </head>
70 <body onLoad="runTest();">
71 </body>
72 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698