Index: LayoutTests/http/tests/inspector/cache-storage/cache-names.html |
diff --git a/LayoutTests/http/tests/inspector/cache-storage/cache-names.html b/LayoutTests/http/tests/inspector/cache-storage/cache-names.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ca40da8dd3cd67ed3df4c0fa0b7db92c94306427 |
--- /dev/null |
+++ b/LayoutTests/http/tests/inspector/cache-storage/cache-names.html |
@@ -0,0 +1,48 @@ |
+<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; |
+ |
+ InspectorTest.addSniffer(WebInspector.ServiceWorkerCacheModel.prototype, "_updateCacheNames", main, false); |
+ |
+ function errorAndExit(error) |
+ { |
+ console.error(error); |
+ InspectorTest.completeTest(); |
+ } |
+ |
+ function before() |
+ { |
+ return caches.keys().then(function(keys) { |
+ 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.dumpCacheTree) |
+ .then(InspectorTest.createCache.bind(this, mainFrameId, "testCache2")) |
+ .then(InspectorTest.createCache.bind(this, mainFrameId, "testCache3")) |
+ .then(InspectorTest.createCache.bind(this, mainFrameId, "testCache4")) |
+ .then(InspectorTest.dumpCacheTree) |
+ .then(InspectorTest.completeTest) |
+ .catch(errorAndExit); |
+ } |
+} |
+</script> |
+</head> |
+<body onload="runTest()"> |
+<p>Tests that cache names are correctly loaded and displayed in the inspector.</p> |
+</body> |
+</html> |