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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/access-obsolete-frame.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/access-obsolete-frame.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/access-obsolete-frame.js b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/access-obsolete-frame.js
new file mode 100644
index 0000000000000000000000000000000000000000..b9ec2d0e04f5c508bee46551888905a3e7ccde2a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/access-obsolete-frame.js
@@ -0,0 +1,35 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank('');
chenwilliam 2017/06/30 20:23:27 dp stands for Debugger Protocol? Personally, I don
+
+ function logErrorResponse(response) {
+ if (response.error) {
+ if (response.error.message.indexOf('Can only perform operation while paused.') != -1) {
+ testRunner.log('PASS, error message as expected');
+ return;
+ }
+ }
+ testRunner.log('FAIL, unexpected error message');
+ testRunner.log(JSON.stringify(response));
+ }
+
+ dp.Debugger.enable();
+ dp.Runtime.evaluate({expression: 'setTimeout(() => { debugger; }, 0)' });
+
+ var messageObject = await dp.Debugger.oncePaused();
+ testRunner.log(`Paused on 'debugger;'`);
+ var topFrame = messageObject.params.callFrames[0];
+ var obsoleteTopFrameId = topFrame.callFrameId;
+
+ await dp.Debugger.resume();
+ testRunner.log('resume');
+ testRunner.log('restartFrame');
+
+ logErrorResponse(await dp.Debugger.restartFrame({callFrameId: obsoleteTopFrameId}));
+ testRunner.log('evaluateOnFrame');
+
+ logErrorResponse(await dp.Debugger.evaluateOnCallFrame({callFrameId: obsoleteTopFrameId, expression: '0'}));
+ testRunner.log('setVariableValue');
+
+ logErrorResponse(await dp.Debugger.setVariableValue({callFrameId: obsoleteTopFrameId, scopeNumber: 0, variableName: 'a', newValue: { value: 0 }}));
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698