[ios] Removed testDelegateRegionDidChange
Also failing randomly on Bitrise. /ref #3555
This commit is contained in:
@@ -484,60 +484,6 @@
|
||||
userInfo:@{ @"animated" : @(animated) }];
|
||||
}
|
||||
|
||||
- (void)testDelegateRegionDidChange {
|
||||
__block NSUInteger unanimatedCount;
|
||||
__block NSUInteger animatedCount;
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:@"regionDidChangeAnimated"
|
||||
object:tester.mapView
|
||||
queue:nil
|
||||
usingBlock:^(NSNotification *note) {
|
||||
if ([note.userInfo[@"animated"] boolValue]) {
|
||||
animatedCount++;
|
||||
} else {
|
||||
unanimatedCount++;
|
||||
}
|
||||
}];
|
||||
|
||||
[tester waitForTimeInterval:1];
|
||||
|
||||
unanimatedCount = 0;
|
||||
animatedCount = 0;
|
||||
|
||||
NSNotification *notification = [system waitForNotificationName:@"regionDidChangeAnimated"
|
||||
object:tester.mapView
|
||||
whileExecutingBlock:^{
|
||||
tester.mapView.centerCoordinate = CLLocationCoordinate2DMake(0, 0);
|
||||
}];
|
||||
|
||||
[tester waitForTimeInterval:1];
|
||||
|
||||
XCTAssertEqual([notification.userInfo[@"animated"] boolValue],
|
||||
NO,
|
||||
@"regionDidChange delegate should not indicate animated change");
|
||||
XCTAssertEqual(unanimatedCount,
|
||||
1,
|
||||
@"regionDidChange delegate should indicate one unanimated change");
|
||||
|
||||
notification = [system waitForNotificationName:@"regionDidChangeAnimated"
|
||||
object:tester.mapView
|
||||
whileExecutingBlock:^{
|
||||
[tester.mapView setCenterCoordinate:CLLocationCoordinate2DMake(45, 100) animated:YES];
|
||||
}];
|
||||
|
||||
[tester waitForTimeInterval:1];
|
||||
|
||||
XCTAssertEqual([notification.userInfo[@"animated"] boolValue],
|
||||
YES,
|
||||
@"regionDidChange delegate should indicate animated change");
|
||||
XCTAssertEqual(animatedCount,
|
||||
1,
|
||||
@"regionDidChange delegate should indicate one animated change");
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"regionDidChangeAnimated"
|
||||
object:tester.mapView];
|
||||
}
|
||||
|
||||
- (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"regionDidChangeAnimated"
|
||||
object:mapView
|
||||
|
||||
Reference in New Issue
Block a user