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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/multiple-register.https.html

Issue 2691903005: ServiceWorker: Change base URL for parsing script URL and scope URL (Closed)
Patch Set: Address comments on tests Created 3 years, 9 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.sub.js"></script> 4 <script src="resources/test-helpers.sub.js"></script>
5 <body> 5 <body>
6 <script> 6 <script>
7 var worker_url = 'resources/empty-worker.js'; 7 var worker_url = 'resources/empty-worker.js';
8 8
9 async_test(function(t) { 9 async_test(function(t) {
10 var scope = 'resources/scope/subsequent-register-from-same-window'; 10 var scope = 'resources/scope/subsequent-register-from-same-window';
(...skipping 27 matching lines...) Expand all
38 38
39 service_worker_unregister_and_register(t, worker_url, scope) 39 service_worker_unregister_and_register(t, worker_url, scope)
40 .then(function(r) { 40 .then(function(r) {
41 registration = r; 41 registration = r;
42 return wait_for_state(t, r.installing, 'activated'); 42 return wait_for_state(t, r.installing, 'activated');
43 }) 43 })
44 .then(function() { return with_iframe('resources/404.py'); }) 44 .then(function() { return with_iframe('resources/404.py'); })
45 .then(function(f) { 45 .then(function(f) {
46 frame = f; 46 frame = f;
47 return frame.contentWindow.navigator.serviceWorker.register( 47 return frame.contentWindow.navigator.serviceWorker.register(
48 worker_url, { scope: scope }); 48 'empty-worker.js',
49 { scope: 'scope/subsequent-register-from-different-iframe' });
49 }) 50 })
50 .then(function(new_registration) { 51 .then(function(new_registration) {
51 assert_not_equals( 52 assert_not_equals(
52 registration, new_registration, 53 registration, new_registration,
53 'register should resolve to a different registration'); 54 'register should resolve to a different registration');
54 assert_equals( 55 assert_equals(
55 registration.scope, new_registration.scope, 56 registration.scope, new_registration.scope,
56 'registrations should have the same scope'); 57 'registrations should have the same scope');
57 58
58 assert_equals( 59 assert_equals(
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 'register should resolve to the same registration'); 108 'register should resolve to the same registration');
108 }); 109 });
109 return registrations[0].unregister(); 110 return registrations[0].unregister();
110 }) 111 })
111 .then(function() { t.done(); }) 112 .then(function() { t.done(); })
112 .catch(unreached_rejection(t)); 113 .catch(unreached_rejection(t));
113 }, 'Concurrent registrations resolve to the same registration object'); 114 }, 'Concurrent registrations resolve to the same registration object');
114 115
115 </script> 116 </script>
116 </body> 117 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698