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

Unified Diff: LayoutTests/http/tests/serviceworker/registration.html

Issue 340763002: Fix serviceworker default registration scope. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | Source/modules/serviceworkers/RegistrationOptionList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/registration.html
diff --git a/LayoutTests/http/tests/serviceworker/registration.html b/LayoutTests/http/tests/serviceworker/registration.html
index 60bafe9fdc95430b71b0c9dd74d5af79f7075335..149e96cf01ceae19428d5d2b2d113c642687b00b 100644
--- a/LayoutTests/http/tests/serviceworker/registration.html
+++ b/LayoutTests/http/tests/serviceworker/registration.html
@@ -44,6 +44,24 @@
}());
(function() {
+ var t = async_test('Registering default scope');
jsbell 2014/06/18 17:57:03 There's a test for the default scope in servicewor
xiang 2014/06/19 04:57:45 The default scope tests in serviceworkerglobalscop
+ t.step(function() {
+ navigator.serviceWorker.register('resources/registration-worker.js'
+ ).then(
+ t.step_func(function(worker) {
+ var default_scope = '/*';
+ assert_equals(worker.scope, location.origin + default_scope,
+ 'Registration scope should default to "/*".');
+ service_worker_unregister_and_done(t, default_scope);
+ }),
+ t.step_func(function(reason) {
+ assert_unreached('Registration should succeed, but failed: ' + reason.name);
+ })
+ );
+ });
+}());
+
+(function() {
var t = async_test('Registering script outside domain');
t.step(function() {
navigator.serviceWorker.register(
« no previous file with comments | « no previous file | Source/modules/serviceworkers/RegistrationOptionList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698