Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: LayoutTests/http/tests/serviceworker/state.html

Issue 466723002: ServiceWorker: Enable ServiceWorkerRegistration and update layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@updatefound
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/serviceworker/state.html
diff --git a/LayoutTests/http/tests/serviceworker/state.html b/LayoutTests/http/tests/serviceworker/state.html
index e4afe9a1f85a44c3f2435b41a875e20297f30445..a873882c110040f18b4bc1c4de58b3df2111023c 100644
--- a/LayoutTests/http/tests/serviceworker/state.html
+++ b/LayoutTests/http/tests/serviceworker/state.html
@@ -9,15 +9,19 @@
var currentState = 'test-is-starting';
var scope = '/state/';
- service_worker_unregister_and_register(t, 'resources/worker-no-op.js', scope).then(t.step_func(onRegister));
-
- function onRegister(sw) {
- sw.addEventListener('statechange', t.step_func(onStateChange(sw)));
- assert_in_array(sw.state, ['parsed', 'installing'],
- 'the service worker should be in a state up to ' +
- '"installing".');
- checkStateTransition(sw.state);
- }
+ service_worker_unregister_and_register(
+ t, 'resources/worker-no-op.js', scope)
+ .then(t.step_func(function(registration) {
+ return wait_for_update(t, registration);
+ }))
+ .then(t.step_func(function(sw) {
+ sw.addEventListener('statechange', t.step_func(onStateChange(sw)));
+ assert_in_array(sw.state, ['parsed', 'installing'],
+ 'the service worker should be in a state up to ' +
+ '"installing".');
+ checkStateTransition(sw.state);
+ }))
+ .catch(unreached_rejection(t));
function checkStateTransition(newState) {
switch (currentState) {

Powered by Google App Engine
This is Rietveld 408576698