Bug 1189661 - either of active or waiting can be valid. r=bkelly

This commit is contained in:
Nikhil Marathe 2015-08-21 14:25:46 -07:00
parent 758988db97
commit ccb6fdc92c

View File

@ -26,16 +26,19 @@ async_test(function(t) {
.then(function() {
var controller = frame.contentWindow.navigator.serviceWorker.controller;
assert_equals(controller, null);
assert_equals(registration.active, null);
assert_equals(registration.waiting.scriptURL, normalizeURL(url));
// Nothing in the spec prohibits a worker from going to active
// immediately.
// Step 26 of the [[Install]] algorithm
// "If registration's waiting worker waitingWorker is not null and
// waitingWorker's skip waiting flag is not set, invoke Activate
// algorithm, or its equivalent, with registration as its argument."
var w = registration.waiting || registration.active;
assert_equals(w.scriptURL, normalizeURL(url));
assert_equals(registration.installing, null);
// FIXME: Add a test for a frame created after installation.
// Should the existing frame ("frame") block activation?
})
.then(function() {
frame.remove();
return service_worker_unregister_and_done(t, scope);
});
}, 'waiting is set');
}, 'waiting or active is set');
</script>