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

Unified Diff: LayoutTests/http/tests/serviceworker/multiple-register.html

Issue 1311103002: ServiceWorker: Make APIs that return ServiceWorkerRegistration coin a new JS object (3/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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/multiple-register.html
diff --git a/LayoutTests/http/tests/serviceworker/multiple-register.html b/LayoutTests/http/tests/serviceworker/multiple-register.html
index aa213a104270ae75fe610eab19b8fa278e5c8c9e..da2c5031ffd61489a6c64612892b6b110db07058 100644
--- a/LayoutTests/http/tests/serviceworker/multiple-register.html
+++ b/LayoutTests/http/tests/serviceworker/multiple-register.html
@@ -18,8 +18,10 @@ async_test(function(t) {
return navigator.serviceWorker.register(worker_url, { scope: scope });
})
.then(function(new_registration) {
- assert_equals(new_registration, registration,
- 'register should resolve to the same registration');
+ assert_registration_equals(new_registration, registration);
+ assert_not_equals(
+ new_registration, registration,
+ 'register should resolve to the new registration object');
falken 2015/08/25 03:28:29 (sorry for grammar nit) "the new" -> "a new" "the
nhiroki 2015/08/25 06:28:07 Thanks! Grammar correction is really helpful :)
assert_equals(new_registration.active, registration.active,
'register should resolve to the same worker');
assert_equals(new_registration.active.state, 'activated',
@@ -28,7 +30,8 @@ async_test(function(t) {
})
.then(function() { t.done(); })
.catch(unreached_rejection(t));
-}, 'Subsequent registrations resolve to the same registration object');
+}, 'Subsequent registrations resolve to the different registration object ' +
+ 'but they refer to the same registration and workers');
async_test(function(t) {
var scope = 'resources/scope/subsequent-register-from-different-iframe';
@@ -101,14 +104,19 @@ async_test(function(t) {
return Promise.all(promises);
})
.then(function(registrations) {
+ for (var i = 1; i < 10; ++i) {
falken 2015/08/25 03:28:29 can you make 10 a named variable?
nhiroki 2015/08/25 06:28:07 Done.
+ assert_registration_equals(registrations[i], registrations[0]);
+ assert_not_equals(
+ registrations[i], registrations[0],
+ 'register should resolve to the new registration object');
+ }
registrations.forEach(function(registration) {
- assert_equals(registration, registrations[0],
- 'register should resolve to the same registration');
});
return registrations[0].unregister();
})
.then(function() { t.done(); })
.catch(unreached_rejection(t));
-}, 'Concurrent registrations resolve to the same registration object');
+}, 'Concurrent registrations resolve to the different registration object ' +
+ 'but they refer to the same registration and workers');
</script>

Powered by Google App Engine
This is Rietveld 408576698