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

Side by Side Diff: LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator.html

Issue 416843002: DevTools: Send async stack trace with Network.Initiator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> 3 <script src="/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script> 4 <script src="/inspector/debugger-test.js"></script>
5 <script src="../../../http/tests/inspector/console-test.js"></script> 5 <script src="/inspector/console-test.js"></script>
6 <script> 6 <script>
7 7
8 function testFunction() 8 function testFunction()
9 { 9 {
10 debugger; 10 debugger;
11 console.clear(); 11 console.clear();
12 setTimeout(timeout1, 0); 12 setTimeout(timeout1, 0);
13 } 13 }
14 14
15 function timeout1() 15 function timeout1()
16 { 16 {
17 console.trace();
18 setTimeout(timeout2, 0); 17 setTimeout(timeout2, 0);
19 } 18 }
20 19
21 function timeout2() 20 function timeout2()
22 { 21 {
23 setTimeout(timeout3, 0); 22 sendXHR();
24 throw Error("foo");
25 } 23 }
26 24
27 function timeout3() 25 function sendXHR()
28 { 26 {
29 console.trace(); 27 var xhr = new XMLHttpRequest();
30 var iframeWidnow = document.getElementById("iframe").contentWindow; 28 xhr.open("POST", "/failure/foo", true /* async */);
31 tryPostMessage(iframeWidnow, "http://www.example.com"); 29 xhr.send();
32 }
33
34 function tryPostMessage(win, origin)
35 {
36 try {
37 win.postMessage("Trying origin=" + origin, origin);
38 } catch(ex) {
39 console.error("FAIL: Error sending message to " + origin + ". " + ex);
40 }
41 } 30 }
42 31
43 var test = function() 32 var test = function()
44 { 33 {
45 var maxAsyncCallStackDepth = 4; 34 var maxAsyncCallStackDepth = 4;
46 var numberOfConsoleMessages = 5; 35 var numberOfConsoleMessages = 2;
47 36
48 InspectorTest.setQuiet(true); 37 InspectorTest.setQuiet(true);
49 InspectorTest.startDebuggerTest(step1); 38 InspectorTest.startDebuggerTest(step1);
50 39
51 function step1() 40 function step1()
52 { 41 {
53 DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExc eptionsState.DontPauseOnExceptions); 42 DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExc eptionsState.DontPauseOnExceptions);
54 DebuggerAgent.setAsyncCallStackDepth(0); 43 DebuggerAgent.setAsyncCallStackDepth(0);
55 InspectorTest.runTestFunctionAndWaitUntilPaused(step2); 44 InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
56 } 45 }
(...skipping 19 matching lines...) Expand all
76 InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textConten tWithLineBreaks); 65 InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textConten tWithLineBreaks);
77 InspectorTest.completeDebuggerTest(); 66 InspectorTest.completeDebuggerTest();
78 } 67 }
79 } 68 }
80 69
81 </script> 70 </script>
82 </head> 71 </head>
83 72
84 <body onload="runTest()"> 73 <body onload="runTest()">
85 <p> 74 <p>
86 Tests asynchronous call stacks printed in console. 75 Tests asynchronous call stacks printed in console for a Network.Initiator.
87 </p> 76 </p>
88 <div><iframe src="resources/post-message-listener.html"
89 id="iframe" width="800" height="100" style="border: 1px solid black;">
90 </iframe></div>
91 </body> 77 </body>
92 </html> 78 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/sources/debugger/async-callstack-network-initiator-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698