summaryrefslogtreecommitdiffstats
path: root/tests/auto/animation/clock/tst_clock.cpp
diff options
context:
space:
mode:
authorJuan José Casafranca <juan.casafranca@kdab.com>2017-09-08 15:49:57 +0200
committerSean Harmer <sean.harmer@kdab.com>2017-09-08 14:40:18 +0000
commit8a4b9ebadb9e63ae367694f04786c7faf6306f27 (patch)
treef47a427328eb71c316c01638cb4843985d7891e8 /tests/auto/animation/clock/tst_clock.cpp
parent018c3756649c8ce3219ca9c99de2a754e7e3a00a (diff)
Add sceneChangeEvent to QClock backend nodev5.10.0-alpha1
QClock backend node didn't implement sceneChangeEvent, so there was no communication from frontend to backend node. Change-Id: Idf72cba7b7c1834d80694d28a6df4826f8e279aa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/auto/animation/clock/tst_clock.cpp')
-rw-r--r--tests/auto/animation/clock/tst_clock.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/animation/clock/tst_clock.cpp b/tests/auto/animation/clock/tst_clock.cpp
index 547ec6a12..a81adfe7b 100644
--- a/tests/auto/animation/clock/tst_clock.cpp
+++ b/tests/auto/animation/clock/tst_clock.cpp
@@ -75,6 +75,35 @@ private Q_SLOTS:
// THEN
QCOMPARE(backendClock.playbackRate(), 1.0);
}
+
+ void checkSceneChangeEvents()
+ {
+ // GIVEN
+ Qt3DAnimation::Animation::Clock backendClock;
+
+ {
+ // WHEN
+ const bool newValue = false;
+ const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(Qt3DCore::QNodeId());
+ change->setPropertyName("enabled");
+ change->setValue(newValue);
+ backendClock.sceneChangeEvent(change);
+
+ // THEN
+ QCOMPARE(backendClock.isEnabled(), newValue);
+ }
+ {
+ // WHEN
+ const double newPlaybackRateValue = 2.0;
+ const auto change = Qt3DCore::QPropertyUpdatedChangePtr::create(Qt3DCore::QNodeId());
+ change->setPropertyName("playbackRate");
+ change->setValue(newPlaybackRateValue);
+ backendClock.sceneChangeEvent(change);
+
+ // THEN
+ QCOMPARE(backendClock.playbackRate(), newPlaybackRateValue);
+ }
+ }
};
QTEST_APPLESS_MAIN(tst_Clock)