Merge lp:~renatofilho/mediaplayer-app/fix-autopilot into lp:mediaplayer-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Florian Boucault
Approved revision: 115
Merged at revision: 112
Proposed branch: lp:~renatofilho/mediaplayer-app/fix-autopilot
Merge into: lp:mediaplayer-app
Diff against target: 178 lines (+31/-52)
6 files modified
src/qml/player.qml (+2/-2)
src/qml/player/TimeLine.qml (+1/-2)
src/qml/player/VideoPlayer.qml (+11/-1)
src/qml/theme/qmldir (+0/-3)
src/qml/theme/theme.qmltheme (+0/-24)
tests/autopilot/mediaplayer_app/tests/test_player_with_video.py (+17/-20)
To merge this branch: bzr merge lp:~renatofilho/mediaplayer-app/fix-autopilot
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+172638@code.launchpad.net

Commit message

* Adapt slider to newer and simpler toolkit's theming infrastructure.
* Fixed autopilot tests.
* Changed test video file.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
114. By Renato Araujo Oliveira Filho

Make sure that the test will not fail due the timeout while wainting for the end of video.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
115. By Renato Araujo Oliveira Filho

Make sure that the video player start after the component fully loaded.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/player.qml'
2--- src/qml/player.qml 2013-05-22 13:11:52 +0000
3+++ src/qml/player.qml 2013-07-02 20:05:28 +0000
4@@ -58,9 +58,9 @@
5 anchors.fill: parent
6 clip: true
7 onLoaded: {
8- item.focus = true
9+ item.focus = true
10+ item.rotating = Qt.binding(function () { return rotatingTransition.running } )
11 item.playUri(playUri)
12- item.rotating = Qt.binding(function () { return rotatingTransition.running } )
13 }
14
15 state: mediaPlayer.orientation != "" ? mediaPlayer.orientation : (screenHeight <= screenWidth ? "0" : "270")
16
17=== modified file 'src/qml/player/TimeLine.qml'
18--- src/qml/player/TimeLine.qml 2013-05-22 17:26:17 +0000
19+++ src/qml/player/TimeLine.qml 2013-07-02 20:05:28 +0000
20@@ -20,7 +20,6 @@
21 import QtQuick 2.0
22 import Ubuntu.Components 0.1
23 import "../sdk"
24-import "../theme"
25
26 Item {
27 id: _timeLine
28@@ -45,7 +44,7 @@
29 id: _slider
30
31 objectName: "TimeLine.Slider"
32- ItemStyle.delegate: VideoSlider {property Item item: _slider}
33+ style: VideoSlider {property Item item: _slider}
34 anchors {
35 top: parent.top
36 bottom: parent.bottom
37
38=== modified file 'src/qml/player/VideoPlayer.qml'
39--- src/qml/player/VideoPlayer.qml 2013-04-01 20:24:16 +0000
40+++ src/qml/player/VideoPlayer.qml 2013-07-02 20:05:28 +0000
41@@ -33,6 +33,7 @@
42 property string uri
43 property bool rotating: false
44 property alias controlsActive: _controls.active
45+ property bool componentLoaded: false
46
47 signal timeClicked
48
49@@ -43,7 +44,16 @@
50
51 function playUri(uri) {
52 source = uri
53- play()
54+ if (componentLoaded) {
55+ play()
56+ }
57+ }
58+
59+ Component.onCompleted: {
60+ componentLoaded = true
61+ if ((state !== "playing") && (source != "")) {
62+ play()
63+ }
64 }
65
66 function edgeEvent(event) {
67
68=== renamed file 'src/qml/theme/VideoSlider.qml' => 'src/qml/player/VideoSlider.qml'
69=== renamed file 'src/qml/theme/artwork/slider_bg.png' => 'src/qml/player/artwork/slider_bg.png'
70=== renamed file 'src/qml/theme/artwork/slider_handle.png' => 'src/qml/player/artwork/slider_handle.png'
71=== renamed file 'src/qml/theme/artwork/slider_shape.png' => 'src/qml/player/artwork/slider_shape.png'
72=== removed directory 'src/qml/theme'
73=== removed directory 'src/qml/theme/artwork'
74=== removed file 'src/qml/theme/qmldir'
75--- src/qml/theme/qmldir 2013-01-29 22:36:29 +0000
76+++ src/qml/theme/qmldir 1970-01-01 00:00:00 +0000
77@@ -1,3 +0,0 @@
78-module theme
79-
80-VideoSlider 0.1 VideoSlider.qml
81
82=== removed file 'src/qml/theme/theme.qmltheme'
83--- src/qml/theme/theme.qmltheme 2013-02-01 15:22:26 +0000
84+++ src/qml/theme/theme.qmltheme 1970-01-01 00:00:00 +0000
85@@ -1,24 +0,0 @@
86-/*
87- * Copyright (C) 2013 Canonical, Ltd.
88- *
89- * Authors:
90- * Renato Araujo Oliveira Filho <renato@canonical.com>
91- *
92- * This program is free software; you can redistribute it and/or modify
93- * it under the terms of the GNU General Public License as published by
94- * the Free Software Foundation; version 3.
95- *
96- * This program is distributed in the hope that it will be useful,
97- * but WITHOUT ANY WARRANTY; without even the implied warranty of
98- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
99- * GNU General Public License for more details.
100- *
101- * You should have received a copy of the GNU General Public License
102- * along with this program. If not, see <http://www.gnu.org/licenses/>.
103- */
104-
105-@import url("/usr/share/themes/Ambiance/qmltheme/default.qmltheme");
106-@qml-import(theme 0.1, ..);
107-@qml-mapping(.slider, , VideoSlider);
108-.slider{}
109-
110
111=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player_with_video.py'
112--- tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2013-06-07 13:51:58 +0000
113+++ tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2013-07-02 20:05:28 +0000
114@@ -29,6 +29,9 @@
115 self.launch_app("small.mp4")
116 self.assertThat(
117 self.main_window.get_qml_view().visible, Eventually(Equals(True)))
118+ # wait video player start
119+ player = self.main_window.get_object("VideoPlayer", "player")
120+ self.assertThat(player.playing, Eventually(Equals(True)))
121
122 def tearDown(self):
123 super(TestPlayerWithVideo, self).tearDown()
124@@ -134,37 +137,31 @@
125 self.pointing_device.move_to_object(time_line)
126 self.pointing_device.click()
127
128- """ Time label must show the current video time
129- - Depends on the resolution the current time can be different due
130- the slider size, because of that we avoid compare the secs
131- """
132- self.assertEqual(time_label.text[0:7], "00:00:0")
133+ """ Time label must show the current video time (diff from zero or empty) """
134+ self.assertNotEqual(time_label.text, "00:00:00")
135+ self.assertNotEqual(time_label.text, "")
136
137 """ Click in the label to change the state """
138 self.pointing_device.move_to_object(time_label)
139 self.pointing_device.click()
140
141- """ After the click the label must show the remaning time
142- - Depends on the resolution the current time can be different due
143- the slider size, because of that we avoid compare the secs
144- """
145- self.assertEqual(time_label.text[0:9], "- 00:00:0")
146+ """ After the click the label must show the remaning time (with '-' signal) """
147+ self.assertEqual(time_label.text[0:1], "-")
148
149 @skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')
150 def test_show_controls_at_end(self):
151- self.show_controls()
152 time_line = self.main_window.get_object("Slider", "TimeLine.Slider")
153
154- """ Seek to the midle of the video """
155- self.pointing_device.move_to_object(time_line)
156- self.pointing_device.click()
157-
158- """ hide controls """
159- video_area = self.main_window.get_object("VideoPlayer", "player")
160- self.pointing_device.move_to_object(video_area)
161- self.pointing_device.click()
162-
163 """ wait for video ends and control appears"""
164+ time_label = self.main_window.get_object("Label", "TimeLine.TimeLabel")
165+
166+ """ avoid the test fails due the timeout """
167+ self.assertThat(time_label.text, Eventually(Equals("00:00:05")))
168+ self.assertThat(time_label.text, Eventually(Equals("00:00:10")))
169+ self.assertThat(time_label.text, Eventually(Equals("00:00:15")))
170+ self.assertThat(time_label.text, Eventually(Equals("00:00:20")))
171+ self.assertThat(time_label.text, Eventually(Equals("00:00:25")))
172+
173 controls = self.main_window.get_object("Controls", "controls")
174 self.assertProperty(controls, visible=False)
175 self.assertThat(controls.visible, Eventually(Equals(True)))
176
177=== modified file 'tests/videos/small.mp4'
178Binary files tests/videos/small.mp4 2013-05-22 18:44:21 +0000 and tests/videos/small.mp4 2013-07-02 20:05:28 +0000 differ

Subscribers

People subscribed via source and target branches