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

Unified Diff: test/inspector/debugger/step-out-async-await.js

Issue 2779143002: [inspector] added test for StepOut at return postion from async function (Closed)
Patch Set: better expectation Created 3 years, 9 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
« no previous file with comments | « no previous file | test/inspector/debugger/step-out-async-await-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/debugger/step-out-async-await.js
diff --git a/test/inspector/debugger/step-out-async-await.js b/test/inspector/debugger/step-out-async-await.js
new file mode 100644
index 0000000000000000000000000000000000000000..3b249dc7f368296dfacfd1e7f58aabd5bf1fecf5
--- /dev/null
+++ b/test/inspector/debugger/step-out-async-await.js
@@ -0,0 +1,72 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// TODO(kozyatinskiy): on StepOut and probably StepNext at return position
+// of async generator we should break at next instruction of resumed generator
+// instead of next scheduled microtask.
+
+InspectorTest.log('StepOut from return position of async function.');
+
+InspectorTest.addScript(`
+ async function testFunction() {
+ async function foo() {
+ var p = Promise.resolve();
+ await p;
+ p.then(() => 1);
+ debugger;
+ return p;
+ }
+ await foo();
+ }
+`);
+
+InspectorTest.setupScriptMap();
+Protocol.Debugger.enable();
+InspectorTest.runAsyncTestSuite([
+ async function testStepInto() {
+ Protocol.Runtime.evaluate({expression: 'testFunction()'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.resume();
+ },
+
+ async function testStepOver() {
+ Protocol.Runtime.evaluate({expression: 'testFunction()'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.resume();
+ },
+
+ async function testStepOut() {
+ Protocol.Runtime.evaluate({expression: 'testFunction()'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.resume();
+ },
+]);
+
+function logPauseLocation(message) {
+ return InspectorTest.logSourceLocation(message.params.callFrames[0].location);
+}
« no previous file with comments | « no previous file | test/inspector/debugger/step-out-async-await-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698