| 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 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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 downloadEnd() | 33 function downloadEnd1() |
| 34 { | 34 { |
| 35 xhr.removeEventListener("loadend", downloadEnd, false); | 35 xhr.removeEventListener("loadend", downloadEnd1, false); |
| 36 debugger; |
| 37 } |
| 38 function downloadEnd2() |
| 39 { |
| 40 xhr.removeEventListener("loadend", downloadEnd2, true); |
| 36 debugger; | 41 debugger; |
| 37 } | 42 } |
| 38 function uploadEnd() | 43 function uploadEnd() |
| 39 { | 44 { |
| 40 xhr.upload.removeEventListener("loadend", uploadEnd, false); | 45 xhr.upload.removeEventListener("loadend", uploadEnd, false); |
| 41 debugger; | 46 debugger; |
| 42 } | 47 } |
| 43 function downloadProgress() | 48 function downloadProgress() |
| 44 { | 49 { |
| 45 debugger; | 50 debugger; |
| 46 xhr.removeEventListener("progress", downloadProgress, false); | 51 xhr.removeEventListener("progress", downloadProgress, false); |
| 47 } | 52 } |
| 48 function uploadProgress() | 53 function uploadProgress() |
| 49 { | 54 { |
| 50 debugger; | 55 debugger; |
| 51 xhr.upload.removeEventListener("progress", uploadProgress, false); | 56 xhr.upload.removeEventListener("progress", uploadProgress, false); |
| 52 } | 57 } |
| 53 xhr.addEventListener("loadend", downloadEnd, false); | 58 xhr.addEventListener("loadend", downloadEnd1, false); |
| 59 xhr.addEventListener("loadend", downloadEnd2, true); |
| 54 if (async) { | 60 if (async) { |
| 55 xhr.upload.addEventListener("loadend", uploadEnd, false); | 61 xhr.upload.addEventListener("loadend", uploadEnd, false); |
| 56 xhr.addEventListener("progress", downloadProgress, false); | 62 xhr.addEventListener("progress", downloadProgress, false); |
| 57 xhr.upload.addEventListener("progress", uploadProgress, false); | 63 xhr.upload.addEventListener("progress", uploadProgress, false); |
| 58 } | 64 } |
| 59 xhr.open("POST", "/foo?count=" + (++xhrCount) + "&now=" + Date.now(), async)
; | 65 xhr.open("POST", "/foo?count=" + (++xhrCount) + "&now=" + Date.now(), async)
; |
| 60 xhr.send(String(sendXHR)); | 66 xhr.send(String(sendXHR)); |
| 61 } | 67 } |
| 62 | 68 |
| 63 var test = function() | 69 var test = function() |
| 64 { | 70 { |
| 65 var totalDebuggerStatements = 7; | 71 var totalDebuggerStatements = 9; |
| 66 var maxAsyncCallStackDepth = 4; | 72 var maxAsyncCallStackDepth = 4; |
| 67 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallSt
ackDepth); | 73 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallSt
ackDepth); |
| 68 } | 74 } |
| 69 | 75 |
| 70 </script> | 76 </script> |
| 71 </head> | 77 </head> |
| 72 | 78 |
| 73 <body onload="runTest()"> | 79 <body onload="runTest()"> |
| 74 <p> | 80 <p> |
| 75 Tests asynchronous call stacks for XHRs. | 81 Tests asynchronous call stacks for XHRs. |
| 76 </p> | 82 </p> |
| 77 | 83 |
| 78 </body> | 84 </body> |
| 79 </html> | 85 </html> |
| OLD | NEW |