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
=== modified file 'src/qml/player.qml'
--- src/qml/player.qml 2013-05-22 13:11:52 +0000
+++ src/qml/player.qml 2013-07-02 20:05:28 +0000
@@ -58,9 +58,9 @@
58 anchors.fill: parent58 anchors.fill: parent
59 clip: true59 clip: true
60 onLoaded: {60 onLoaded: {
61 item.focus = true61 item.focus = true
62 item.rotating = Qt.binding(function () { return rotatingTransition.running } )
62 item.playUri(playUri)63 item.playUri(playUri)
63 item.rotating = Qt.binding(function () { return rotatingTransition.running } )
64 }64 }
6565
66 state: mediaPlayer.orientation != "" ? mediaPlayer.orientation : (screenHeight <= screenWidth ? "0" : "270")66 state: mediaPlayer.orientation != "" ? mediaPlayer.orientation : (screenHeight <= screenWidth ? "0" : "270")
6767
=== modified file 'src/qml/player/TimeLine.qml'
--- src/qml/player/TimeLine.qml 2013-05-22 17:26:17 +0000
+++ src/qml/player/TimeLine.qml 2013-07-02 20:05:28 +0000
@@ -20,7 +20,6 @@
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 0.1
22import "../sdk"22import "../sdk"
23import "../theme"
2423
25Item {24Item {
26 id: _timeLine25 id: _timeLine
@@ -45,7 +44,7 @@
45 id: _slider44 id: _slider
4645
47 objectName: "TimeLine.Slider"46 objectName: "TimeLine.Slider"
48 ItemStyle.delegate: VideoSlider {property Item item: _slider}47 style: VideoSlider {property Item item: _slider}
49 anchors {48 anchors {
50 top: parent.top49 top: parent.top
51 bottom: parent.bottom50 bottom: parent.bottom
5251
=== modified file 'src/qml/player/VideoPlayer.qml'
--- src/qml/player/VideoPlayer.qml 2013-04-01 20:24:16 +0000
+++ src/qml/player/VideoPlayer.qml 2013-07-02 20:05:28 +0000
@@ -33,6 +33,7 @@
33 property string uri33 property string uri
34 property bool rotating: false 34 property bool rotating: false
35 property alias controlsActive: _controls.active35 property alias controlsActive: _controls.active
36 property bool componentLoaded: false
3637
37 signal timeClicked38 signal timeClicked
3839
@@ -43,7 +44,16 @@
4344
44 function playUri(uri) {45 function playUri(uri) {
45 source = uri46 source = uri
46 play()47 if (componentLoaded) {
48 play()
49 }
50 }
51
52 Component.onCompleted: {
53 componentLoaded = true
54 if ((state !== "playing") && (source != "")) {
55 play()
56 }
47 }57 }
4858
49 function edgeEvent(event) {59 function edgeEvent(event) {
5060
=== renamed file 'src/qml/theme/VideoSlider.qml' => 'src/qml/player/VideoSlider.qml'
=== renamed file 'src/qml/theme/artwork/slider_bg.png' => 'src/qml/player/artwork/slider_bg.png'
=== renamed file 'src/qml/theme/artwork/slider_handle.png' => 'src/qml/player/artwork/slider_handle.png'
=== renamed file 'src/qml/theme/artwork/slider_shape.png' => 'src/qml/player/artwork/slider_shape.png'
=== removed directory 'src/qml/theme'
=== removed directory 'src/qml/theme/artwork'
=== removed file 'src/qml/theme/qmldir'
--- src/qml/theme/qmldir 2013-01-29 22:36:29 +0000
+++ src/qml/theme/qmldir 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1module theme
2
3VideoSlider 0.1 VideoSlider.qml
40
=== removed file 'src/qml/theme/theme.qmltheme'
--- src/qml/theme/theme.qmltheme 2013-02-01 15:22:26 +0000
+++ src/qml/theme/theme.qmltheme 1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * Authors:
5 * Renato Araujo Oliveira Filho <renato@canonical.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20@import url("/usr/share/themes/Ambiance/qmltheme/default.qmltheme");
21@qml-import(theme 0.1, ..);
22@qml-mapping(.slider, , VideoSlider);
23.slider{}
24
250
=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player_with_video.py'
--- tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2013-06-07 13:51:58 +0000
+++ tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2013-07-02 20:05:28 +0000
@@ -29,6 +29,9 @@
29 self.launch_app("small.mp4")29 self.launch_app("small.mp4")
30 self.assertThat(30 self.assertThat(
31 self.main_window.get_qml_view().visible, Eventually(Equals(True)))31 self.main_window.get_qml_view().visible, Eventually(Equals(True)))
32 # wait video player start
33 player = self.main_window.get_object("VideoPlayer", "player")
34 self.assertThat(player.playing, Eventually(Equals(True)))
3235
33 def tearDown(self):36 def tearDown(self):
34 super(TestPlayerWithVideo, self).tearDown()37 super(TestPlayerWithVideo, self).tearDown()
@@ -134,37 +137,31 @@
134 self.pointing_device.move_to_object(time_line)137 self.pointing_device.move_to_object(time_line)
135 self.pointing_device.click()138 self.pointing_device.click()
136139
137 """ Time label must show the current video time140 """ Time label must show the current video time (diff from zero or empty) """
138 - Depends on the resolution the current time can be different due141 self.assertNotEqual(time_label.text, "00:00:00")
139 the slider size, because of that we avoid compare the secs142 self.assertNotEqual(time_label.text, "")
140 """
141 self.assertEqual(time_label.text[0:7], "00:00:0")
142143
143 """ Click in the label to change the state """144 """ Click in the label to change the state """
144 self.pointing_device.move_to_object(time_label)145 self.pointing_device.move_to_object(time_label)
145 self.pointing_device.click()146 self.pointing_device.click()
146147
147 """ After the click the label must show the remaning time148 """ After the click the label must show the remaning time (with '-' signal) """
148 - Depends on the resolution the current time can be different due149 self.assertEqual(time_label.text[0:1], "-")
149 the slider size, because of that we avoid compare the secs
150 """
151 self.assertEqual(time_label.text[0:9], "- 00:00:0")
152150
153 @skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')151 @skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')
154 def test_show_controls_at_end(self):152 def test_show_controls_at_end(self):
155 self.show_controls()
156 time_line = self.main_window.get_object("Slider", "TimeLine.Slider")153 time_line = self.main_window.get_object("Slider", "TimeLine.Slider")
157154
158 """ Seek to the midle of the video """
159 self.pointing_device.move_to_object(time_line)
160 self.pointing_device.click()
161
162 """ hide controls """
163 video_area = self.main_window.get_object("VideoPlayer", "player")
164 self.pointing_device.move_to_object(video_area)
165 self.pointing_device.click()
166
167 """ wait for video ends and control appears"""155 """ wait for video ends and control appears"""
156 time_label = self.main_window.get_object("Label", "TimeLine.TimeLabel")
157
158 """ avoid the test fails due the timeout """
159 self.assertThat(time_label.text, Eventually(Equals("00:00:05")))
160 self.assertThat(time_label.text, Eventually(Equals("00:00:10")))
161 self.assertThat(time_label.text, Eventually(Equals("00:00:15")))
162 self.assertThat(time_label.text, Eventually(Equals("00:00:20")))
163 self.assertThat(time_label.text, Eventually(Equals("00:00:25")))
164
168 controls = self.main_window.get_object("Controls", "controls")165 controls = self.main_window.get_object("Controls", "controls")
169 self.assertProperty(controls, visible=False)166 self.assertProperty(controls, visible=False)
170 self.assertThat(controls.visible, Eventually(Equals(True)))167 self.assertThat(controls.visible, Eventually(Equals(True)))
171168
=== modified file 'tests/videos/small.mp4'
172Binary files tests/videos/small.mp4 2013-05-22 18:44:21 +0000 and tests/videos/small.mp4 2013-07-02 20:05:28 +0000 differ169Binary 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