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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/step-over-caught-exception.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/step-over-caught-exception.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/step-over-caught-exception.js b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/step-over-caught-exception.js
new file mode 100644
index 0000000000000000000000000000000000000000..a30526dc1c335d29e84834ae2636265bb8908431
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/step-over-caught-exception.js
@@ -0,0 +1,54 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank('');
+
+ dp.Debugger.enable();
+ dp.Runtime.enable();
+ dp.Runtime.evaluate({expression: `
+
+
+
+
+
+ function testFunction() {
+ function foo() {
+ try {
+ throw new Error();
+ } catch (e) {
+ }
+ }
+ debugger;
+ foo();
+ console.log('completed');
+ }
+ setTimeout(testFunction, 0);
+ `});
+
+ function printCallFrames(messageObject) {
+ var callFrames = messageObject.params.callFrames;
+ for (var callFrame of callFrames)
+ testRunner.log(callFrame.functionName + ':' + callFrame.location.lineNumber);
+ }
+
+ printCallFrames(await dp.Debugger.oncePaused());
+ dp.Debugger.stepOver();
+ await dp.Debugger.oncePaused();
+ dp.Debugger.stepOver();
+ printCallFrames(await dp.Debugger.oncePaused());
+ dp.Debugger.resume();
+ await dp.Runtime.onceConsoleAPICalled(messageObject => messageObject.params.args[0].value === 'completed');
+
+ dp.Runtime.evaluate({expression: 'setTimeout(testFunction, 0);'} );
+ printCallFrames(await dp.Debugger.oncePaused());
+ dp.Debugger.stepOver();
+ await dp.Debugger.oncePaused();
+ dp.Debugger.stepInto();
+ await dp.Debugger.oncePaused();
+ dp.Debugger.stepOver();
+ await dp.Debugger.oncePaused();
+ dp.Debugger.stepOver();
+ printCallFrames(await dp.Debugger.oncePaused());
+ dp.Debugger.resume();
+ await dp.Runtime.onceConsoleAPICalled(messageObject => messageObject.params.args[0].value === 'completed');
+
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698