diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-04 19:43:36 +0300 |
---|---|---|
committer | Julian Rex <julian.rex@mapbox.com> | 2019-09-07 00:15:38 -0400 |
commit | 8dd2d25b0dc8e39800d8fb99b6df87912e9ea754 (patch) | |
tree | a33a5f200b54a36a79311f1d52f605613139564c | |
parent | db339af506fd9cb90e91c7576b56ec04462c0ae7 (diff) | |
download | qtlocation-mapboxgl-8dd2d25b0dc8e39800d8fb99b6df87912e9ea754.tar.gz |
[Darwin] Add an integration test
-rw-r--r-- | platform/ios/Integration Tests/MGLStyleLayerIntegrationTests.m | 14 |
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 |