Index: LayoutTests/inspector/debugger/async-callstack-promises-simple.html |
diff --git a/LayoutTests/inspector/debugger/async-callstack-promises-simple.html b/LayoutTests/inspector/debugger/async-callstack-promises-simple.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..91a291e8de5835d0f150720de49dbfcfa5be5c12 |
--- /dev/null |
+++ b/LayoutTests/inspector/debugger/async-callstack-promises-simple.html |
@@ -0,0 +1,69 @@ |
+<html> |
+<head> |
+<script src="../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../http/tests/inspector/debugger-test.js"></script> |
+<script> |
+ |
+function timeoutPromise(value, ms) |
+{ |
+ return new Promise(function promiseCallback(resolve, reject) { |
+ function resolvePromise() |
+ { |
+ resolve(value); |
+ } |
+ function rejectPromise() |
+ { |
+ reject(value); |
+ } |
+ if (value instanceof Error) |
+ setTimeout(rejectPromise, ms || 0); |
+ else |
+ setTimeout(resolvePromise, ms || 0); |
+ }); |
+} |
+ |
+function testFunction() |
+{ |
+ setTimeout(testFunctionTimeout, 0); |
+} |
+ |
+function testFunctionTimeout() |
+{ |
+ var functions = [doTestPromiseResolveAndReject]; |
+ for (var i = 0; i < functions.length; ++i) |
+ functions[i](); |
+} |
+ |
+function thenCallback(value) |
+{ |
+ debugger; |
+} |
+ |
+function errorCallback(error) |
+{ |
+ debugger; |
+} |
+ |
+function doTestPromiseResolveAndReject() |
+{ |
+ timeoutPromise(1).then(thenCallback, errorCallback); |
+ timeoutPromise(Error("2")).then(thenCallback, errorCallback); |
+} |
+ |
+var test = function() |
+{ |
+ var totalDebuggerStatements = 2; |
+ var maxAsyncCallStackDepth = 4; |
+ InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallStackDepth); |
+} |
+ |
+</script> |
+</head> |
+ |
+<body onload="runTest()"> |
+<p> |
+Tests asynchronous call stacks for SIMPLE Promises. |
+</p> |
+ |
+</body> |
+</html> |