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

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

Issue 74063002: DevTools: Support asynchronous call stacks on backend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed trash Created 7 years 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.html
diff --git a/LayoutTests/inspector/debugger/async-callstack.html b/LayoutTests/inspector/debugger/async-callstack.html
new file mode 100644
index 0000000000000000000000000000000000000000..da43ead4025e3e63fd83b7f00d9600b62f9ecfe7
--- /dev/null
+++ b/LayoutTests/inspector/debugger/async-callstack.html
@@ -0,0 +1,102 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/debugger-test.js"></script>
+<script>
+
+function testFunction()
+{
+ function innerTestFunction()
+ {
+ timeout1();
+ }
+ setTimeout(innerTestFunction, 0);
+}
+
+function timeout1()
+{
+ debugger;
+ requestAnimationFrame(animFrame1);
+ var id = setInterval(innerInterval1, 0);
+ function innerInterval1()
+ {
+ clearInterval(id);
+ interval1();
+ }
+}
+
+function animFrame1()
+{
+ debugger;
+ setTimeout(timeout2, 0);
+ requestAnimationFrame(animFrame2);
+}
+
+function interval1()
+{
+ debugger;
+}
+
+function timeout2()
+{
+ debugger;
+}
+
+function animFrame2()
+{
+ debugger;
+ function longTail0()
+ {
+ timeout3();
+ }
+ var funcs = [];
+ for (var i = 0; i < 20; ++i)
+ funcs.push("function longTail" + (i + 1) + "() { setTimeout(longTail" + i + ", 0); };");
+ funcs.push("setTimeout(longTail" + i + ", 0);");
+ eval(funcs.join("\n"));
+}
+
+function timeout3()
+{
+ debugger;
+}
+
+var test = function()
+{
+ var totalDebuggerStatements = 6;
+ var maxAsyncCallStackDepth = 4;
+
+ InspectorTest.startDebuggerTest(step1);
+
+ function step1()
+ {
+ DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2);
+ }
+
+ function step2()
+ {
+ InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
+ }
+
+ var step = 0;
+ function didPaused(callFrames, reason, breakpointIds, asyncStackTrace)
+ {
+ ++step;
+ InspectorTest.captureStackTrace(callFrames, asyncStackTrace);
+ if (step < totalDebuggerStatements)
+ InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPaused));
+ else
+ InspectorTest.completeDebuggerTest();
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests asynchronous call stacks in debugger.
+</p>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698