diff options
author | Adam Hunter <adam@mapbox.com> | 2015-09-15 11:33:01 -0700 |
---|---|---|
committer | Adam Hunter <adam@mapbox.com> | 2015-09-15 17:45:22 -0700 |
commit | 620e554f677d05edd0a588b56f343435516c05a8 (patch) | |
tree | f54445c1c629e8ab7ef213c04f676b464040d2a5 /test/ios | |
parent | c9b14125d826d2f9990f1366d13823b8714ee4d8 (diff) | |
download | qtlocation-mapboxgl-620e554f677d05edd0a588b56f343435516c05a8.tar.gz |
Fixes the test for setting center canceling animations. A good submit to look at for writing asynchronous tests.
Diffstat (limited to 'test/ios')
-rw-r--r-- | test/ios/MapViewTests.m | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ios/MapViewTests.m b/test/ios/MapViewTests.m index 516ff1df84..d0913670c5 100644 --- a/test/ios/MapViewTests.m +++ b/test/ios/MapViewTests.m @@ -221,6 +221,8 @@ } - (void)testSetCenterCancelsTransitions { + XCTestExpectation *cameraIsInDCExpectation = [self expectationWithDescription:@"camera reset to DC"]; + CLLocationCoordinate2D dc = CLLocationCoordinate2DMake(38.894368, -77.036487); CLLocationCoordinate2D dc_west = CLLocationCoordinate2DMake(38.894368, -77.076487); [tester.mapView setCenterCoordinate:dc animated:NO]; @@ -237,7 +239,12 @@ tester.mapView.centerCoordinate.longitude, 0.0005, @"setting center coordinate should cancel transitions"); + [cameraIsInDCExpectation fulfill]; }); + + [self waitForExpectationsWithTimeout:1.0 handler:^(NSError *error) { + ; + }]; } - (void)testPanDisabled { |