From 2c48871c065c6efec42c5660c9560ecdfaa8d359 Mon Sep 17 00:00:00 2001 From: Andrew Kitchen Date: Wed, 3 Jan 2018 17:16:30 -0800 Subject: Adds an integration test harness to the iOS project This will allow us to write lightweight integration tests between MGLMapView and the core renderer. Also includes a test for the recent custom layer memory fix, reverting the fix in order to demonstrate the failing test. --- platform/ios/app/MBXViewController.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'platform/ios/app/MBXViewController.m') diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 4306354030..2fd2b69e83 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -1683,8 +1683,11 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { numStyleURLMethods, (unsigned long)styleNames.count); }); - self.styleIndex = (self.styleIndex + 1) % styleNames.count; + MGLStyle *oldStyle = self.mapView.style; + MGLStyleLayer *oldLayer = [oldStyle layerWithIdentifier:@"test-layer"]; + [oldStyle removeLayer:oldLayer]; + self.styleIndex = (self.styleIndex + 1) % styleNames.count; self.mapView.styleURL = styleURLs[self.styleIndex]; UIButton *titleButton = (UIButton *)self.navigationItem.titleView; @@ -1931,6 +1934,9 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { // that a device with an English-language locale is already effectively // using locale-based country labels. _usingLocaleBasedCountryLabels = [[self bestLanguageForUser] isEqualToString:@"en"]; + + MGLOpenGLStyleLayer *glLayer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"test-layer"]; + [style addLayer:glLayer]; } - (void)mapViewRegionIsChanging:(MGLMapView *)mapView -- cgit v1.2.1