| Index: LayoutTests/http/tests/serviceworker/resources/worker-testharness.js
|
| diff --git a/LayoutTests/http/tests/serviceworker/resources/worker-testharness.js b/LayoutTests/http/tests/serviceworker/resources/worker-testharness.js
|
| index 986c86a82ed7d8960380e258e78f03d5ccdd8bf8..73b4186c17308098ad12b0fe6afab1702ccec61e 100644
|
| --- a/LayoutTests/http/tests/serviceworker/resources/worker-testharness.js
|
| +++ b/LayoutTests/http/tests/serviceworker/resources/worker-testharness.js
|
| @@ -72,3 +72,25 @@ importScripts('/resources/testharness.js');
|
| }
|
| });
|
| })();
|
| +
|
| +(function() {
|
| + var next_cache_index = 1;
|
| +
|
| + // Returns a promise that resolves to a newly created Cache object. The
|
| + // returned Cache will be destroyed when |test| completes.
|
| + function create_temporary_cache(test, base_name) {
|
| + var uniquifier = base_name || String(++next_cache_index);
|
| + var cache_name = self.location.pathname + '/' + uniquifier;
|
| +
|
| + test.add_cleanup(function() {
|
| + self.caches.delete(cache_name);
|
| + });
|
| +
|
| + return self.caches.delete(cache_name)
|
| + .then(function() {
|
| + return self.caches.create(cache_name);
|
| + });
|
| + }
|
| +
|
| + self.create_temporary_cache = create_temporary_cache;
|
| +})();
|
|
|