| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 var xhrCount = 0; | 7 var xhrCount = 0; |
| 8 | 8 |
| 9 function testFunction() | 9 function testFunction() |
| 10 { | 10 { |
| 11 setTimeout(timeout, 0); | 11 setTimeout(timeout, 0); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function timeout() | 14 function timeout() |
| 15 { | 15 { |
| 16 sendSyncXHR(); | 16 sendSyncXHR(); |
| 17 sendAsyncXHR(); | 17 sendAsyncXHR(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 function sendAsyncXHR() { sendXHR(true); } | 20 function sendAsyncXHR() { sendXHR(true); } |
| 21 function sendSyncXHR() { sendXHR(false); } | 21 function sendSyncXHR() { sendXHR(false); } |
| 22 | 22 |
| 23 function sendXHR(async) | 23 function sendXHR(async) |
| 24 { | 24 { |
| 25 var xhr = new XMLHttpRequest(); | 25 var xhr = new XMLHttpRequest(); |
| 26 xhr.onreadystatechange = function() | 26 xhr.onreadystatechange = function() |
| 27 { | 27 { |
| 28 if (xhr.readyState == 4) { | 28 if (xhr.readyState == 4) { |
| 29 xhr.onreadystatechange = null; | 29 xhr.onreadystatechange = null; |
| 30 debugger; | 30 debugger; |
| 31 } | 31 } |
| 32 }; | 32 }; |
| 33 function downloadEnd1() | 33 function downloadEnd1() |
| 34 { | 34 { |
| 35 xhr.removeEventListener("loadend", downloadEnd1, false); | 35 xhr.removeEventListener("loadend", downloadEnd1, false); |
| 36 debugger; | 36 debugger; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 62 xhr.addEventListener("progress", downloadProgress, false); | 62 xhr.addEventListener("progress", downloadProgress, false); |
| 63 xhr.upload.addEventListener("progress", uploadProgress, false); | 63 xhr.upload.addEventListener("progress", uploadProgress, false); |
| 64 } | 64 } |
| 65 xhr.open("POST", "/foo?count=" + (++xhrCount) + "&now=" + Date.now(), async)
; | 65 xhr.open("POST", "/foo?count=" + (++xhrCount) + "&now=" + Date.now(), async)
; |
| 66 xhr.send(String(sendXHR)); | 66 xhr.send(String(sendXHR)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 var test = function() | 69 var test = function() |
| 70 { | 70 { |
| 71 var totalDebuggerStatements = 9; | 71 var totalDebuggerStatements = 9; |
| 72 var maxAsyncCallStackDepth = 4; | 72 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements); |
| 73 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallSt
ackDepth); | |
| 74 } | 73 } |
| 75 | 74 |
| 76 </script> | 75 </script> |
| 77 </head> | 76 </head> |
| 78 | 77 |
| 79 <body onload="runTest()"> | 78 <body onload="runTest()"> |
| 80 <p> | 79 <p> |
| 81 Tests asynchronous call stacks for XHRs. | 80 Tests asynchronous call stacks for XHRs. |
| 82 </p> | 81 </p> |
| 83 | 82 |
| 84 </body> | 83 </body> |
| 85 </html> | 84 </html> |
| OLD | NEW |