| OLD | NEW |
| 1 // This goes before everything else to keep console message line number invarian
t. | 1 // This goes before everything else to keep console message line number invarian
t. |
| 2 var lastXHRIndex = 0; | 2 var lastXHRIndex = 0; |
| 3 function xhrLoadedCallback() | 3 function xhrLoadedCallback() |
| 4 { | 4 { |
| 5 // We need to make sure the console message text is unique so that we don't
end up with repeat count update only. | 5 // We need to make sure the console message text is unique so that we don't
end up with repeat count update only. |
| 6 console.log("XHR loaded: " + (++lastXHRIndex)); | 6 console.log("XHR loaded: " + (++lastXHRIndex)); |
| 7 } | 7 } |
| 8 | 8 |
| 9 var initialize_NetworkTest = function() { | 9 var initialize_NetworkTest = function() { |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 function makeSimpleXHRWithPayload(method, url, async, payload, callback) | 112 function makeSimpleXHRWithPayload(method, url, async, payload, callback) |
| 113 { | 113 { |
| 114 makeXHR(method, url, async, undefined, undefined, [], false, payload, callba
ck) | 114 makeXHR(method, url, async, undefined, undefined, [], false, payload, callba
ck) |
| 115 } | 115 } |
| 116 | 116 |
| 117 function makeXHR(method, url, async, user, password, headers, withCredentials, p
ayload, type, callback) | 117 function makeXHR(method, url, async, user, password, headers, withCredentials, p
ayload, type, callback) |
| 118 { | 118 { |
| 119 var xhr = new XMLHttpRequest(); | 119 var xhr = new XMLHttpRequest(); |
| 120 xhr.responseType = type; | 120 if (type == undefined) |
| 121 xhr.responseType = ""; |
| 122 else |
| 123 xhr.responseType = type; |
| 121 xhr.onreadystatechange = function() | 124 xhr.onreadystatechange = function() |
| 122 { | 125 { |
| 123 if (xhr.readyState === XMLHttpRequest.DONE) { | 126 if (xhr.readyState === XMLHttpRequest.DONE) { |
| 124 if (typeof(callback) === "function") | 127 if (typeof(callback) === "function") |
| 125 callback(); | 128 callback(); |
| 126 } | 129 } |
| 127 } | 130 } |
| 128 xhr.open(method, url, async, user, password); | 131 xhr.open(method, url, async, user, password); |
| 129 xhr.withCredentials = withCredentials; | 132 xhr.withCredentials = withCredentials; |
| 130 for (var i = 0; i < headers.length; ++i) | 133 for (var i = 0; i < headers.length; ++i) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 141 | 144 |
| 142 function resetInspectorResourcesData() | 145 function resetInspectorResourcesData() |
| 143 { | 146 { |
| 144 if (!window.internals) | 147 if (!window.internals) |
| 145 return false; | 148 return false; |
| 146 | 149 |
| 147 internals.setInspectorResourcesDataSizeLimits(10 * 1000 * 1000, 1000 * 1000)
; | 150 internals.setInspectorResourcesDataSizeLimits(10 * 1000 * 1000, 1000 * 1000)
; |
| 148 return true; | 151 return true; |
| 149 } | 152 } |
| 150 | 153 |
| OLD | NEW |