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

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

Issue 443883003: Test for registering the same SW in different frames (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: missing semicolon 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4e6841925a75b8c717aec21922fc2bb737d6b245..34793a521b1b56bc0735c37e26915f7b361cf00a 100644
--- a/LayoutTests/http/tests/serviceworker/multiple-register.html
+++ b/LayoutTests/http/tests/serviceworker/multiple-register.html
@@ -6,7 +6,7 @@
var worker_url = 'resources/empty-worker.js';
async_test(function(t) {
- var scope = 'subsequent-register'
+ var scope = 'scope/subsequent-register';
var worker;
service_worker_unregister_and_register(t, worker_url, scope)
@@ -28,7 +28,7 @@ async_test(function(t) {
}, 'Subsequent registrations resolve to the same worker');
async_test(function(t) {
- var scope = 'concurrent-register'
+ var scope = 'scope/concurrent-register';
var worker;
navigator.serviceWorker.unregister(scope)
@@ -49,4 +49,24 @@ async_test(function(t) {
})
.catch(unreached_rejection(t));
}, 'Concurrent registrations resolve to the same worker');
+
+async_test(function(t) {
+ var scope = 'scope/multiple-frames';
+ var worker;
+
+ service_worker_unregister_and_register(t, worker_url, scope)
+ .then(function(registered_worker) {
+ worker = registered_worker;
+ return with_iframe('nothing-here.html');
+ })
+ .then(function(frame) {
+ return frame.contentWindow.navigator.serviceWorker.register(
+ worker_url, { scope: scope });
+ })
+ .then(function(registered_worker) {
+ assert_not_equals(registered_worker, worker);
+ service_worker_unregister_and_done(t, scope);
+ })
+ .catch(unreached_rejection(t));
+ }, 'Registrations in separate frames resolve to different workers');
</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698