Index: LayoutTests/http/tests/serviceworker/update.html |
diff --git a/LayoutTests/http/tests/serviceworker/update.html b/LayoutTests/http/tests/serviceworker/update.html |
index 9eb392a9898336b51f14b1d476611b9d50b2046c..cc4b88f39dda0e40cf4a8e60a74d785393813cfa 100644 |
--- a/LayoutTests/http/tests/serviceworker/update.html |
+++ b/LayoutTests/http/tests/serviceworker/update.html |
@@ -17,42 +17,43 @@ promise_test(function(t) { |
}) |
.then(function() { |
assert_equals(registration.installing, null, |
- 'installing should be null in the initial state'); |
+ 'installing should be null in the initial state.'); |
assert_equals(registration.waiting, null, |
- 'waiting should be null in the initial state'); |
+ 'waiting should be null in the initial state.'); |
assert_equals(registration.active.scriptURL, expected_url, |
- 'active should exist in the initial state'); |
+ 'active should exist in the initial state.'); |
- // A new worker should be found. |
- registration.update(); |
- return wait_for_update(t, registration); |
+ // A new worker (generated by update-worker.php) should be found. |
+ // The returned promise should resolve when a new worker script is |
+ // fetched and starts installing. |
+ return registration.update(); |
}) |
.then(function() { |
assert_equals(registration.installing.scriptURL, expected_url, |
- 'new installing should be set after updatefound'); |
+ 'new installing should be set after update resolves.'); |
assert_equals(registration.waiting, null, |
- 'waiting should still be null after updatefound'); |
+ 'waiting should still be null after update resolves.'); |
assert_equals(registration.active.scriptURL, expected_url, |
- 'active should still exist after update found'); |
+ 'active should still exist after update found.'); |
return wait_for_state(t, registration.installing, 'installed'); |
}) |
.then(function() { |
assert_equals(registration.installing, null, |
- 'installing should be null after installing'); |
+ 'installing should be null after installing.'); |
assert_equals(registration.waiting.scriptURL, expected_url, |
- 'waiting should be set after installing'); |
+ 'waiting should be set after installing.'); |
assert_equals(registration.active.scriptURL, expected_url, |
- 'active should still exist after installing'); |
+ 'active should still exist after installing.'); |
return wait_for_state(t, registration.waiting, 'activated'); |
}) |
.then(function() { |
assert_equals(registration.installing, null, |
- 'installing should be null after activated'); |
+ 'installing should be null after activated.'); |
assert_equals(registration.waiting, null, |
- 'waiting should be null after activated'); |
+ 'waiting should be null after activated.'); |
assert_equals(registration.active.scriptURL, expected_url, |
- 'new worker should be promoted to active'); |
+ 'new worker should be promoted to active.'); |
return service_worker_unregister_and_done(t, scope); |
}) |
- }, 'Update a registration'); |
+ }, 'Update a registration.'); |
</script> |