OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 <script src="resources/test-helpers.js"></script> | 4 <script src="resources/test-helpers.js"></script> |
5 <body> | 5 <body> |
6 <script> | 6 <script> |
7 | 7 |
8 var INSTALL_APPCACHE_URL = "resources/appcache-ordering.install.html"; | 8 var INSTALL_APPCACHE_URL = "resources/appcache-ordering.install.html"; |
9 var IS_APPCACHED_URL = "resources/appcache-ordering.is-appcached.html"; | 9 var IS_APPCACHED_URL = "resources/appcache-ordering.is-appcached.html"; |
10 var SERVICE_WORKER_SCOPE = "resources/appcache-ordering"; | 10 var SERVICE_WORKER_SCOPE = "resources/appcache-ordering"; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 }) | 63 }) |
64 .then(function() { | 64 .then(function() { |
65 return is_appcached(); | 65 return is_appcached(); |
66 }) | 66 }) |
67 .then(function(result) { | 67 .then(function(result) { |
68 assert_true(result, 'appcache should initially be utilized'); | 68 assert_true(result, 'appcache should initially be utilized'); |
69 return service_worker_unregister_and_register( | 69 return service_worker_unregister_and_register( |
70 t, SERVICE_WORKER_SCRIPT, SERVICE_WORKER_SCOPE); | 70 t, SERVICE_WORKER_SCRIPT, SERVICE_WORKER_SCOPE); |
71 }) | 71 }) |
72 .then(function(r) { | 72 .then(function(r) { |
73 return wait_for_activated(t, r); | 73 return wait_for_state(t, r.installing, 'activated'); |
74 }) | 74 }) |
75 .then(function() { | 75 .then(function() { |
76 return is_appcached(); | 76 return is_appcached(); |
77 }) | 77 }) |
78 .then(function(result) { | 78 .then(function(result) { |
79 assert_false(result, 'but serviceworkers should take priority'); | 79 assert_false(result, 'but serviceworkers should take priority'); |
80 service_worker_unregister_and_done(t, SERVICE_WORKER_SCOPE); | 80 service_worker_unregister_and_done(t, SERVICE_WORKER_SCOPE); |
81 }) | 81 }) |
82 .catch(unreached_rejection(t)); | 82 .catch(unreached_rejection(t)); |
83 }, 'serviceworkers take priority over appcaches'); | 83 }, 'serviceworkers take priority over appcaches'); |
84 | 84 |
85 </script> | 85 </script> |
86 </body> | 86 </body> |
OLD | NEW |