@@ -115,6 +115,11 @@ Rectangle {
120+ signalName: "playing"
118 UT.UnityTestCase {
123 UT.UnityTestCase {
119 name: "PreviewInlineVideoTest"
124 name: "PreviewInlineVideoTest"
120 when: windowShown
125 when: windowShown
@@ -129,16 +134,24 @@ Rectangle {
131 function test_singleton() {
136 function test_singleton() {
132− mouseClick(videoPlaybackLoader, videoPlaybackLoader.width / 2, videoPlaybackLoader.height / 2);
134 var services = findChild(videoPlaybackLoader, "services");
137 var services = findChild(videoPlaybackLoader, "services");
135− verify(services.position > 2000);
138+ spy.clear();
139+ spy.target = services.mediaPlayer;
140+ mouseClick(videoPlaybackLoader, videoPlaybackLoader.width / 2, videoPlaybackLoader.height / 2);
141+ tryCompare(spy, "count", 1);
142+ tryCompareFunction(function() { return services.position > 3000; }, true);
144+ // Simulate widget being destroyed and recreated
136 videoPlaybackLoader.active = false;
145 videoPlaybackLoader.active = false;
137 videoPlaybackLoader.active = true;
146 videoPlaybackLoader.active = true;
138 services = findChild(videoPlaybackLoader, "services");
148 services = findChild(videoPlaybackLoader, "services");
150+ spy.target = services.mediaPlayer;
151+ compare(services.position, 0);
139 mouseClick(videoPlaybackLoader, videoPlaybackLoader.width / 2, videoPlaybackLoader.height / 2);
152 mouseClick(videoPlaybackLoader, videoPlaybackLoader.width / 2, videoPlaybackLoader.height / 2);
140− wait(500);
153+ tryCompare(spy, "count", 1);
141− verify(services.position > 2000);
154+ tryCompareFunction(function() { return services.position > 3000; }, true, 1000);