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

Side by Side Diff: LayoutTests/inspector/sources/debugger/async-callstack-and-framework-black-box.html

Issue 304563002: DevTools: Make frameworks work with "custom" breakpoints (DOM, XHR, Events). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="resources/framework.js"></script>
6 <script>
7
8 window.callbackFromFramework = function(next)
9 {
10 return next();
11 }
12
13 function testFunction()
14 {
15 setTimeout(timeout1, 0);
16 }
17
18 function timeout1()
19 {
20 Framework.safeRun(Framework.empty, callback1);
21 }
22
23 function callback1()
24 {
25 Framework.doSomeAsyncChainCalls(callback2);
26 }
27
28 function callback2()
29 {
30 debugger;
31 }
32
33 function test()
34 {
35 var frameworkRegexString = "/framework\\.js$";
36 var maxAsyncCallStackDepth = 4;
37
38 WebInspector.experimentsSettings.frameworksDebuggingSupport.enableForTest();
39 WebInspector.settings.skipStackFramesSwitch.set(true);
40 WebInspector.settings.skipStackFramesPattern.set(frameworkRegexString);
41
42 InspectorTest.setQuiet(true);
43 InspectorTest.startDebuggerTest(step1);
44
45 function step1()
46 {
47 DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2);
48 }
49
50 function step2()
51 {
52 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
53 }
54
55 function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
56 {
57 InspectorTest.captureStackTrace(callFrames, asyncStackTrace);
58
59 InspectorTest.addResult("\nVisible call stack:");
60
61 var callStackPane = WebInspector.panels.sources.sidebarPanes.callstack;
62 var placards = callStackPane.placards;
63 var lastPlacard = null;
64 for (var i = 0, index = 0; i < placards.length; ++i) {
65 var placard = placards[i];
66 if (placard.isHidden())
67 continue;
68 if (lastPlacard && placard._asyncPlacard !== lastPlacard._asyncPlaca rd)
69 InspectorTest.addResult(" [" + placard._asyncPlacard.title + "]");
70 InspectorTest.addResult(" " + (++index) + ") " + placard.title + " (" + placard.subtitle + ")");
71 lastPlacard = placard;
72 }
73
74 InspectorTest.completeDebuggerTest();
75 }
76 }
77
78 </script>
79 </head>
80
81 <body onload="runTest()">
82 <input type='button' onclick='testFunction()' value='Test'/>
83 <p>
84 Tests the async call stacks and framework black-boxing features working together .
85 </p>
86 </body>
87 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698