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 30 matching lines...) Expand all Loading... | |
| 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) | 46 function makeFetch(url, requestInitializer) |
| 47 { | 47 { |
| 48 return fetch(url, requestInitializer).catch(e => e); | 48 return fetch(url, requestInitializer).catch(e => e); |
| 49 } | 49 } |
| 50 | 50 |
| 51 function onCacheStorageError(e) | |
| 52 { | |
| 53 console.error("CacheStorage error: " + e); | |
| 54 } | |
| 55 | |
| 56 function clearAllCaches() | |
| 57 { | |
| 58 return caches.keys() | |
| 59 .then((keys) => Promise.all(keys.map((key) => caches.delete(key)))) | |
|
allada
2016/12/15 19:01:49
I see you pulled this from http/tests/inspector/ca
| |
| 60 .catch(onCacheStorageError.bind(this)); | |
| 61 } | |
| 62 | |
| 51 var initialize_NetworkTest = function() { | 63 var initialize_NetworkTest = function() { |
| 52 | 64 |
| 53 InspectorTest.preloadPanel("network"); | 65 InspectorTest.preloadPanel("network"); |
| 54 | 66 |
| 55 InspectorTest.recordNetwork = function() | 67 InspectorTest.recordNetwork = function() |
| 56 { | 68 { |
| 57 UI.panels.network._networkLogView.setRecording(true); | 69 UI.panels.network._networkLogView.setRecording(true); |
| 58 } | 70 } |
| 59 | 71 |
| 60 InspectorTest.networkRequests = function() | 72 InspectorTest.networkRequests = function() |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 | 125 |
| 114 InspectorTest.addConsoleSniffer(innerCallback); | 126 InspectorTest.addConsoleSniffer(innerCallback); |
| 115 InspectorTest.evaluateInPage("makeXHRForJSONArguments(\"" + jsonArgs + "\")" ); | 127 InspectorTest.evaluateInPage("makeXHRForJSONArguments(\"" + jsonArgs + "\")" ); |
| 116 } | 128 } |
| 117 | 129 |
| 118 InspectorTest.makeFetch = function(url, requestInitializer, callback) | 130 InspectorTest.makeFetch = function(url, requestInitializer, callback) |
| 119 { | 131 { |
| 120 InspectorTest.callFunctionInPageAsync("makeFetch", [url, requestInitializer] ).then(callback); | 132 InspectorTest.callFunctionInPageAsync("makeFetch", [url, requestInitializer] ).then(callback); |
| 121 } | 133 } |
| 122 | 134 |
| 135 InspectorTest.clearAllCaches = function() | |
| 136 { | |
| 137 return InspectorTest.evaluateInPage("clearAllCaches"); | |
| 138 } | |
| 139 | |
| 123 InspectorTest.HARPropertyFormatters = { | 140 InspectorTest.HARPropertyFormatters = { |
| 124 bodySize: "formatAsTypeName", | 141 bodySize: "formatAsTypeName", |
| 125 compression: "formatAsTypeName", | 142 compression: "formatAsTypeName", |
| 126 connection: "formatAsTypeName", | 143 connection: "formatAsTypeName", |
| 127 headers: "formatAsTypeName", | 144 headers: "formatAsTypeName", |
| 128 headersSize: "formatAsTypeName", | 145 headersSize: "formatAsTypeName", |
| 129 id: "formatAsTypeName", | 146 id: "formatAsTypeName", |
| 130 onContentLoad: "formatAsTypeName", | 147 onContentLoad: "formatAsTypeName", |
| 131 onLoad: "formatAsTypeName", | 148 onLoad: "formatAsTypeName", |
| 132 receive: "formatAsTypeName", | 149 receive: "formatAsTypeName", |
| 133 startedDateTime: "formatAsRecentTime", | 150 startedDateTime: "formatAsRecentTime", |
| 134 time: "formatAsTypeName", | 151 time: "formatAsTypeName", |
| 135 timings: "formatAsTypeName", | 152 timings: "formatAsTypeName", |
| 136 version: "formatAsTypeName", | 153 version: "formatAsTypeName", |
| 137 wait: "formatAsTypeName", | 154 wait: "formatAsTypeName", |
| 138 _transferSize: "formatAsTypeName", | 155 _transferSize: "formatAsTypeName", |
| 139 _error: "skip" | 156 _error: "skip" |
| 140 }; | 157 }; |
| 141 // addObject checks own properties only, so make a deep copy rather than use pro totype. | 158 // 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)); | 159 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto rTest.HARPropertyFormatters)); |
| 143 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; | 160 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; |
| 144 | 161 |
| 145 }; | 162 }; |
| OLD | NEW |