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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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.callFunctionInPageAsync("makeFetch", [url, requestInitializer] ).then(callback); | 120 InspectorTest.callFunctionInPageAsync("makeFetch", [url, requestInitializer] ).then(callback); |
| 121 } | 121 } |
| 122 | 122 |
| 123 InspectorTest.clearNetworkCache = function(finishedCallback) | |
| 124 { | |
| 125 // This turns cache off and then on, effectively clearning the cache. | |
| 126 InspectorTest.NetworkAgent.setCacheDisabled(true, function() { | |
|
allada
2016/12/16 22:47:28
Our new code does not use anonymous functions, we
Sergiy Byelozyorov
2016/12/17 15:38:53
Done.
| |
| 127 InspectorTest.NetworkAgent.setCacheDisabled(false, finishedCallback); | |
| 128 }); | |
| 129 } | |
| 130 | |
| 123 InspectorTest.HARPropertyFormatters = { | 131 InspectorTest.HARPropertyFormatters = { |
| 124 bodySize: "formatAsTypeName", | 132 bodySize: "formatAsTypeName", |
| 125 compression: "formatAsTypeName", | 133 compression: "formatAsTypeName", |
| 126 connection: "formatAsTypeName", | 134 connection: "formatAsTypeName", |
| 127 headers: "formatAsTypeName", | 135 headers: "formatAsTypeName", |
| 128 headersSize: "formatAsTypeName", | 136 headersSize: "formatAsTypeName", |
| 129 id: "formatAsTypeName", | 137 id: "formatAsTypeName", |
| 130 onContentLoad: "formatAsTypeName", | 138 onContentLoad: "formatAsTypeName", |
| 131 onLoad: "formatAsTypeName", | 139 onLoad: "formatAsTypeName", |
| 132 receive: "formatAsTypeName", | 140 receive: "formatAsTypeName", |
| 133 startedDateTime: "formatAsRecentTime", | 141 startedDateTime: "formatAsRecentTime", |
| 134 time: "formatAsTypeName", | 142 time: "formatAsTypeName", |
| 135 timings: "formatAsTypeName", | 143 timings: "formatAsTypeName", |
| 136 version: "formatAsTypeName", | 144 version: "formatAsTypeName", |
| 137 wait: "formatAsTypeName", | 145 wait: "formatAsTypeName", |
| 138 _transferSize: "formatAsTypeName", | 146 _transferSize: "formatAsTypeName", |
| 139 _error: "skip" | 147 _error: "skip" |
| 140 }; | 148 }; |
| 141 // addObject checks own properties only, so make a deep copy rather than use pro totype. | 149 // 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)); | 150 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto rTest.HARPropertyFormatters)); |
| 143 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; | 151 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; |
| 144 | 152 |
| 145 }; | 153 }; |
| OLD | NEW |