OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Cache Storage: Verify that Window and Workers see same storage</title> | 2 <title>Cache Storage: Verify that Window and Workers see same storage</title> |
3 <link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_
worker/#cache-storage"> | 3 <link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage"> |
| 4 <meta name="timeout" content="long"> |
4 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
5 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <script src="../resources/testharness-helpers.js"></script> |
6 <script> | 8 <script> |
7 | 9 |
8 function wait_for_message(worker) { | 10 function wait_for_message(worker) { |
9 return new Promise(function(resolve) { | 11 return new Promise(function(resolve) { |
10 worker.addEventListener('message', function listener(e) { | 12 worker.addEventListener('message', function listener(e) { |
11 resolve(e.data); | 13 resolve(e.data); |
12 worker.removeEventListener('message', listener); | 14 worker.removeEventListener('message', listener); |
13 }); | 15 }); |
14 }); | 16 }); |
15 } | 17 } |
(...skipping 25 matching lines...) Expand all Loading... |
41 assert_equals(bodies[0], 'a', | 43 assert_equals(bodies[0], 'a', |
42 'Body should match response put by worker'); | 44 'Body should match response put by worker'); |
43 assert_equals(bodies[1], 'b', | 45 assert_equals(bodies[1], 'b', |
44 'Body should match response put by worker'); | 46 'Body should match response put by worker'); |
45 assert_equals(bodies[2], 'c', | 47 assert_equals(bodies[2], 'c', |
46 'Body should match response put by worker'); | 48 'Body should match response put by worker'); |
47 }); | 49 }); |
48 }, 'Window sees cache puts by Worker'); | 50 }, 'Window sees cache puts by Worker'); |
49 | 51 |
50 </script> | 52 </script> |
OLD | NEW |