From e95492a7ec8a7ed910ee91ef0d60dc3dca13a52d Mon Sep 17 00:00:00 2001 From: jmkiley Date: Fri, 14 Jun 2019 14:25:32 -0700 Subject: [ios] play with the new file --- platform/ios/Integration Test Harness/Info.plist | 4 +- .../ios/Integration Tests/MBGLIntegrationTests.m | 54 ---------------------- .../MGLStyleLoadingIntegrationTests.m | 4 ++ platform/ios/ios.xcodeproj/project.pbxproj | 22 +++++---- 4 files changed, 19 insertions(+), 65 deletions(-) diff --git a/platform/ios/Integration Test Harness/Info.plist b/platform/ios/Integration Test Harness/Info.plist index be30bb5cc..1fcabd595 100644 --- a/platform/ios/Integration Test Harness/Info.plist +++ b/platform/ios/Integration Test Harness/Info.plist @@ -2,8 +2,6 @@ - NSLocationWhenInUseUsageDescription - Used to run user location tests CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -22,6 +20,8 @@ 1 LSRequiresIPhoneOS + NSLocationWhenInUseUsageDescription + Used to run user location tests UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities diff --git a/platform/ios/Integration Tests/MBGLIntegrationTests.m b/platform/ios/Integration Tests/MBGLIntegrationTests.m index c1a3833fb..ff361bc23 100644 --- a/platform/ios/Integration Tests/MBGLIntegrationTests.m +++ b/platform/ios/Integration Tests/MBGLIntegrationTests.m @@ -141,62 +141,8 @@ XCTAssertNil(weakLayer); } -- (void)testOpenGLLayerDoesNotLeakWhenStyleChanged { - __weak MGLOpenGLStyleLayer *weakLayer; - @autoreleasepool { - { - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; - weakLayer = layer; - [self.style insertLayer:layer atIndex:0]; - layer = nil; - } - } - - XCTAssertNotNil(weakLayer); - - [self waitForMapViewToBeRendered]; - - MGLStyleLayer *layer2 = [self.mapView.style layerWithIdentifier:@"gl-layer"]; - - NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; - [self.mapView setStyleURL:styleURL]; - [self waitForExpectations:@[self.styleLoadingExpectation] timeout:10]; - - // At this point the C++ CustomLayer will have been destroyed, and the rawLayer pointer has been NULLed - XCTAssert(weakLayer == layer2); - XCTAssertNotNil(weakLayer); - - // Asking the style for the layer should return nil - MGLStyleLayer *layer3 = [self.mapView.style layerWithIdentifier:@"gl-layer"]; - XCTAssertNil(layer3); -} - - -- (void)testOpenGLLayerDoesNotLeakWhenMapViewDeallocs { - __weak id weakLayer; - - @autoreleasepool { - - NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; - MGLMapView *mapView2 = [[MGLMapView alloc] initWithFrame:UIScreen.mainScreen.bounds styleURL:styleURL]; - mapView2.delegate = self; - - XCTAssertNil(mapView2.style); - - self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; - [self waitForExpectationsWithTimeout:10 handler:nil]; - MGLOpenGLStyleLayer *layer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"gl-layer"]; - weakLayer = layer; - [mapView2.style insertLayer:layer atIndex:0]; - layer = nil; - - [self waitForMapViewToBeRendered]; - } - XCTAssertNil(weakLayer); -} @end diff --git a/platform/ios/Integration Tests/MGLStyleLoadingIntegrationTests.m b/platform/ios/Integration Tests/MGLStyleLoadingIntegrationTests.m index 38f3e5134..55754cfc7 100644 --- a/platform/ios/Integration Tests/MGLStyleLoadingIntegrationTests.m +++ b/platform/ios/Integration Tests/MGLStyleLoadingIntegrationTests.m @@ -9,6 +9,10 @@ - (void)setUp { [super setUp]; + + self.mapView = [[MBXTestMapView alloc] initWithFrame:UIScreen.mainScreen.bounds]; + self.mapView.delegate = self; + if (!self.mapView.style) { [self waitForMapViewToFinishLoadingStyleWithTimeout:10]; } diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 862dbc188..76c59a52b 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -439,7 +439,7 @@ A46E4C9E228CE392009CAD5B /* MGLTabBarControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A46E4C9C228CB74B009CAD5B /* MGLTabBarControllerTests.m */; }; A46E4C9F228CE5FD009CAD5B /* IntegrationTest.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A46E4C99228CB731009CAD5B /* IntegrationTest.storyboard */; }; A46E4CA2228F4D6B009CAD5B /* IntegrationTest.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A46E4C99228CB731009CAD5B /* IntegrationTest.storyboard */; }; - A489BDC322B2D3B20026931C /* MGLStyleLoadingIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A489BDC222B2D3B20026931C /* MGLStyleLoadingIntegrationTests.m */; }; + A489BDC522B444F30026931C /* MGLStyleLoadingIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A489BDC222B2D3B20026931C /* MGLStyleLoadingIntegrationTests.m */; }; A4EE317022973F2E006A8F2F /* MBXTestMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = A4EE316F22973F2E006A8F2F /* MBXTestMapView.m */; }; A4F3FB1D2254865900A30170 /* missing_icon.json in Resources */ = {isa = PBXBuildFile; fileRef = A4F3FB1C2254865900A30170 /* missing_icon.json */; }; AC1B0916221CA14D00DB56C8 /* CLLocationManager+MMEMobileEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = AC1B0914221CA14500DB56C8 /* CLLocationManager+MMEMobileEvents.h */; }; @@ -2829,13 +2829,14 @@ TargetAttributes = { 16376B061FFD9DAF0000563E = { CreatedOnToolsVersion = 9.2; + DevelopmentTeam = 85826LGZGV; LastSwiftMigration = 0940; ProvisioningStyle = Automatic; TestTargetID = DA1DC9491CB6C1C2006E619F; }; 16376B2E1FFDB4B40000563E = { CreatedOnToolsVersion = 9.2; - DevelopmentTeam = GJZR2MEM28; + DevelopmentTeam = 85826LGZGV; ProvisioningStyle = Automatic; }; DA1DC9491CB6C1C2006E619F = { @@ -3059,7 +3060,7 @@ CA7766842229C11A0008DE9E /* SMCalloutView.m in Sources */, CA34C9C3207FD272005C1A06 /* MGLCameraTransitionTests.mm in Sources */, 16376B0A1FFD9DAF0000563E /* MBGLIntegrationTests.m in Sources */, - A489BDC322B2D3B20026931C /* MGLStyleLoadingIntegrationTests.m in Sources */, + A489BDC522B444F30026931C /* MGLStyleLoadingIntegrationTests.m in Sources */, CA88DC3021C85D900059ED5A /* MGLStyleURLIntegrationTest.m in Sources */, CA0C27942076CA19001CE5B7 /* MGLMapViewIntegrationTest.m in Sources */, CA7766832229C10E0008DE9E /* MGLCompactCalloutView.m in Sources */, @@ -3633,6 +3634,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 85826LGZGV; GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = "Integration Tests/Info.plist"; @@ -3664,6 +3666,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 85826LGZGV; GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = "Integration Tests/Info.plist"; @@ -3692,11 +3695,11 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = GJZR2MEM28; + DEVELOPMENT_TEAM = 85826LGZGV; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Test Harness/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harness"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harnessm"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -3717,11 +3720,11 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = GJZR2MEM28; + DEVELOPMENT_TEAM = 85826LGZGV; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Test Harness/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harness"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harnessm"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -3966,6 +3969,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 85826LGZGV; GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = "Integration Tests/Info.plist"; @@ -3994,11 +3998,11 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = GJZR2MEM28; + DEVELOPMENT_TEAM = 85826LGZGV; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Test Harness/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harness"; + PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harnessm"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; }; -- cgit v1.2.3