OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Service Worker: Update should be triggered after a navigation fetch event
.</title> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script src="resources/test-helpers.sub.js"></script> |
| 6 <script> |
| 7 |
| 8 promise_test(function(t) { |
| 9 var script = 'resources/update-nocookie-worker.py'; |
| 10 var scope = 'resources/scope/update'; |
| 11 var parsed_url = normalizeURL(script); |
| 12 var registration; |
| 13 var frame; |
| 14 |
| 15 return service_worker_unregister_and_register(t, parsed_url, scope) |
| 16 .then(function(r) { |
| 17 registration = r; |
| 18 return wait_for_state(t, registration.installing, 'activated'); |
| 19 }) |
| 20 .then(function() { |
| 21 // Navigation to the iframe. |
| 22 return with_iframe(scope); |
| 23 }) |
| 24 .then(function(f) { |
| 25 frame = f; |
| 26 // Navigation fetch event should trigger update. |
| 27 return wait_for_update(t, registration); |
| 28 }) |
| 29 .then(function() { |
| 30 frame.remove(); |
| 31 return service_worker_unregister_and_done(t, scope); |
| 32 }) |
| 33 }, 'Update should be triggered after a navigation fetch event.'); |
| 34 </script> |
OLD | NEW |