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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/frame-for-getregistrations.html

Issue 1210883002: Service Worker: Fix getRegistrations.html layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Created 5 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
« no previous file with comments | « LayoutTests/http/tests/serviceworker/getregistrations.html ('k') | 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 <title>Service Worker: frame for getRegistrations()</title> 2 <title>Service Worker: frame for getRegistrations()</title>
3 <script> 3 <script>
4 var scope = 'scope-for-getregistrations'; 4 var scope = 'scope-for-getregistrations';
5 var script = 'empty-worker.js'; 5 var script = 'empty-worker.js';
6 var registration; 6 var registration;
7 7 var port;
8 navigator.serviceWorker.register(script, { scope: scope })
9 .then(function(r) { registration = r; });
10 8
11 self.onmessage = function(e) { 9 self.onmessage = function(e) {
12 if (e.data == 'unregister') { 10 if (e.data == 'register') {
13 registration.unregister() 11 port = e.ports[0];
14 .then(function() { 12 port.onmessage = function(e) {
15 e.ports[0].postMessage('unregistered'); 13 if (e.data == 'unregister') {
16 }); 14 registration.unregister()
15 .then(function() {
16 port.postMessage('unregistered');
17 });
18 }
19 };
17 } 20 }
21
22 // Frame registers a registration scoped
23 // http://localhost:8000/serviceworker/resources/scope-for-getregistrations
24 navigator.serviceWorker.register(script, { scope: scope })
25 .then(function(r) {
26 registration = r;
27 e.ports[0].postMessage('registered');
28 });
18 }; 29 };
19 </script> 30 </script>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/getregistrations.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698