Chromium Code Reviews| Index: LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html |
| diff --git a/LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html b/LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fd57ca02faf4f96d4bc6278abf2a43b1e9aa008e |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html |
| @@ -0,0 +1,45 @@ |
| +<html> |
| +<head> |
| +<script src="../inspector-test.js"></script> |
| +<script src="cache-storage-test.js"></script> |
| +<script> |
| +function test() |
| +{ |
| + var cacheStorageModel = WebInspector.ServiceWorkerCacheModel.fromTarget(WebInspector.targetManager.mainTarget()); |
| + cacheStorageModel.enable(); |
| + |
| + function errorAndExit(error) |
| + { |
| + if (error) |
| + console.error(error); |
|
pfeldman
2015/04/15 17:50:08
nit: InspectorTest.addResult
dmurph
2015/04/15 21:29:32
Done.
|
| + InspectorTest.completeTest(); |
| + } |
| + |
| + function main() |
| + { |
| + InspectorTest.clearAllCaches() |
| + .then(InspectorTest.dumpCacheTree) |
| + .then(InspectorTest.createCache.bind(this, "testCache1")) |
| + .then(InspectorTest.createCache.bind(this, "testCache2")) |
| + .then(InspectorTest.dumpCacheTree) |
| + .then(InspectorTest.addCacheEntry.bind(this, "testCache1", "http://fake.request.com/1", "OK")) |
| + .then(InspectorTest.addCacheEntry.bind(this, "testCache1", "http://fake.request.com/2", "Not Found")) |
| + .then(InspectorTest.addCacheEntry.bind(this, "testCache2", "http://fake.request2.com/1", "OK")) |
| + .then(InspectorTest.addCacheEntry.bind(this, "testCache2", "http://fake.request2.com/2", "Not Found")) |
| + .then(InspectorTest.dumpCacheTree) |
| + .then(InspectorTest.deleteCache.bind(this, "testCache1")) |
| + .then(InspectorTest.deleteCacheFromInspector.bind(this, "testCache2")) |
| + .then(InspectorTest.dumpCacheTree) |
| + .then(InspectorTest.clearAllCaches) |
| + .then(InspectorTest.completeTest) |
| + .catch(errorAndExit); |
| + } |
| + |
| + InspectorTest.waitForCacheRefresh(main); |
| +} |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +<p>Tests that cache data is correctly deleted by the inspector.</p> |
| +</body> |
| +</html> |