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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/unregister-then-register.https.html

Issue 2904123002: Upstream service worker "unregister" tests to WPT (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/reject-install-worker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/unregister-then-register.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/unregister-then-register.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/unregister-then-register.https.html
index d75904d158f6e14a4da04d033170d4a609cee534..6c0a0aecf3f562a56edf7ff65acb9fcd675cdfa6 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/unregister-then-register.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/unregister-then-register.https.html
@@ -56,6 +56,45 @@ async_test(function(t) {
'registration is in use.');
async_test(function(t) {
+ var scope = 'resources/scope/complete-unregistration-followed-by-' +
+ 'reloading-controllee-iframe';
+ var registration;
+ var frame;
+ var service_worker;
+ service_worker_unregister_and_register(t, worker_url, scope)
+ .then(function(r) {
+ registration = r;
+ return wait_for_state(t, r.installing, 'activated');
+ })
+ .then(function() {
+ return with_iframe(scope);
+ })
+ .then(function(f) {
+ frame = f;
+ return registration.unregister();
+ })
+ .then(function() {
+ return new Promise(function(resolve) {
+ frame.onload = resolve;
+ frame.contentWindow.location.reload();
+ });
+ })
+ .then(function() {
+ var c = frame.contentWindow.navigator.serviceWorker.controller;
+ assert_equals(c, null, 'a page after unregistration should not be ' +
+ 'controlled by service worker');
+ return navigator.serviceWorker.getRegistration(scope);
+ })
+ .then(function(r) {
+ assert_equals(r, undefined, 'getRegistration should return ' +
+ 'undefined after unregistration');
+ service_worker_unregister_and_done(t, scope);
+ })
+ .catch(unreached_rejection(t));
+}, 'Reloading the last controlled iframe after unregistration should ensure ' +
+ 'the deletion of the registration');
+
+async_test(function(t) {
var scope = 'resources/scope/re-register-does-not-affect-existing-controllee';
var iframe;
var registration;
@@ -116,8 +155,6 @@ async_test(function(t) {
return with_iframe(scope);
})
.then(function(frame) {
- // FIXME: When crbug.com/400602 is fixed, assert that controller
- // equals the original worker.
assert_not_equals(
frame.contentWindow.navigator.serviceWorker.controller, null,
'document should have a controller');
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/reject-install-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698