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

Side by Side Diff: LayoutTests/inspector/sources/debugger/async-callstack-xhrs.html

Issue 1153923005: DevTools: shard inspector/debugger tests for faster execution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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>
6
7 var xhrCount = 0;
8
9 function testFunction()
10 {
11 setTimeout(timeout, 0);
12 }
13
14 function timeout()
15 {
16 sendSyncXHR();
17 sendAsyncXHR();
18 }
19
20 function sendAsyncXHR() { sendXHR(true); }
21 function sendSyncXHR() { sendXHR(false); }
22
23 function sendXHR(async)
24 {
25 var xhr = new XMLHttpRequest();
26 xhr.onreadystatechange = function()
27 {
28 if (xhr.readyState == 4) {
29 xhr.onreadystatechange = null;
30 debugger;
31 }
32 };
33 function downloadEnd1()
34 {
35 xhr.removeEventListener("loadend", downloadEnd1, false);
36 debugger;
37 }
38 function downloadEnd2()
39 {
40 xhr.removeEventListener("loadend", downloadEnd2, true);
41 debugger;
42 }
43 function uploadEnd()
44 {
45 xhr.upload.removeEventListener("loadend", uploadEnd, false);
46 debugger;
47 }
48 function downloadProgress()
49 {
50 debugger;
51 xhr.removeEventListener("progress", downloadProgress, false);
52 }
53 function uploadProgress()
54 {
55 debugger;
56 xhr.upload.removeEventListener("progress", uploadProgress, false);
57 }
58 xhr.addEventListener("loadend", downloadEnd1, false);
59 xhr.addEventListener("loadend", downloadEnd2, true);
60 if (async) {
61 xhr.upload.addEventListener("loadend", uploadEnd, false);
62 xhr.addEventListener("progress", downloadProgress, false);
63 xhr.upload.addEventListener("progress", uploadProgress, false);
64 }
65 xhr.open("POST", "/foo?count=" + (++xhrCount) + "&now=" + Date.now(), async) ;
66 xhr.send(String(sendXHR));
67 }
68
69 var test = function()
70 {
71 var totalDebuggerStatements = 9;
72 var maxAsyncCallStackDepth = 4;
73 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallSt ackDepth);
74 }
75
76 </script>
77 </head>
78
79 <body onload="runTest()">
80 <p>
81 Tests asynchronous call stacks for XHRs.
82 </p>
83
84 </body>
85 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698