summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-09-04 19:43:36 +0300
committerJulian Rex <julian.rex@mapbox.com>2019-09-07 00:15:38 -0400
commit8dd2d25b0dc8e39800d8fb99b6df87912e9ea754 (patch)
treea33a5f200b54a36a79311f1d52f605613139564c
parentdb339af506fd9cb90e91c7576b56ec04462c0ae7 (diff)
downloadqtlocation-mapboxgl-8dd2d25b0dc8e39800d8fb99b6df87912e9ea754.tar.gz
[Darwin] Add an integration test
-rw-r--r--platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m b/platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m
index 4501294f72..3e9e035e93 100644
--- a/platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m
+++ b/platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m
@@ -58,4 +58,18 @@
[self waitForMapViewToBeRenderedWithTimeout:10];
}
+- (void)testForRaisingExceptionsOnStaleStyleObjects {
+ self.mapView.centerCoordinate = CLLocationCoordinate2DMake(38.897,-77.039);
+ self.mapView.zoomLevel = 10.5;
+
+ MGLVectorTileSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"trees" configurationURL:[NSURL URLWithString:@"mapbox://examples.2uf7qges"]];
+ [self.mapView.style addSource:source];
+
+ self.styleLoadingExpectation = nil;
+ [self.mapView setStyleURL:[[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]];
+ [self waitForMapViewToFinishLoadingStyleWithTimeout:10];
+
+ XCTAssertThrowsSpecificNamed(source.configurationURL, NSException, MGLInvalidStyleSourceException, @"MGLSource should raise an exception if its core peer got invalidated");
+}
+
@end