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

Unified Diff: LayoutTests/inspector/debugger/async-callstack-promises-simple.html

Issue 177773002: Support Promises instrumentation on backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix in printing NULL parent promises Created 6 years, 10 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: 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>

Powered by Google App Engine
This is Rietveld 408576698