diff options
Diffstat (limited to 'platform/ios/Integration Tests')
-rw-r--r-- | platform/ios/Integration Tests/MGLMapViewIntegrationTest.h | 6 | ||||
-rw-r--r-- | platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m | 20 |
2 files changed, 17 insertions, 9 deletions
diff --git a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h index 3ceec8f04a..1b680f2b71 100644 --- a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h +++ b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h @@ -10,6 +10,12 @@ #define MGLTestAssertEqualWithAccuracy(myself, expression1, expression2, accuracy, ...) \ _XCTPrimitiveAssertEqualWithAccuracy(myself, expression1, @#expression1, expression2, @#expression2, accuracy, @#accuracy, __VA_ARGS__) +#define MGLTestAssertNil(myself, expression, ...) \ + _XCTPrimitiveAssertNil(myself, expression, @#expression, __VA_ARGS__) + +#define MGLTestAssertNotNil(myself, expression, ...) \ + _XCTPrimitiveAssertNotNil(myself, expression, @#expression, __VA_ARGS__) + @interface MGLMapViewIntegrationTest : XCTestCase <MGLMapViewDelegate> @property (nonatomic) MGLMapView *mapView; diff --git a/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m b/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m index 6a698121c9..f31f9cf787 100644 --- a/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m +++ b/platform/ios/Integration Tests/Snapshotter Tests/MGLMapSnapshotterTest.m @@ -104,11 +104,12 @@ NSString* validAccessToken() { [self waitForExpectations:@[expectation] timeout:2.0]; } -- (void)testSnapshotterFromBackgroundQueue { +- (void)testMultipleSnapshottersFromBackgroundQueue { if (!validAccessToken()) { return; } + // Crashes with only 1 snapshot CGSize size = self.mapView.bounds.size; CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(30.0, 30.0); @@ -144,9 +145,10 @@ NSString* validAccessToken() { MGLTestAssertNotNil(strongself, snapshot.image); MGLTestAssertNil(strongself, error, @"Snapshot should not error with: %@", error); - // Change this to XCTAttachmentLifetimeKeepAlways to be able to look at the snapshots after running + // Change this back to XCTAttachmentLifetimeDeleteOnSuccess when we're sure this + // test is passing. XCTAttachment *attachment = [XCTAttachment attachmentWithImage:snapshot.image]; - attachment.lifetime = XCTAttachmentLifetimeDeleteOnSuccess; + attachment.lifetime = XCTAttachmentLifetimeKeepAlways; [strongself addAttachment:attachment]; dispatch_group_leave(group); @@ -172,11 +174,10 @@ NSString* validAccessToken() { }); }); - [self waitForExpectations:@[expectation] timeout:60.0]; + [self waitForExpectations:@[expectation] timeout:10.0]; } -- (void)testMultipleSnapshottersPENDING { - MGL_CHECK_IF_PENDING_TEST_SHOULD_RUN(); +- (void)testMultipleSnapshotters { if (!validAccessToken()) { return; } @@ -216,9 +217,10 @@ NSString* validAccessToken() { MGLTestAssertNotNil(strongself, snapshot.image); MGLTestAssertNil(strongself, error, @"Snapshot should not error with: %@", error); - // Change this to XCTAttachmentLifetimeKeepAlways to be able to look at the snapshots after running + // Change this back to XCTAttachmentLifetimeDeleteOnSuccess when we're sure this + // test is passing. XCTAttachment *attachment = [XCTAttachment attachmentWithImage:snapshot.image]; - attachment.lifetime = XCTAttachmentLifetimeDeleteOnSuccess; + attachment.lifetime = XCTAttachmentLifetimeKeepAlways; [strongself addAttachment:attachment]; // Dealloc the snapshotter (by having this line in the block, we @@ -231,7 +233,7 @@ NSString* validAccessToken() { }]; } // end for loop - [self waitForExpectations:@[expectation] timeout:60.0]; + [self waitForExpectations:@[expectation] timeout:20.0]; } @end |