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

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: fixed test flakiness 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..fa19a8dd3f3ef79d11882f0d35a4dc51b8e11ad7
--- /dev/null
+++ b/LayoutTests/inspector/debugger/async-callstack.html
@@ -0,0 +1,111 @@
+<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.setQuiet(true);
+ InspectorTest.startDebuggerTest(step1);
+
+ function step1()
+ {
+ DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2);
+ }
+
+ function step2()
+ {
+ InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
+ }
+
+ var step = 0;
+ var callStacksOutput = [];
+ function didPaused(callFrames, reason, breakpointIds, asyncStackTrace)
+ {
+ ++step;
+ InspectorTest.beginResultBufferring();
+ InspectorTest.captureStackTrace(callFrames, asyncStackTrace);
+ callStacksOutput.push(InspectorTest.endResultBufferring());
+
+ if (step < totalDebuggerStatements) {
+ InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPaused));
+ } else {
+ InspectorTest.addResult("Captured call stacks in no particular order:");
+ callStacksOutput.sort();
+ InspectorTest.addResults(callStacksOutput);
+ InspectorTest.completeDebuggerTest();
+ }
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests asynchronous call stacks in debugger.
+</p>
+
+</body>
+</html>
« no previous file with comments | « LayoutTests/http/tests/inspector/inspector-test.js ('k') | LayoutTests/inspector/debugger/async-callstack-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698