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

Unified Diff: LayoutTests/http/tests/local/serviceworker/resources/fetch-request-body-file-iframe.html

Issue 776373003: ServiceWorker cleanup: remove wait_for_update() in favor of r.installing in most tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 | LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/scope.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/local/serviceworker/resources/fetch-request-body-file-iframe.html
diff --git a/LayoutTests/http/tests/local/serviceworker/resources/fetch-request-body-file-iframe.html b/LayoutTests/http/tests/local/serviceworker/resources/fetch-request-body-file-iframe.html
index fa98d0a3d15ae12a492aa474221be691e5b1bc0b..ae3d5f1f9d030fa38f02983e373200653ce09821 100644
--- a/LayoutTests/http/tests/local/serviceworker/resources/fetch-request-body-file-iframe.html
+++ b/LayoutTests/http/tests/local/serviceworker/resources/fetch-request-body-file-iframe.html
@@ -8,16 +8,9 @@ window.addEventListener('message', function(evt) {
start();
}, false);
-function wait_for_update(registration) {
- return new Promise(function(resolve) {
- registration.addEventListener('updatefound', function() {
- resolve(registration.installing);
- });
- });
-}
-
-function wait_for_activated(worker) {
+function wait_for_activated(registration) {
return new Promise(function(resolve) {
+ var worker = registration.installing;
worker.addEventListener('statechange', function() {
if (worker.state == 'activated') {
resolve(worker);
@@ -35,7 +28,6 @@ function start() {
.then(function() {
return navigator.serviceWorker.register(script, {scope: scope});
})
- .then(wait_for_update)
.then(wait_for_activated)
.then(function(worker) {
port.postMessage({msg: 'registered'});
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/scope.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698