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

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

Issue 550093002: SWRegistration::unregister returns false when the registration is already unregistered. (3/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@unregister_resolve_correctly
Patch Set: 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: Uncomment after applied the first patch. 31 assert_equals(value, false,
32 // https://codereview.chromium.org/554573002 32 'unregistering twice should resolve with false');
33 // See: https://crbug.com/390894#c16
34 // assert_equals(value, false,
35 // 'unregistering twice should resolve with false');
36 t.done(); 33 t.done();
37 }) 34 })
38 .catch(unreached_rejection(t)); 35 .catch(unreached_rejection(t));
39 }, 'Unregister twice'); 36 }, 'Unregister twice');
40 37
41 async_test(function(t) { 38 async_test(function(t) {
42 var scope = 'scope/successful-unregister/'; 39 var scope = 'scope/successful-unregister/';
43 navigator.serviceWorker.register('resources/empty-worker.js', 40 navigator.serviceWorker.register('resources/empty-worker.js',
44 {scope: scope}) 41 {scope: scope})
45 .then(function(registration) { 42 .then(function(registration) {
(...skipping 28 matching lines...) Expand all
74 }) 71 })
75 .then(function(state) { 72 .then(function(state) {
76 assert_equals(state, 'redundant', 73 assert_equals(state, 'redundant',
77 'service worker registered with default scope ' + 74 'service worker registered with default scope ' +
78 'should be unregistered'); 75 'should be unregistered');
79 t.done(); 76 t.done();
80 }) 77 })
81 .catch(unreached_rejection(t)); 78 .catch(unreached_rejection(t));
82 }, 'ServiceWorkerContainer.unregister() with default scope'); 79 }, 'ServiceWorkerContainer.unregister() with default scope');
83 </script> 80 </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