1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "ios/chrome/browser/geolocation/test_location_manager.h"
7 #include "base/mac/scoped_nsobject.h"
9 @interface TestLocationManager () {
10 CLAuthorizationStatus _authorizationStatus;
11 base::scoped_nsobject<CLLocation> _currentLocation;
12 BOOL _locationServicesEnabled;
19 @implementation TestLocationManager
21 @synthesize authorizationStatus = _authorizationStatus;
22 @synthesize locationServicesEnabled = _locationServicesEnabled;
23 @synthesize started = _started;
24 @synthesize stopped = _stopped;
34 - (void)setAuthorizationStatus:(CLAuthorizationStatus)authorizationStatus {
35 if (_authorizationStatus != authorizationStatus) {
36 _authorizationStatus = authorizationStatus;
37 [self.delegate locationManagerDidChangeAuthorizationStatus:self];
41 - (CLLocation*)currentLocation {
42 return _currentLocation;
45 - (void)setCurrentLocation:(CLLocation*)currentLocation {
46 _currentLocation.reset([currentLocation retain]);
50 _authorizationStatus = kCLAuthorizationStatusNotDetermined;
51 _currentLocation.reset();
52 _locationServicesEnabled = YES;
57 #pragma mark - LocationManager overrides
59 - (void)startUpdatingLocation {
63 - (void)stopUpdatingLocation {