summaryrefslogtreecommitdiff
path: root/test/map
diff options
context:
space:
mode:
Diffstat (limited to 'test/map')
-rw-r--r--test/map/transform.test.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/map/transform.test.cpp b/test/map/transform.test.cpp
index eb511a82da..7e98863400 100644
--- a/test/map/transform.test.cpp
+++ b/test/map/transform.test.cpp
@@ -468,6 +468,23 @@ TEST(Transform, Camera) {
ASSERT_DOUBLE_EQ(transform.getLatLng().longitude(), 0);
}
+TEST(Transform, IsPanning)
+{
+ Transform transform;
+
+ AnimationOptions easeOptions(Seconds(1));
+ easeOptions.transitionFrameFn = [&transform](double) {
+ ASSERT_TRUE(transform.getState().isPanning());
+ };
+
+ transform.resize({ 1000, 1000 });
+ transform.easeTo(CameraOptions().withCenter(LatLng(0, 360.0)), easeOptions);
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(250));
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(500));
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(750));
+ transform.updateTransitions(transform.getTransitionStart() + transform.getTransitionDuration());
+}
+
TEST(Transform, DefaultTransform) {
struct TransformObserver : public mbgl::MapObserver {
void onCameraWillChange(MapObserver::CameraChangeMode) final {