Chromium Code Reviews| Index: LayoutTests/http/tests/serviceworker/claim-not-using-registration.html |
| diff --git a/LayoutTests/http/tests/serviceworker/claim-not-using-registration.html b/LayoutTests/http/tests/serviceworker/claim-not-using-registration.html |
| index b94e70136ba3d3308c4274b90e0b41c92f04627c..b8050acad7a7bf4f230d8bd3711bba4336448ad2 100644 |
| --- a/LayoutTests/http/tests/serviceworker/claim-not-using-registration.html |
| +++ b/LayoutTests/http/tests/serviceworker/claim-not-using-registration.html |
| @@ -4,10 +4,11 @@ |
| <script src="../resources/testharness-helpers.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script src="resources/test-helpers.js"></script> |
| +<script src="../fetch/resources/fetch-test-helpers.js"></script> |
| <body> |
| <script> |
| -promise_test(function(t) { |
| +sequential_promise_test(function(t) { |
|
falken
2015/06/05 01:36:39
It's not clear to me why sequential_promise_test i
jungkees
2015/06/05 02:08:13
While I'd tried quite a few different fixes, I lef
|
| var init_scope = 'resources/blank.html?not-using-init'; |
| var claim_scope = 'resources/blank.html?not-using'; |
| var init_worker_url = 'resources/empty.js'; |
| @@ -70,16 +71,16 @@ promise_test(function(t) { |
| return claim_registration.unregister(); |
| }) |
| .then(function() { |
| - return service_worker_unregister_and_done(t, init_scope); |
| + return service_worker_unregister(t, init_scope); |
| }); |
| }, 'Test claim client which is not using registration'); |
| -promise_test(function(t) { |
| +sequential_promise_test(function(t) { |
| var scope = 'resources/blank.html?longer-matched'; |
| var claim_scope = 'resources/blank.html?longer'; |
| var claim_worker_url = 'resources/claim-worker.js'; |
| - var installing_worker_url = 'resources/wait-forever-in-install-worker.js'; |
| - var frame, claim_worker; |
| + var installing_worker_url = 'resources/empty-worker.js'; |
|
falken
2015/06/05 01:36:39
Xiang: Do you remember why you used wait-forever-i
xiang
2015/06/08 02:55:29
I intended to test claim() failure when there's a
falken
2015/06/08 08:04:31
Thanks for the comment Xiang. So it sounds OK to p
|
| + var frame, claim_worker, longer_matched_registration; |
| return with_iframe(scope) |
| .then(function(f) { |
| frame = f; |
| @@ -94,7 +95,8 @@ promise_test(function(t) { |
| return navigator.serviceWorker.register( |
| installing_worker_url, {scope: scope}); |
| }) |
| - .then(function() { |
| + .then(function(registration) { |
| + longer_matched_registration = registration; |
| var channel = new MessageChannel(); |
| var saw_message = new Promise(function(resolve) { |
| channel.port1.onmessage = t.step_func(function(e) { |
| @@ -112,9 +114,14 @@ promise_test(function(t) { |
| 'Frame should not be claimed when a longer-matched ' + |
| 'registration exists'); |
| frame.remove(); |
| - return service_worker_unregister_and_done(t, claim_scope); |
| + return service_worker_unregister(t, claim_scope); |
| + }) |
| + .then(function() { |
| + return longer_matched_registration.unregister(); |
| }); |
| }, 'Test claim client when there\'s a longer-matched registration not ' + |
| 'already used by the page'); |
| +sequential_promise_test_done(); |
|
falken
2015/06/05 01:36:39
Nit: Easier to read with a newline before this.
jungkees
2015/06/05 02:08:13
Resolved by removing this call.
|
| +done(); |
| </script> |