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

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

Powered by Google App Engine
This is Rietveld 408576698