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

Side by Side Diff: LayoutTests/http/tests/geofencing/resources/worker.js

Issue 401713005: Move all geofencing code into its own module separate from geolocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
OLDNEW
(Empty)
1 self.onmessage = function(e) {
2 var message = e.data;
3 if ('port' in message) {
4 port = message.port;
5 nextTest(port);
6 }
7 };
8
9 var tests = [
10 function() {
11 return navigator.geofencing.registerRegion(new CircularRegion({latitude: 37.421999, longitude: -122.084015}));
12 },
13 function() {
14 return navigator.geofencing.unregisterRegion("");
15 },
16 function() {
17 return navigator.geofencing.getRegisteredRegions();
18 }
19 ];
20
21 function nextTest(port) {
22 if (tests.length == 0) {
23 port.postMessage('quit');
24 self.close();
25 return;
26 }
27 var test = tests.shift();
28 try {
29 test()
30 .then(function() {
31 port.postMessage('Resolved');
32 nextTest(port);
33 }).catch(function(e) {
34 port.postMessage('Rejected: ' + e.message);
35 nextTest(port);
36 });
37 } catch (e) {
38 port.postMessage('Exception: ' + e);
39 nextTest(port);
40 }
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698