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

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

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 (async function(testRunner) {
2 let {page, session, dp} = await testRunner.startBlank('');
3
4 var newVariableValue = 55;
5
6 dp.Debugger.enable();
7 dp.Runtime.evaluate({expression: `
8 function TestFunction() {
9 var a = 2;
10 debugger;
11 debugger;
12 }
13 setTimeout(TestFunction, 0);
14 `});
15
16 var messageObject = await dp.Debugger.oncePaused();
17 testRunner.log(`Paused on 'debugger;'`);
18 var topFrame = messageObject.params.callFrames[0];
19 var topFrameId = topFrame.callFrameId;
20
21 dp.Debugger.evaluateOnCallFrame({callFrameId: topFrameId, expression: 'a = ' + newVariableValue });
22 testRunner.log('Variable value changed');
23 dp.Debugger.resume();
24
25 var response = await dp.Debugger.oncePaused();
26 testRunner.log('Stacktrace re-read again');
27 var localScope = response.params.callFrames[0].scopeChain[0];
28
29 response = await dp.Runtime.getProperties({objectId: localScope.object.objectI d });
30 testRunner.log('Scope variables downloaded anew');
31 var propertyList = response.result.result;
32 var varNamedA = propertyList.find(x => x.name === 'a');
33 if (varNamedA) {
34 var actualValue = varNamedA.value.value;
35 testRunner.log('New variable is ' + actualValue + ', expected is ' + newVari ableValue + ', old was: 2');
36 testRunner.log(actualValue == newVariableValue ? 'SUCCESS' : 'FAIL');
37 } else {
38 testRunner.log('Failed to find variable in scope');
39 }
40 testRunner.completeTest();
41 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698