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..401d56ab98c3fc003a3b13a6a6ec99c90f406ec0 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 succesfully. |
nhiroki
2014/08/18 01:33:17
nit: s/succesfully/successfully/
falken
2014/08/18 05:01:06
Done.
|
+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}); |
nhiroki
2014/08/18 01:33:17
"scope:scope"
^^^ can you add a space after t
falken
2014/08/18 05:01:06
Done.
|
+ }) |
+ .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); |
}) |