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); |
}) |