blob: 8de6fff0f0bd8c3ad4fe514f54ba804655788a23 [file] [log] [blame]
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/geolocation/test_location_manager.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@interface TestLocationManager ()
@end
@implementation TestLocationManager
@synthesize authorizationStatus = _authorizationStatus;
@synthesize locationServicesEnabled = _locationServicesEnabled;
@synthesize started = _started;
@synthesize stopped = _stopped;
@synthesize currentLocation = _currentLocation;
- (id)init {
self = [super init];
if (self) {
[self reset];
}
return self;
}
- (void)setAuthorizationStatus:(CLAuthorizationStatus)authorizationStatus {
if (_authorizationStatus != authorizationStatus) {
_authorizationStatus = authorizationStatus;
[self.delegate locationManagerDidChangeAuthorizationStatus:self];
}
}
- (void)reset {
_authorizationStatus = kCLAuthorizationStatusNotDetermined;
_currentLocation = nil;
_locationServicesEnabled = YES;
_started = NO;
_stopped = NO;
}
#pragma mark - LocationManager overrides
- (void)startUpdatingLocation {
_started = YES;
}
- (void)stopUpdatingLocation {
_stopped = YES;
}
@end