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

Unified Diff: LayoutTests/http/tests/serviceworker/install-phase-event-waituntil.html

Issue 472293002: Don't use ServiceWorkerContainer.unregister in service_worker_unregister_and_register (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments 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/install-phase-event-waituntil.html
diff --git a/LayoutTests/http/tests/serviceworker/install-phase-event-waituntil.html b/LayoutTests/http/tests/serviceworker/install-phase-event-waituntil.html
index fc9258f4558d78799bb7431770b21c438c7acb70..7a504a3ec8a73f529ce789ff83bc193bf9431518 100644
--- a/LayoutTests/http/tests/serviceworker/install-phase-event-waituntil.html
+++ b/LayoutTests/http/tests/serviceworker/install-phase-event-waituntil.html
@@ -4,10 +4,24 @@
<script src="../resources/testharnessreport.js"></script>
<script src="resources/test-helpers.js"></script>
<script>
+// FIXME: Use the test-helpers.js version once it can handle workers that
+// don't install successfully.
+function unregisterAndRegister(test, script, scope) {
+ var empty_worker = 'resources/empty-worker.js';
+ return navigator.serviceWorker.register(empty_worker, {scope: scope})
+ .then(function(registration) {
+ return registration.unregister();
+ })
+ .then(function() {
+ return navigator.serviceWorker.register(script, {scope: scope});
+ })
+ .catch(unreached_rejection(test));
+}
+
function runTest(test, scope, onRegister) {
var script = 'resources/install-phase-event-waituntil.js';
test.step(function() {
- service_worker_unregister_and_register(test, script, scope)
+ unregisterAndRegister(test, script, scope)
.then(function(registration) {
return wait_for_update(test, registration);
})

Powered by Google App Engine
This is Rietveld 408576698