Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js |
| index 470d3d7a49d77328ae916923e13293be9f64bfc7..d36ed1b593594b60da396c8b1ba2d113398062ff 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js |
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js |
| @@ -48,6 +48,18 @@ function makeFetch(url, requestInitializer) |
| return fetch(url, requestInitializer).catch(e => e); |
| } |
| +function onCacheStorageError(e) |
| +{ |
| + console.error("CacheStorage error: " + e); |
| +} |
| + |
| +function clearAllCaches() |
| +{ |
| + return caches.keys() |
| + .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
|
| + .catch(onCacheStorageError.bind(this)); |
| +} |
| + |
| var initialize_NetworkTest = function() { |
| InspectorTest.preloadPanel("network"); |
| @@ -120,6 +132,11 @@ InspectorTest.makeFetch = function(url, requestInitializer, callback) |
| InspectorTest.callFunctionInPageAsync("makeFetch", [url, requestInitializer]).then(callback); |
| } |
| +InspectorTest.clearAllCaches = function() |
| +{ |
| + return InspectorTest.evaluateInPage("clearAllCaches"); |
| +} |
| + |
| InspectorTest.HARPropertyFormatters = { |
| bodySize: "formatAsTypeName", |
| compression: "formatAsTypeName", |