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

Unified Diff: test/inspector/debugger/async-stacks-limit.js

Issue 2648873002: [inspector] added creation frame for async call chains for promises (Closed)
Patch Set: add test for setTimeout Created 3 years, 11 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: test/inspector/debugger/async-stacks-limit.js
diff --git a/test/inspector/debugger/async-stacks-limit.js b/test/inspector/debugger/async-stacks-limit.js
index b028b74aae2f985d54f844f62c7f9e9c68f95d97..d3c47dbfd4a79b92e7f697c1877c538ca09b56d9 100644
--- a/test/inspector/debugger/async-stacks-limit.js
+++ b/test/inspector/debugger/async-stacks-limit.js
@@ -42,12 +42,6 @@ function twoSetTimeout() {
return new Promise(resolve => resolveTest = resolve);
}
-function threeSetTimeout() {
- setTimeout(foo1, 0);
- setTimeout(foo2, 0);
- return new Promise(resolve => resolveTest = resolve);
-}
-
function twentySetTimeout() {
var resolve1;
var p1 = new Promise(resolve => resolve1 = resolve);
@@ -85,14 +79,16 @@ InspectorTest.runTestSuite([
.then(next);
},
- function testOneLimit(next) {
- Protocol.Runtime.evaluate({
- expression: 'setMaxAsyncTaskStacks(1)//# sourceURL=expr.js'})
- .then(() => Protocol.Runtime.evaluate({
- expression: 'promise()//# sourceURL=expr.js', awaitPromise: true
- }))
- .then(() => cancelAllAsyncTasks())
- .then(next);
+ function testTwoLimit(next) {
+ // we need one stack for parent task and one for next task.
+ Protocol.Runtime
+ .evaluate({expression: 'setMaxAsyncTaskStacks(2)//# sourceURL=expr.js'})
+ .then(() => Protocol.Runtime.evaluate({
+ expression: 'promise()//# sourceURL=expr.js',
+ awaitPromise: true
+ }))
+ .then(() => cancelAllAsyncTasks())
+ .then(next);
},
function testOneLimitTwoPromises(next) {
@@ -108,19 +104,31 @@ InspectorTest.runTestSuite([
.then(next);
},
- function testTwoLimitTwoPromises(next) {
- Protocol.Runtime.evaluate({
- expression: 'setMaxAsyncTaskStacks(2)//# sourceURL=expr.js'})
- .then(() => Protocol.Runtime.evaluate({
- expression: 'twoPromises()//# sourceURL=expr.js', awaitPromise: true
- }))
- .then(() => cancelAllAsyncTasks())
- .then(next);
+ function testFourLimitTwoPromises(next) {
+ Protocol.Runtime
+ .evaluate({expression: 'setMaxAsyncTaskStacks(4)//# sourceURL=expr.js'})
+ .then(() => Protocol.Runtime.evaluate({
+ expression: 'twoPromises()//# sourceURL=expr.js',
+ awaitPromise: true
+ }))
+ .then(() => cancelAllAsyncTasks())
+ .then(next);
},
- function testOneLimitTwoSetTimeouts(next) {
+ function testSixLimitTwoPromises(next) {
+ Protocol.Runtime
+ .evaluate({expression: 'setMaxAsyncTaskStacks(6)//# sourceURL=expr.js'})
+ .then(() => Protocol.Runtime.evaluate({
+ expression: 'twoPromises()//# sourceURL=expr.js',
+ awaitPromise: true
+ }))
+ .then(() => cancelAllAsyncTasks())
+ .then(next);
+ },
+
+ function testTwoLimitTwoSetTimeouts(next) {
Protocol.Runtime.evaluate({
- expression: 'setMaxAsyncTaskStacks(1)//# sourceURL=expr.js'})
+ expression: 'setMaxAsyncTaskStacks(2)//# sourceURL=expr.js'})
.then(() => Protocol.Runtime.evaluate({
expression: 'twoSetTimeout()//# sourceURL=expr.js', awaitPromise: true
}))
@@ -128,9 +136,9 @@ InspectorTest.runTestSuite([
.then(next);
},
- function testTwoLimitTwoSetTimeouts(next) {
+ function testThreeLimitTwoSetTimeouts(next) {
Protocol.Runtime.evaluate({
- expression: 'setMaxAsyncTaskStacks(2)//# sourceURL=expr.js'})
+ expression: 'setMaxAsyncTaskStacks(3)//# sourceURL=expr.js'})
.then(() => Protocol.Runtime.evaluate({
expression: 'twoSetTimeout()//# sourceURL=expr.js', awaitPromise: true
}))
« no previous file with comments | « test/inspector/debugger/async-stack-for-promise-expected.txt ('k') | test/inspector/debugger/async-stacks-limit-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698