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

Side by Side Diff: LayoutTests/http/tests/serviceworker/unregister.html

Issue 549093002: SWRegistration::unregister returns false when the registration is already unregistered. (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix a message of assertion Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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 src="resources/test-helpers.js"></script>
5 <script> 5 <script>
6 async_test(function(t) { 6 async_test(function(t) {
7 navigator.serviceWorker.unregister('http://example.com/') 7 navigator.serviceWorker.unregister('http://example.com/')
8 .then(function() { 8 .then(function() {
9 assert_unreached('unregistering out of origin should fail'); 9 assert_unreached('unregistering out of origin should fail');
10 }, function(reason) { 10 }, function(reason) {
(...skipping 10 matching lines...) Expand all
21 navigator.serviceWorker.register('resources/empty-worker.js', 21 navigator.serviceWorker.register('resources/empty-worker.js',
22 {scope: scope}) 22 {scope: scope})
23 .then(function(r) { 23 .then(function(r) {
24 registration = r; 24 registration = r;
25 return registration.unregister(); 25 return registration.unregister();
26 }) 26 })
27 .then(function() { 27 .then(function() {
28 return registration.unregister(); 28 return registration.unregister();
29 }) 29 })
30 .then(function(value) { 30 .then(function(value) {
31 // FIXME: This value must be false in spec, 31 // FIXME: Uncomment after applied the first patch.
32 // but this is not supported now. 32 // https://codereview.chromium.org/554573002
33 // See: https://crbug.com/390894#c16 33 // See: https://crbug.com/390894#c16
34 assert_equals(value, true, 34 // assert_equals(value, false,
35 'unregistering twice should resolve with true'); 35 // 'unregistering twice should resolve with false');
36 t.done(); 36 t.done();
37 }) 37 })
38 .catch(unreached_rejection(t)); 38 .catch(unreached_rejection(t));
39 }, 'Unregister twice'); 39 }, 'Unregister twice');
40 40
41 async_test(function(t) { 41 async_test(function(t) {
42 var scope = 'scope/successful-unregister/'; 42 var scope = 'scope/successful-unregister/';
43 navigator.serviceWorker.register('resources/empty-worker.js', 43 navigator.serviceWorker.register('resources/empty-worker.js',
44 {scope: scope}) 44 {scope: scope})
45 .then(function(registration) { 45 .then(function(registration) {
(...skipping 28 matching lines...) Expand all
74 }) 74 })
75 .then(function(state) { 75 .then(function(state) {
76 assert_equals(state, 'redundant', 76 assert_equals(state, 'redundant',
77 'service worker registered with default scope ' + 77 'service worker registered with default scope ' +
78 'should be unregistered'); 78 'should be unregistered');
79 t.done(); 79 t.done();
80 }) 80 })
81 .catch(unreached_rejection(t)); 81 .catch(unreached_rejection(t));
82 }, 'ServiceWorkerContainer.unregister() with default scope'); 82 }, 'ServiceWorkerContainer.unregister() with default scope');
83 </script> 83 </script>
OLDNEW
« 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