summaryrefslogtreecommitdiff
path: root/platform/ios/uitest
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-01-24 08:29:46 -0800
committerGitHub <noreply@github.com>2017-01-24 08:29:46 -0800
commit35e062d72cde411e8a9a36ef74cbe527d31e945b (patch)
tree74a668219e317fd7fd36710034e540d3e5df3a90 /platform/ios/uitest
parentb32c17119e5b046aab796a29e321759095a0959b (diff)
downloadqtlocation-mapboxgl-35e062d72cde411e8a9a36ef74cbe527d31e945b.tar.gz
[ios, macos] Wrap camera heading (#7724)
* [ios, macos] Fixed negative camera heading when facing northwest * [ios] Corrected counterclockwise rotation test
Diffstat (limited to 'platform/ios/uitest')
-rw-r--r--platform/ios/uitest/MapViewTests.m17
1 files changed, 16 insertions, 1 deletions
diff --git a/platform/ios/uitest/MapViewTests.m b/platform/ios/uitest/MapViewTests.m
index 41ea5446ef..21310b47a6 100644
--- a/platform/ios/uitest/MapViewTests.m
+++ b/platform/ios/uitest/MapViewTests.m
@@ -260,7 +260,7 @@
@"disabling pan gesture should disallow horizontal panning");
}
-- (void)testRotate {
+- (void)testRotateClockwise {
CLLocationDirection startAngle = tester.mapView.direction;
XCTAssertNotEqual(startAngle,
@@ -274,6 +274,21 @@
@"rotating map should change angle");
}
+- (void)testRotateCounterclockwise {
+ CLLocationDirection startAngle = tester.mapView.direction;
+
+ XCTAssertNotEqual(startAngle,
+ -45,
+ @"start angle must not be destination angle");
+
+ [tester.mapView twoFingerRotateAtPoint:tester.mapView.center angle:-45];
+
+ XCTAssertGreaterThanOrEqual(fabs(startAngle - tester.mapView.direction),
+ 20,
+ @"rotating map should change angle");
+ XCTAssertGreaterThan(tester.mapView.camera.heading, 0, @"camera should not go negative");
+}
+
- (void)testRotateDisabled {
tester.mapView.rotateEnabled = NO;
CLLocationDirection startAngle = tester.mapView.direction;