Chromium Code Reviews| 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 function makeSimpleXHR(method, url, async, callback) | 9 function makeSimpleXHR(method, url, async, callback) |
| 10 { | 10 { |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 xhr.setRequestHeader(headers[i][0], headers[i][1]); | 36 xhr.setRequestHeader(headers[i][0], headers[i][1]); |
| 37 xhr.send(payload); | 37 xhr.send(payload); |
| 38 } | 38 } |
| 39 | 39 |
| 40 function makeXHRForJSONArguments(jsonArgs) | 40 function makeXHRForJSONArguments(jsonArgs) |
| 41 { | 41 { |
| 42 var args = JSON.parse(jsonArgs); | 42 var args = JSON.parse(jsonArgs); |
| 43 makeXHR(args.method, args.url, args.async, args.user, args.password, args.he aders || [], args.withCredentials, args.payload, args.type, xhrLoadedCallback); | 43 makeXHR(args.method, args.url, args.async, args.user, args.password, args.he aders || [], args.withCredentials, args.payload, args.type, xhrLoadedCallback); |
| 44 } | 44 } |
| 45 | 45 |
| 46 function makeFetch(url, requestInitializer, callback) | 46 function makeFetch(url, requestInitializer) |
| 47 { | 47 { |
| 48 fetch(url, requestInitializer).then(callback).catch(callback); | 48 return fetch(url, requestInitializer).catch((e) => e); |
|
caseq
2016/08/05 17:56:41
e => e
kozy
2016/08/10 01:21:13
Done.
| |
| 49 } | 49 } |
| 50 | 50 |
| 51 var initialize_NetworkTest = function() { | 51 var initialize_NetworkTest = function() { |
| 52 | 52 |
| 53 InspectorTest.preloadPanel("network"); | 53 InspectorTest.preloadPanel("network"); |
| 54 | 54 |
| 55 InspectorTest.recordNetwork = function() | 55 InspectorTest.recordNetwork = function() |
| 56 { | 56 { |
| 57 WebInspector.panels.network._networkLogView.setRecording(true); | 57 WebInspector.panels.network._networkLogView.setRecording(true); |
| 58 } | 58 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 else | 110 else |
| 111 InspectorTest.addConsoleSniffer(innerCallback); | 111 InspectorTest.addConsoleSniffer(innerCallback); |
| 112 } | 112 } |
| 113 | 113 |
| 114 InspectorTest.addConsoleSniffer(innerCallback); | 114 InspectorTest.addConsoleSniffer(innerCallback); |
| 115 InspectorTest.evaluateInPage("makeXHRForJSONArguments(\"" + jsonArgs + "\")" ); | 115 InspectorTest.evaluateInPage("makeXHRForJSONArguments(\"" + jsonArgs + "\")" ); |
| 116 } | 116 } |
| 117 | 117 |
| 118 InspectorTest.makeFetch = function(url, requestInitializer, callback) | 118 InspectorTest.makeFetch = function(url, requestInitializer, callback) |
| 119 { | 119 { |
| 120 InspectorTest.invokePageFunctionAsync("makeFetch", url, requestInitializer, callback); | 120 InspectorTest.callFunctionInPageAsync("makeFetch", [ url, requestInitializer ]).then(callback); |
|
caseq
2016/08/05 17:56:41
[url, requestInitializer] (i.e. nuke spaces)
kozy
2016/08/10 01:21:13
Done.
| |
| 121 } | 121 } |
| 122 | 122 |
| 123 InspectorTest.HARPropertyFormatters = { | 123 InspectorTest.HARPropertyFormatters = { |
| 124 bodySize: "formatAsTypeName", | 124 bodySize: "formatAsTypeName", |
| 125 compression: "formatAsTypeName", | 125 compression: "formatAsTypeName", |
| 126 connection: "formatAsTypeName", | 126 connection: "formatAsTypeName", |
| 127 headers: "formatAsTypeName", | 127 headers: "formatAsTypeName", |
| 128 headersSize: "formatAsTypeName", | 128 headersSize: "formatAsTypeName", |
| 129 id: "formatAsTypeName", | 129 id: "formatAsTypeName", |
| 130 onContentLoad: "formatAsTypeName", | 130 onContentLoad: "formatAsTypeName", |
| 131 onLoad: "formatAsTypeName", | 131 onLoad: "formatAsTypeName", |
| 132 receive: "formatAsTypeName", | 132 receive: "formatAsTypeName", |
| 133 startedDateTime: "formatAsRecentTime", | 133 startedDateTime: "formatAsRecentTime", |
| 134 time: "formatAsTypeName", | 134 time: "formatAsTypeName", |
| 135 timings: "formatAsTypeName", | 135 timings: "formatAsTypeName", |
| 136 version: "formatAsTypeName", | 136 version: "formatAsTypeName", |
| 137 wait: "formatAsTypeName", | 137 wait: "formatAsTypeName", |
| 138 _transferSize: "formatAsTypeName", | 138 _transferSize: "formatAsTypeName", |
| 139 _error: "skip" | 139 _error: "skip" |
| 140 }; | 140 }; |
| 141 // addObject checks own properties only, so make a deep copy rather than use pro totype. | 141 // addObject checks own properties only, so make a deep copy rather than use pro totype. |
| 142 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto rTest.HARPropertyFormatters)); | 142 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto rTest.HARPropertyFormatters)); |
| 143 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; | 143 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; |
| 144 | 144 |
| 145 }; | 145 }; |
| OLD | NEW |