Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html

Issue 1044203004: [Storage] Cache storage inspection on all the frames! (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..2be7b6bf52cd3b7e9bc649160a29133e5af33bf9
--- /dev/null
+++ b/LayoutTests/http/tests/inspector/cache-storage/cache-deletion.html
@@ -0,0 +1,54 @@
+<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();
+ var mainFrameId = InspectorTest.resourceTreeModel.mainFrame.id;
+ var origin = document.origin;
+ InspectorTest.addSniffer(WebInspector.ServiceWorkerCacheModel.prototype, "_updateCacheNames", main, false);
pfeldman 2015/04/10 12:35:33 Since used more than once, it could be a part of c
dmurph 2015/04/13 18:23:03 Done.
+
+ function errorAndExit(error)
+ {
+ if (error)
+ console.error(error);
+ InspectorTest.completeTest();
+ }
+
+ function before()
+ {
+ return caches.keys().then(function(keys) {
pfeldman 2015/04/10 12:35:33 Since used more than once, it could be a part of c
dmurph 2015/04/13 18:23:03 Done.
+ return Promise.all(keys.map(function(key) {
+ return caches.delete(key);
+ }));
+ });
+ }
+
+ function main()
+ {
+ before()
+ .then(InspectorTest.dumpCacheTree)
+ .then(InspectorTest.createCache.bind(this, mainFrameId, "testCache1"))
+ .then(InspectorTest.createCache.bind(this, mainFrameId, "testCache2"))
+ .then(InspectorTest.dumpCacheTree)
+ .then(InspectorTest.addCacheEntry.bind(this, mainFrameId, "testCache1", "http://fake.request.com/1", "OK"))
+ .then(InspectorTest.addCacheEntry.bind(this, mainFrameId, "testCache1", "http://fake.request.com/2", "Not Found"))
+ .then(InspectorTest.addCacheEntry.bind(this, mainFrameId, "testCache2", "http://fake.request2.com/1", "OK"))
+ .then(InspectorTest.addCacheEntry.bind(this, mainFrameId, "testCache2", "http://fake.request2.com/2", "Not Found"))
+ .then(InspectorTest.dumpCacheTree)
+ .then(InspectorTest.deleteCache.bind(this, mainFrameId, "testCache1"))
+ .then(InspectorTest.deleteCacheFromInspector.bind(this, "testCache2"))
+ .then(InspectorTest.dumpCacheTree)
+ .then(InspectorTest.completeTest)
+ .catch(errorAndExit);
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests that cache data is correctly deleted by the inspector.</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698