Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / serviceworker / activation-after-registration.html
index e2feb7e..06b716b 100644 (file)
@@ -11,18 +11,21 @@ t.step(function() {
     var registration;
 
     service_worker_unregister_and_register(
-        t, 'resources/worker-no-op.js', scope)
-      .then(t.step_func(function(r) {
+        t, 'resources/empty-worker.js', scope)
+      .then(function(r) {
           registration = r;
           return wait_for_update(t, registration);
-        }))
-      .then(t.step_func(function(worker) {
-          assert_equals(worker.state, 'parsed', 'worker should be in the "parsed" state upon registration');
-          worker.addEventListener('statechange', t.step_func(function(event) {
-              if (event.target.state == 'activated')
-                  service_worker_unregister_and_done(t, scope);
-          }));
-        }))
+        })
+      .then(function(worker) {
+          assert_equals(
+              worker.state,
+              'installing',
+              'worker should be in the "installing" state upon registration');
+          return wait_for_state(t, worker, 'activated');
+        })
+      .then(function() {
+          service_worker_unregister_and_done(t, scope);
+        })
       .catch(unreached_rejection(t));
 });
 </script>