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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/modules/serviceworkers/ServiceWorkerContainer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="resources/test-helpers.js"></script>
4 <script> 5 <script>
5 (function() { 6 (function() {
6 var t = async_test('Unregistering out of origin'); 7 var t = async_test('Unregistering out of origin');
7 navigator.serviceWorker.unregister('http://example.com/*').then( 8 navigator.serviceWorker.unregister('http://example.com/*').then(
8 t.step_func(function() { 9 t.step_func(function() {
9 assert_unreached('unregistering out of origin should fail'); 10 assert_unreached('unregistering out of origin should fail');
10 }), 11 }),
11 t.step_func(function(reason) { 12 t.step_func(function(reason) {
12 assert_equals(reason.name, 'SecurityError', 13 assert_equals(reason.name, 'SecurityError',
13 'unregistering out of origins should fail'); 14 'unregistering out of origins should fail');
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 assert_equals(value, undefined, 50 assert_equals(value, undefined,
50 'successful unregistration should succeed ' + 51 'successful unregistration should succeed ' +
51 'with no value'); 52 'with no value');
52 t.done(); 53 t.done();
53 }, 54 },
54 t.step_func(function(reason) { 55 t.step_func(function(reason) {
55 assert_unreached('unregistration should succeed.'); 56 assert_unreached('unregistration should succeed.');
56 }) 57 })
57 ); 58 );
58 }()); 59 }());
60
61 async_test(function(t) {
62 function contains(string, substring) {
63 return string.indexOf(substring) !== -1;
64 }
65
66 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.
67 .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.
68 return with_iframe('resources/simple.html');
69 }))
70 .then(t.step_func(function(iframe) {
71 assert_true(contains(iframe.contentDocument.body.innerHTML, 'interce pted'),
dominicc (has gone to gerrit) 2014/07/02 02:10:51 Maybe putting that as the whole title would make t
72 'registered worker should override content');
73 return navigator.serviceWorker.unregister();
74 }))
75 .then(t.step_func(function(value) {
76 assert_equals(value, undefined,
77 'unregister with default scope should succeed');
78 }))
79 .then(t.step_func(function() {
80 return with_iframe('resources/simple.html');
81 }))
82 .then(t.step_func(function(iframe) {
83 assert_false(contains(iframe.contentDocument.body.innerHTML, 'interc epted'),
84 '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
85 t.done();
86 }));
87 }, 'Unregistering with default scope');
59 </script> 88 </script>
OLDNEW
« 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