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

Unified 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, 6 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: third_party/WebKit/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.js b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.js
new file mode 100644
index 0000000000000000000000000000000000000000..09e007db5945b7ee844d3a50eaf2487e49565dbb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/updateCallFrameScopes.js
@@ -0,0 +1,41 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank('');
+
+ var newVariableValue = 55;
+
+ dp.Debugger.enable();
+ dp.Runtime.evaluate({expression: `
+ function TestFunction() {
+ var a = 2;
+ debugger;
+ debugger;
+ }
+ setTimeout(TestFunction, 0);
+ `});
+
+ var messageObject = await dp.Debugger.oncePaused();
+ testRunner.log(`Paused on 'debugger;'`);
+ var topFrame = messageObject.params.callFrames[0];
+ var topFrameId = topFrame.callFrameId;
+
+ dp.Debugger.evaluateOnCallFrame({callFrameId: topFrameId, expression: 'a = ' + newVariableValue });
+ testRunner.log('Variable value changed');
+ dp.Debugger.resume();
+
+ var response = await dp.Debugger.oncePaused();
+ testRunner.log('Stacktrace re-read again');
+ var localScope = response.params.callFrames[0].scopeChain[0];
+
+ response = await dp.Runtime.getProperties({objectId: localScope.object.objectId });
+ testRunner.log('Scope variables downloaded anew');
+ var propertyList = response.result.result;
+ var varNamedA = propertyList.find(x => x.name === 'a');
+ if (varNamedA) {
+ var actualValue = varNamedA.value.value;
+ testRunner.log('New variable is ' + actualValue + ', expected is ' + newVariableValue + ', old was: 2');
+ testRunner.log(actualValue == newVariableValue ? 'SUCCESS' : 'FAIL');
+ } else {
+ testRunner.log('Failed to find variable in scope');
+ }
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698