diff options
Diffstat (limited to 'platform/ios/Integration Test Harness/MGLTestHarnessViewController.m')
-rw-r--r-- | platform/ios/Integration Test Harness/MGLTestHarnessViewController.m | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/platform/ios/Integration Test Harness/MGLTestHarnessViewController.m b/platform/ios/Integration Test Harness/MGLTestHarnessViewController.m new file mode 100644 index 0000000000..d37c0039fb --- /dev/null +++ b/platform/ios/Integration Test Harness/MGLTestHarnessViewController.m @@ -0,0 +1,51 @@ +#import "Mapbox.h" +#import "MGLMapViewDelegate.h" + +#import "MGLTestHarnessViewController.h" +#import "MGLTestingSupport.h" + +@interface MGLTestHarnessViewController ()<MGLMapViewDelegate> + +@property (nonatomic) MGLMapView *mapView; + +@end + +@implementation MGLTestHarnessViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds]; + + self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.mapView.accessibilityIdentifier = MGLTestingSupportMapViewID; + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(31, -100) zoomLevel:3 animated:NO]; + self.mapView.delegate = self; + + [self.view addSubview:self.mapView]; +} + + +#pragma mark - mapview delgate handles + +- (void)mapViewDidFinishRenderingMap:(MGLMapView *)mapView fullyRendered:(BOOL)fullyRendered { + testingSupportPostNotification(MGLTestingSupportNotificationMapViewRendered); +} + +- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { + testingSupportPostNotification(MGLTestingSupportNotificationMapViewStyleLoaded); +} + +- (void)mapView:(MGLMapView *)mapView regionWillChangeAnimated:(BOOL)animated { + testingSupportPostNotification(MGLTestingSupportNotificationMapViewRegionWillChange); +} + +- (void)mapView:(MGLMapView *)mapView regionIsChangingWithReason:(MGLCameraChangeReason)reason { + testingSupportPostNotification(MGLTestingSupportNotificationMapViewRegionIsChanging); +} + +- (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated { + testingSupportPostNotification(MGLTestingSupportNotificationMapViewRegionDidChanged); +} + + +@end |