summaryrefslogtreecommitdiff
path: root/platform/ios/Integration Tests/MGLTestLocationManager.m
blob: f9a5a8650f079c22388b00bb100fc84fd13c2f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#import "MGLTestLocationManager.h"

// Used to supply integration tests with a simulated location manager.
// Methods that are empty are not used within integration tests and are
// therefore unimplemented.

@implementation MGLTestLocationManager

@synthesize delegate;

- (CLAuthorizationStatus)authorizationStatus { return kCLAuthorizationStatusAuthorizedAlways; }

- (void)setHeadingOrientation:(CLDeviceOrientation)headingOrientation { }

- (CLDeviceOrientation)headingOrientation { return 90; }

- (void)requestAlwaysAuthorization { }

- (void)requestWhenInUseAuthorization { }

- (void)startUpdatingHeading { }

// Simulate one location update
- (void)startUpdatingLocation
{
    if ([self.delegate respondsToSelector:@selector(locationManager:didUpdateLocations:)]) {
        CLLocation *location = [[CLLocation alloc] initWithLatitude:37.787357 longitude:-122.39899];
        [self.delegate locationManager:self didUpdateLocations:@[location]];
    }
}

- (void)stopUpdatingHeading { }

- (void)stopUpdatingLocation { }

- (void)dismissHeadingCalibrationDisplay { }

- (void)dealloc { self.delegate = nil; }

- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { }

- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager { return NO; }

@end