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

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

Issue 362123003: ServiceWorker: unregister's scope argument should be optional (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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/ServiceWorkerContainer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/unregister.html
diff --git a/LayoutTests/http/tests/serviceworker/unregister.html b/LayoutTests/http/tests/serviceworker/unregister.html
index 29e312ed50cfd38efdf6bc20399de44b8aac1f77..7b9f955a33066e188931c5abfaa4feab1f5190ab 100644
--- a/LayoutTests/http/tests/serviceworker/unregister.html
+++ b/LayoutTests/http/tests/serviceworker/unregister.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.js"></script>
<script>
(function() {
var t = async_test('Unregistering out of origin');
@@ -56,4 +57,32 @@
})
);
}());
+
+async_test(function(t) {
+ function contains(string, substring) {
+ return string.indexOf(substring) !== -1;
+ }
+
+ service_worker_unregister_and_register(t, 'resources/simple-intercept-worker.js', '/*')
dominicc (has gone to gerrit) 2014/07/02 02:10:51 The line wrapping in this addition is inconsistent
jsbell 2014/07/02 18:44:22 Done.
+ .then(t.step_func(function() {
dominicc (has gone to gerrit) 2014/07/02 02:10:51 I think we should not indent here. asanka wrote:
jsbell 2014/07/02 18:44:22 Hrm. Putting the '.' on the leading line is fine.
+ return with_iframe('resources/simple.html');
+ }))
+ .then(t.step_func(function(iframe) {
+ assert_true(contains(iframe.contentDocument.body.innerHTML, 'intercepted'),
dominicc (has gone to gerrit) 2014/07/02 02:10:51 Maybe putting that as the whole title would make t
+ 'registered worker should override content');
+ return navigator.serviceWorker.unregister();
+ }))
+ .then(t.step_func(function(value) {
+ assert_equals(value, undefined,
+ 'unregister with default scope should succeed');
+ }))
+ .then(t.step_func(function() {
+ return with_iframe('resources/simple.html');
+ }))
+ .then(t.step_func(function(iframe) {
+ assert_false(contains(iframe.contentDocument.body.innerHTML, 'intercepted'),
+ 'unregistered worker should not override content');
michaeln 2014/07/01 21:14:03 i think this tests may be hitting on much more tha
jsbell 2014/07/02 00:18:50 Makes sense - I'll give that a whirl.
jsbell 2014/07/02 18:44:22 It appears that our [[Unregister]] implementation
michaeln 2014/07/02 19:03:33 hmmm, i certainly had the expectation that any ver
+ t.done();
+ }));
+}, 'Unregistering with default scope');
</script>
« no previous file with comments | « no previous file | Source/modules/serviceworkers/ServiceWorkerContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698