diff --git a/test/ios/MapViewTests.m b/test/ios/MapViewTests.m index 4813f57d040..7dff155aaae 100644 --- a/test/ios/MapViewTests.m +++ b/test/ios/MapViewTests.m @@ -48,15 +48,6 @@ - (void)beforeEach { tester.mapView.delegate = self; } -- (void)approveLocationIfNeeded { - if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) { - [UIAutomationHelper acknowledgeSystemAlert]; - [tester waitForTimeInterval:1]; - } - XCTAssertTrue([CLLocationManager locationServicesEnabled]); - XCTAssertEqual([CLLocationManager authorizationStatus], kCLAuthorizationStatusAuthorizedAlways); -} - - (void)testDirectionSet { [self waitForNotificationThatRegionDidChangeAnimatedWhileExecutingBlock:^{ [tester.mapView setDirection:270 animated:YES]; @@ -544,42 +535,4 @@ - (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated { userInfo:@{ @"animated" : @(animated) }]; } -- (void)testDelegatesStartStopLocatingUser { - NSNotification *notification = [system waitForNotificationName:@"mapViewWillStartLocatingUser" - object:tester.mapView - whileExecutingBlock:^{ - tester.mapView.showsUserLocation = YES; - [self approveLocationIfNeeded]; - }]; - - XCTAssertEqualObjects(notification.name, - @"mapViewWillStartLocatingUser", - @"mapViewWillStartLocatingUser delegate should receive message"); - XCTAssertNotNil([tester.mapView valueForKeyPath:@"locationManager"], - "map view location manager should not be nil"); - - notification = [system waitForNotificationName:@"mapViewDidStopLocatingUser" - object:tester.mapView - whileExecutingBlock:^{ - tester.mapView.showsUserLocation = NO; - }]; - - XCTAssertEqualObjects(notification.name, - @"mapViewDidStopLocatingUser", - @"mapViewDidStopLocatingUser delegate should receive message"); - XCTAssertEqual(tester.mapView.userTrackingMode, - MGLUserTrackingModeNone, - @"user tracking mode should be none"); - XCTAssertNil([tester.mapView valueForKeyPath:@"locationManager"], - "map view location manager should be nil"); -} - -- (void)mapViewWillStartLocatingUser:(MGLMapView *)mapView { - [[NSNotificationCenter defaultCenter] postNotificationName:@"mapViewWillStartLocatingUser" object:mapView]; -} - -- (void)mapViewDidStopLocatingUser:(MGLMapView *)mapView { - [[NSNotificationCenter defaultCenter] postNotificationName:@"mapViewDidStopLocatingUser" object:mapView]; -} - @end