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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/test-helpers.js

Issue 512703002: Revert of Service Worker: Add tests for same-scope new script registration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/resources/test-helpers.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
index f72f60c71e4f53ebbe2332fdc96891d31ada3cf6..6bed2f1460ccb43a2f7b11e2e5749747b113cfbe 100644
--- a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
+++ b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
@@ -66,28 +66,18 @@
}
function wait_for_update(test, registration) {
- if (!registration || registration.unregister == undefined) {
- return Promise.reject(new Error(
- 'wait_for_update must be passed a ServiceWorkerRegistration'));
- }
-
- return new Promise(test.step_func(function(resolve) {
- registration.addEventListener('updatefound', test.step_func(function() {
- resolve(registration.installing);
- }));
+ return new Promise(test.step_func(function(resolve) {
+ registration.addEventListener('updatefound', test.step_func(function() {
+ resolve(registration.installing);
+ }));
}));
}
function wait_for_state(test, worker, state) {
- if (!worker || worker.state == undefined) {
- return Promise.reject(new Error(
- 'wait_for_state must be passed a ServiceWorker'));
- }
-
- return new Promise(test.step_func(function(resolve) {
- worker.addEventListener('statechange', test.step_func(function() {
- if (worker.state === state)
- resolve(state);
+ return new Promise(test.step_func(function(resolve) {
+ worker.addEventListener('statechange', test.step_func(function() {
+ if (worker.state === state)
+ resolve(state);
}));
}));
}

Powered by Google App Engine
This is Rietveld 408576698