@@ -43,8 +43,7 @@ Rectangle {
4343 var dateString = Qt.formatDate(dateObj, Qt.DefaultLocaleLongDate)
4444 var timeString = Qt.formatTime(dateObj)
4545
46− clock.__timerInterval = 60000
47− clock.__date = dateObj
46+ clock.currentDate = dateObj
4847 var dateLabel = findChild(clock, "dateLabel")
4948 compare(dateLabel.text, dateString, "Not the expected date")
5049 var timeLabel = findChild(clock, "timeLabel")
@@ -57,33 +56,20 @@ Rectangle {
5756 var timeString = Qt.formatTime(dateObj)
5857
5958 clock.enabled = false
60− compare(clock.__timerRunning, false, "Timer should not be running")
61− clock.__date = dateObj
62− clock.__timerInterval = 5
63− wait(5) // spin event loop (only that would trigger the timer and reveal eventual bugs)
59+ var timeModel = findInvisibleChild(clock, "timeModel")
60+
61+ compare(timeModel.menuObjectPath, "", "Clock shouldn't be connected to Indicators when not active.")
62+
63+ clock.currentDate = dateObj
64+
6465 var dateLabel = findChild(clock, "dateLabel")
6566 compare(dateLabel.text, dateString, "Not the expected date")
6667 var timeLabel = findChild(clock, "timeLabel")
6768 compare(timeLabel.text, timeString, "Not the expected time")
6869
6970 clock.enabled = true
70− compare(clock.__timerRunning, true, "Timer should be running")
71− wait(0) // spin event loop to trigger the timer
72− verify(dateLabel.text !== dateString)
73− if (timeLabel.text.indexOf("11:13") != -1) wait(60000) // next test will fail at 11:13, wait 1 minute
74− verify(timeLabel.text !== timeString)
75− }
7671
77− function test_timerRunning() {
78− // tests for clock.enabled property are already in test_dateUpdate()
79− clock.opacity = 0.0
80− compare(clock.__timerRunning, false, "Timer should not be running")
81− clock.opacity = 1.0
82− compare(clock.__timerRunning, true, "Timer should be running")
83− clock.visible = false
84− compare(clock.__timerRunning, false, "Timer should not be running")
85− clock.visible = true
86− compare(clock.__timerRunning, true, "Timer should be running")
72+ verify(timeModel.menuObjectPath != "", "Should be connected to Indicators.")
8773 }
8874 }
8975}