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

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

Issue 674133004: [ServiceWorker] Introduce the directory restriction of ServiceWorker scope [1/3 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/scope-default.html Created 6 years, 2 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
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 var scope = 'scope/unregister-twice'; 7 var scope = 'resources/scope/unregister-twice';
8 var registration; 8 var registration;
9 navigator.serviceWorker.register('resources/empty-worker.js', 9 navigator.serviceWorker.register('resources/empty-worker.js',
10 {scope: scope}) 10 {scope: scope})
11 .then(function(r) { 11 .then(function(r) {
12 registration = r; 12 registration = r;
13 return registration.unregister(); 13 return registration.unregister();
14 }) 14 })
15 .then(function() { 15 .then(function() {
16 return registration.unregister(); 16 return registration.unregister();
17 }) 17 })
18 .then(function(value) { 18 .then(function(value) {
19 assert_equals(value, false, 19 assert_equals(value, false,
20 'unregistering twice should resolve with false'); 20 'unregistering twice should resolve with false');
21 t.done(); 21 t.done();
22 }) 22 })
23 .catch(unreached_rejection(t)); 23 .catch(unreached_rejection(t));
24 }, 'Unregister twice'); 24 }, 'Unregister twice');
25 25
26 async_test(function(t) { 26 async_test(function(t) {
27 var scope = 'scope/successful-unregister/'; 27 var scope = 'resources/scope/successful-unregister/';
28 navigator.serviceWorker.register('resources/empty-worker.js', 28 navigator.serviceWorker.register('resources/empty-worker.js',
29 {scope: scope}) 29 {scope: scope})
30 .then(function(registration) { 30 .then(function(registration) {
31 return registration.unregister(); 31 return registration.unregister();
32 }) 32 })
33 .then(function(value) { 33 .then(function(value) {
34 assert_equals(value, true, 34 assert_equals(value, true,
35 'unregistration should resolve with true'); 35 'unregistration should resolve with true');
36 t.done(); 36 t.done();
37 }) 37 })
38 .catch(unreached_rejection(t)); 38 .catch(unreached_rejection(t));
39 }, 'Register then unregister'); 39 }, 'Register then unregister');
40 </script> 40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698