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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-controller.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
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-controller.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-controller.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-controller.html
deleted file mode 100644
index fc05f7763f5914fe733b6a04dead432d58a374ff..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/unregister-controller.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE html>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="resources/test-helpers.js"></script>
-<script>
-var worker_url = 'resources/simple-intercept-worker.js';
-
-async_test(function(t) {
- var scope =
- 'resources/unregister-controller-page.html?load-before-unregister';
- var frame_window;
- var controller;
- var registration;
-
- 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(frame) {
- frame_window = frame.contentWindow;
- controller = frame_window.navigator.serviceWorker.controller;
- assert_true(controller instanceof frame_window.ServiceWorker,
- 'document should load with a controller');
- return registration.unregister();
- })
- .then(function() {
- assert_equals(frame_window.navigator.serviceWorker.controller,
- controller,
- 'unregistration should not modify controller');
- return frame_window.fetch_url('simple.txt');
- })
- .then(function(response) {
- assert_equals(response, 'intercepted by service worker',
- 'controller should intercept requests');
- t.done();
- })
- .catch(unreached_rejection(t));
- }, 'Unregister does not affect existing controller');
-
-async_test(function(t) {
- var scope =
- 'resources/unregister-controller-page.html?load-after-unregister';
- var registration;
-
- 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 registration.unregister();
- })
- .then(function() {
- return with_iframe(scope);
- })
- .then(function(frame) {
- var frame_window = frame.contentWindow;
- assert_equals(frame_window.navigator.serviceWorker.controller, null,
- 'document should not have a controller');
- return frame_window.fetch_url('simple.txt');
- })
- .then(function(response) {
- assert_equals(response, 'a simple text file\n',
- 'requests should not be intercepted');
- t.done();
- })
- .catch(unreached_rejection(t));
- }, 'Unregister prevents control of subsequent navigations');
-
-async_test(function(t) {
- var scope =
- 'resources/scope/no-new-controllee-even-if-registration-is-still-used';
- var registration;
-
- 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(frame) {
- return registration.unregister();
- })
- .then(function() {
- return with_iframe(scope);
- })
- .then(function(frame) {
- assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
- null,
- 'document should not have a controller');
- t.done();
- })
- .catch(unreached_rejection(t));
- }, 'Unregister prevents new controllee even if registration is still in use');
-</script>

Powered by Google App Engine
This is Rietveld 408576698