[ios] Removed testDelegateRegionDidChange

Also failing randomly on Bitrise.

/ref #3555
This commit is contained in:
Minh Nguyễn
2016-01-21 14:09:36 -08:00
parent 698eb674a7
commit 874ff24d8c

View File

@@ -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