aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmkiley <jordan.kiley@mapbox.com>2019-05-17 14:21:57 -0700
committerjmkiley <jordan.kiley@mapbox.com>2019-06-03 11:21:00 -0700
commita55b7629c6789c132b224c0df729ceab7ca10671 (patch)
tree7b07173c9cd6d9c99edde7e8f2e50cfe9edef716
parentd2badb56cd40c5254cca59035b62ea7fd4950f35 (diff)
[ios] it's a start
-rw-r--r--platform/ios/Integration Test Harness/IntegrationTest.storyboard65
-rw-r--r--platform/ios/Integration Tests/MBXTestViewController.h19
-rw-r--r--platform/ios/Integration Tests/MBXTestViewController.m42
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj12
4 files changed, 138 insertions, 0 deletions
diff --git a/platform/ios/Integration Test Harness/IntegrationTest.storyboard b/platform/ios/Integration Test Harness/IntegrationTest.storyboard
new file mode 100644
index 000000000..4f8304170
--- /dev/null
+++ b/platform/ios/Integration Test Harness/IntegrationTest.storyboard
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+ <device id="retina6_1" orientation="portrait">
+ <adaptation id="fullscreen"/>
+ </device>
+ <dependencies>
+ <deployment identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+ </dependencies>
+ <scenes>
+ <!--Item-->
+ <scene sceneID="fhr-aE-tTj">
+ <objects>
+ <viewController storyboardIdentifier="ViewController" id="ASs-xL-clZ" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="lzt-2J-uTF">
+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+ <viewLayoutGuide key="safeArea" id="vIq-UN-Qfi"/>
+ </view>
+ <tabBarItem key="tabBarItem" title="Item" id="hLN-kr-S0z"/>
+ <simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="AFd-xb-QBj" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="944.92753623188412" y="18.75"/>
+ </scene>
+ <!--Item-->
+ <scene sceneID="MfB-Cf-2el">
+ <objects>
+ <viewController id="8iQ-5y-pOa" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="3bR-CC-pPl">
+ <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+ <viewLayoutGuide key="safeArea" id="5gm-c1-nN7"/>
+ </view>
+ <tabBarItem key="tabBarItem" title="Item" id="GpL-g0-DtE"/>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="aOY-L5-KU2" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="1903" y="19"/>
+ </scene>
+ <!--Tab Bar Controller-->
+ <scene sceneID="lD6-oP-oc3">
+ <objects>
+ <tabBarController storyboardIdentifier="TabController" automaticallyAdjustsScrollViewInsets="NO" id="f3w-iN-ZZt" sceneMemberID="viewController">
+ <toolbarItems/>
+ <tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="9zn-8l-u1E">
+ <autoresizingMask key="autoresizingMask"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+ </tabBar>
+ <connections>
+ <segue destination="ASs-xL-clZ" kind="relationship" relationship="viewControllers" id="pLe-o0-8o9"/>
+ <segue destination="8iQ-5y-pOa" kind="relationship" relationship="viewControllers" id="q58-iJ-5bP"/>
+ </connections>
+ </tabBarController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="lSq-NA-zjz" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="1397" y="-707"/>
+ </scene>
+ </scenes>
+</document>
diff --git a/platform/ios/Integration Tests/MBXTestViewController.h b/platform/ios/Integration Tests/MBXTestViewController.h
new file mode 100644
index 000000000..c55e791d1
--- /dev/null
+++ b/platform/ios/Integration Tests/MBXTestViewController.h
@@ -0,0 +1,19 @@
+//
+// MBXTestViewController.h
+// Integration Test Harness
+//
+// Created by Jordan on 5/15/19.
+// Copyright © 2019 Mapbox. All rights reserved.
+//
+
+#import "MGLMapViewIntegrationTest.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface MBXTestViewController : MGLMapViewIntegrationTest
+
+@property (nonatomic) UIViewController *viewController;
+@property (nonatomic) UITabBarController *tabController;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/platform/ios/Integration Tests/MBXTestViewController.m b/platform/ios/Integration Tests/MBXTestViewController.m
new file mode 100644
index 000000000..6371917e5
--- /dev/null
+++ b/platform/ios/Integration Tests/MBXTestViewController.m
@@ -0,0 +1,42 @@
+
+#import "MBXTestViewController.h"
+
+@implementation MBXTestViewController
+
+- (void)setUp {
+ [super setUp];
+ UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"IntegrationTest" bundle:[NSBundle mainBundle]];
+
+ self.tabController = (UITabBarController *)[storyboard instantiateViewControllerWithIdentifier:@"TabController"];
+ self.viewController = self.tabController.childViewControllers[0];
+ MGLMapView *mapView = [MGLMapView alloc] initWithFrame:self.viewController.view.bounds);
+ mapView.delegate = self;
+ [self.viewController.view addSubview:mapView];
+
+
+ MGLPointAnnotation *annot = [[MGLPointAnnotation alloc] init];
+ annot.coordinate = mapView.centerCoordinate;
+ [mapView addAnnotation:annot];
+
+ NSLog(@"%@", self.tabController.childViewControllers);
+}
+
+- (void)testViewControllerNil {
+ XCTAssertNotNil(self.viewController);
+}
+
+- (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id <MGLAnnotation>)annotation {
+
+ MGLAnnotationView *annotView = [mapView dequeueReusableAnnotationViewWithIdentifier:@"annot-view"];
+
+ if (!annotView) {
+ annotView = [[MGLAnnotationView alloc] initWithReuseIdentifier:@"annot-view"];
+ annotView.frame = CGRectMake(0, 0, 10, 10);
+ }
+
+
+
+ return annotView;
+}
+@end
+
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 0bdb3706d..a9de5e501 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -436,6 +436,9 @@
96F3F73C1F57124B003E2D2C /* MGLUserLocationHeadingIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 96F3F73B1F5711F1003E2D2C /* MGLUserLocationHeadingIndicator.h */; };
9C188C4F2242C95A0022FA55 /* MMEDate.m in Sources */ = {isa = PBXBuildFile; fileRef = 40834BBC1FE05D6E00C1BD0D /* MMEDate.m */; };
9C188C502242C96F0022FA55 /* MMEDate.h in Headers */ = {isa = PBXBuildFile; fileRef = 40834BC51FE05D6F00C1BD0D /* MMEDate.h */; };
+ A46E4C9E228CE392009CAD5B /* MBXTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A46E4C9C228CB74B009CAD5B /* MBXTestViewController.m */; };
+ A46E4C9F228CE5FD009CAD5B /* IntegrationTest.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A46E4C99228CB731009CAD5B /* IntegrationTest.storyboard */; };
+ A46E4CA2228F4D6B009CAD5B /* IntegrationTest.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A46E4C99228CB731009CAD5B /* IntegrationTest.storyboard */; };
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 */; };
AC1B0917221CA14D00DB56C8 /* CLLocationManager+MMEMobileEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = AC1B0914221CA14500DB56C8 /* CLLocationManager+MMEMobileEvents.h */; };
@@ -1102,6 +1105,9 @@
96ED34DD22374C0900E9FCA9 /* MGLMapViewDirectionTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLMapViewDirectionTests.mm; sourceTree = "<group>"; };
96F017292118FBAE00892778 /* MGLMapView_Experimental.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMapView_Experimental.h; sourceTree = "<group>"; };
96F3F73B1F5711F1003E2D2C /* MGLUserLocationHeadingIndicator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLUserLocationHeadingIndicator.h; sourceTree = "<group>"; };
+ A46E4C99228CB731009CAD5B /* IntegrationTest.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = IntegrationTest.storyboard; sourceTree = "<group>"; };
+ A46E4C9B228CB74B009CAD5B /* MBXTestViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBXTestViewController.h; sourceTree = "<group>"; };
+ A46E4C9C228CB74B009CAD5B /* MBXTestViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBXTestViewController.m; sourceTree = "<group>"; };
A4F3FB1C2254865900A30170 /* missing_icon.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = missing_icon.json; sourceTree = "<group>"; };
AC1B0914221CA14500DB56C8 /* CLLocationManager+MMEMobileEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CLLocationManager+MMEMobileEvents.h"; path = "../vendor/mapbox-events-ios/MapboxMobileEvents/CLLocationManager+MMEMobileEvents.h"; sourceTree = "<group>"; };
AC1B0915221CA14C00DB56C8 /* CLLocationManager+MMEMobileEvents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CLLocationManager+MMEMobileEvents.m"; path = "../vendor/mapbox-events-ios/MapboxMobileEvents/CLLocationManager+MMEMobileEvents.m"; sourceTree = "<group>"; };
@@ -1474,6 +1480,8 @@
16376B0B1FFD9DAF0000563E /* Info.plist */,
CA34C9C2207FD272005C1A06 /* MGLCameraTransitionTests.mm */,
CA0C27912076C804001CE5B7 /* MGLShapeSourceTests.m */,
+ A46E4C9B228CB74B009CAD5B /* MBXTestViewController.h */,
+ A46E4C9C228CB74B009CAD5B /* MBXTestViewController.m */,
CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */,
CA0C27952076CA50001CE5B7 /* MGLMapViewIntegrationTest.h */,
CA4EB8C620863487006AB465 /* MGLStyleLayerIntegrationTests.m */,
@@ -1491,6 +1499,7 @@
16376B321FFDB4B40000563E /* AppDelegate.m */,
16376B3A1FFDB4B40000563E /* Assets.xcassets */,
16376B3C1FFDB4B40000563E /* LaunchScreen.storyboard */,
+ A46E4C99228CB731009CAD5B /* IntegrationTest.storyboard */,
16376B3F1FFDB4B40000563E /* Info.plist */,
16376B401FFDB4B40000563E /* main.m */,
);
@@ -2905,6 +2914,7 @@
files = (
16376B471FFDB92B0000563E /* one-liner.json in Resources */,
1F8A59F821653275004DFE75 /* sideload_sat.db in Resources */,
+ A46E4C9F228CE5FD009CAD5B /* IntegrationTest.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2912,6 +2922,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ A46E4CA2228F4D6B009CAD5B /* IntegrationTest.storyboard in Resources */,
16376B3E1FFDB4B40000563E /* LaunchScreen.storyboard in Resources */,
16376B3B1FFDB4B40000563E /* Assets.xcassets in Resources */,
);
@@ -3047,6 +3058,7 @@
CA7766832229C10E0008DE9E /* MGLCompactCalloutView.m in Sources */,
CAE7AD5520F46EF5003B6782 /* MGLMapSnapshotterSwiftTests.swift in Sources */,
CA0C27922076C804001CE5B7 /* MGLShapeSourceTests.m in Sources */,
+ A46E4C9E228CE392009CAD5B /* MBXTestViewController.m in Sources */,
077061DA215DA00E000FEF62 /* MGLTestLocationManager.m in Sources */,
CA6914B520E67F50002DB0EE /* MGLAnnotationViewIntegrationTests.m in Sources */,
CA1B4A512099FB2200EDD491 /* MGLMapSnapshotterTest.m in Sources */,