| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <script src="cache-storage-test.js"></script> | 4 <script src="cache-storage-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 var cacheStorageModel = InspectorTest.mainTarget.model(SDK.ServiceWorkerCach
eModel); | 8 var cacheStorageModel = InspectorTest.mainTarget.model(SDK.ServiceWorkerCach
eModel); |
| 9 cacheStorageModel.enable(); | 9 cacheStorageModel.enable(); |
| 10 | 10 |
| 11 function errorAndExit(error) | 11 function errorAndExit(error) |
| 12 { | 12 { |
| 13 if (error) | 13 if (error) |
| 14 InspectorTest.addResult(error); | 14 InspectorTest.addResult(error); |
| 15 InspectorTest.completeTest(); | 15 InspectorTest.completeTest(); |
| 16 } | 16 } |
| 17 | 17 |
| 18 function main() | 18 function main() |
| 19 { | 19 { |
| 20 InspectorTest.clearAllCaches() | 20 InspectorTest.clearAllCaches() |
| 21 .then(InspectorTest.dumpCacheTree) | 21 .then(InspectorTest.dumpCacheTree) |
| 22 .then(InspectorTest.createCache.bind(this, "testCache1")) | 22 .then(InspectorTest.createCache.bind(this, "testCache1")) |
| 23 .then(InspectorTest.createCache.bind(this, "testCache2")) | 23 .then(InspectorTest.createCache.bind(this, "testCache2")) |
| 24 .then(InspectorTest.dumpCacheTree) | 24 .then(InspectorTest.dumpCacheTree) |
| 25 .then(InspectorTest.addCacheEntry.bind(this, "testCache1", "http://f
ake.request.com/1", "OK")) | 25 .then(InspectorTest.addCacheEntry.bind(this, "testCache1", "http://f
ake.request.com/1", "OK")) |
| 26 .then(InspectorTest.addCacheEntry.bind(this, "testCache1", "http://f
ake.request.com/2", "Not Found")) | 26 .then(InspectorTest.addCacheEntry.bind(this, "testCache1", "http://f
ake.request.com/2", "Not Found")) |
| 27 .then(InspectorTest.addCacheEntry.bind(this, "testCache2", "http://f
ake.request2.com/1", "OK")) | 27 .then(InspectorTest.addCacheEntry.bind(this, "testCache2", "http://f
ake.request2.com/1", "OK")) |
| 28 .then(InspectorTest.addCacheEntry.bind(this, "testCache2", "http://f
ake.request2.com/2", "Not Found")) | 28 .then(InspectorTest.addCacheEntry.bind(this, "testCache2", "http://f
ake.request2.com/2", "Not Found")) |
| 29 .then(InspectorTest.dumpCacheTree) | 29 .then(InspectorTest.dumpCacheTree) |
| 30 .then(InspectorTest.clearAllCaches) | 30 .then(InspectorTest.clearAllCaches) |
| 31 .then(InspectorTest.completeTest) | 31 .then(InspectorTest.completeTest) |
| 32 .catch(errorAndExit); | 32 .catch(errorAndExit); |
| 33 } | 33 } |
| 34 | 34 |
| 35 InspectorTest.waitForCacheRefresh(main); | 35 InspectorTest.waitForCacheRefresh(main); |
| 36 } | 36 } |
| 37 </script> | 37 </script> |
| 38 </head> | 38 </head> |
| 39 <body onload="runTest()"> | 39 <body onload="runTest()"> |
| 40 <p>Tests that cache data is correctly populated in the Inspector.</p> | 40 <p>Tests that cache data is correctly populated in the Inspector.</p> |
| 41 </body> | 41 </body> |
| 42 </html> | 42 </html> |
| OLD | NEW |