Commit bcdfcd1c authored by kristipark's avatar kristipark Committed by Commit Bot

[DevTools] Removed refreshing from Cache Storage live update list test

The live update list layout test was using dumpCacheTree()
to output the current cache storage list. However,
dumpCacheTree() refreshes cache storage before dumping,
causing the test to pass even if live update fails.

Switched to use dumpCacheTreeNoRefresh(), which dumps
the current tree without refreshing.

Bug: None
Change-Id: Ie34d6261362c3ae5b1584fdf163a0ca559c75787
Reviewed-on: https://chromium-review.googlesource.com/639916
Commit-Queue: Kristi Park <kristipark@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500006}
parent b8556ae8
<html> <html>
<head> <head>
<meta name="timeout" content="long">
<script src="../inspector-test.js"></script> <script src="../inspector-test.js"></script>
<script src="cache-storage-test.js"></script> <script src="cache-storage-test.js"></script>
<script> <script>
function test() { async function test() {
var cacheStorageModel = TestRunner.mainTarget.model(SDK.ServiceWorkerCacheModel); var cacheStorageModel = InspectorTest.mainTarget.model(SDK.ServiceWorkerCacheModel);
cacheStorageModel.enable(); cacheStorageModel.enable();
cacheStorageModel._throttler._timeout = 0;
function errorAndExit(error) { await InspectorTest.clearAllCaches();
if (error) await InspectorTest.dumpCacheTree();
TestRunner.addResult(error);
TestRunner.completeTest();
}
function main() { var promise = InspectorTest.addSnifferPromise(SDK.ServiceWorkerCacheModel.prototype, '_cacheAdded');
ApplicationTestRunner.clearAllCaches() InspectorTest.createCache('testCache1');
.then(ApplicationTestRunner.dumpCacheTree) await promise;
.then(ApplicationTestRunner.createCache.bind(this, 'testCache1')) await InspectorTest.dumpCacheTreeNoRefresh();
.then(ApplicationTestRunner.dumpCacheTree)
.then(ApplicationTestRunner.createCache.bind(this, 'testCache2'))
.then(ApplicationTestRunner.dumpCacheTree)
.then(ApplicationTestRunner.deleteCache.bind(this, 'testCache1'))
.then(ApplicationTestRunner.dumpCacheTree)
.then(ApplicationTestRunner.clearAllCaches)
.then(TestRunner.completeTest)
.catch(errorAndExit);
}
ApplicationTestRunner.waitForCacheRefresh(main); promise = InspectorTest.addSnifferPromise(SDK.ServiceWorkerCacheModel.prototype, '_cacheAdded');
InspectorTest.createCache('testCache2');
await promise;
await InspectorTest.dumpCacheTreeNoRefresh();
promise = InspectorTest.addSnifferPromise(SDK.ServiceWorkerCacheModel.prototype, '_cacheRemoved');
InspectorTest.deleteCache('testCache1');
await promise;
await InspectorTest.dumpCacheTreeNoRefresh();
await InspectorTest.clearAllCaches();
InspectorTest.completeTest();
} }
</script> </script>
</head> </head>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment