Merge lp:~barry/mediaplayer-app/py3autopilot into lp:mediaplayer-app

Proposed by Barry Warsaw
Status: Superseded
Proposed branch: lp:~barry/mediaplayer-app/py3autopilot
Merge into: lp:mediaplayer-app
Diff against target: 270 lines (+42/-44)
7 files modified
debian/changelog (+7/-0)
debian/control (+3/-3)
tests/autopilot/CMakeLists.txt (+1/-1)
tests/autopilot/mediaplayer_app/emulators/main_window.py (+3/-3)
tests/autopilot/mediaplayer_app/tests/__init__.py (+0/-1)
tests/autopilot/mediaplayer_app/tests/test_player.py (+1/-7)
tests/autopilot/mediaplayer_app/tests/test_player_with_video.py (+27/-29)
To merge this branch: bzr merge lp:~barry/mediaplayer-app/py3autopilot
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+222548@code.launchpad.net

This proposal has been superseded by a proposal from 2014-07-15.

Commit message

* Port autopilot tests to Python 3.
* Bump Standards-Version to 3.9.5.

Description of the change

  * Port autopilot tests to Python 3.
  * Bump Standards-Version to 3.9.5.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

I've kicked a new jenkins run to see what's the status of this branch.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
236. By Barry Warsaw

trunk merge

237. By Barry Warsaw

Pre-requisite branch merge.

238. By Barry Warsaw

merge trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2014-05-09 16:12:00 +0000
+++ debian/changelog 2014-06-09 19:48:39 +0000
@@ -1,3 +1,10 @@
1mediaplayer-app (0.20.5+14.10.20140502-0ubuntu4) UNRELEASED; urgency=medium
2
3 * Port autopilot tests to Python 3.
4 * Bump Standards-Version to 3.9.5.
5
6 -- Barry Warsaw <barry@ubuntu.com> Mon, 09 Jun 2014 15:47:08 -0400
7
1mediaplayer-app (0.20.5+14.10.20140502-0ubuntu3) utopic; urgency=medium8mediaplayer-app (0.20.5+14.10.20140502-0ubuntu3) utopic; urgency=medium
29
3 * Renaming dep package qtdeclarative5-qtmultimedia-plugin to10 * Renaming dep package qtdeclarative5-qtmultimedia-plugin to
411
=== modified file 'debian/control'
--- debian/control 2014-05-09 16:11:44 +0000
+++ debian/control 2014-06-09 19:48:39 +0000
@@ -8,11 +8,11 @@
8 libgl1-mesa-dev | libgl-dev,8 libgl1-mesa-dev | libgl-dev,
9 libgles2-mesa-dev,9 libgles2-mesa-dev,
10 pkg-config,10 pkg-config,
11 python,11 python3,
12 qtbase5-dev,12 qtbase5-dev,
13 qtdeclarative5-dev,13 qtdeclarative5-dev,
14 qtmultimedia5-dev,14 qtmultimedia5-dev,
15Standards-Version: 3.9.415Standards-Version: 3.9.5
16# If you don't have commit rights to lp:mediaplayer-app but need to upload16# If you don't have commit rights to lp:mediaplayer-app but need to upload
17# packaging changes, just go ahead. The developers will notice and sync17# packaging changes, just go ahead. The developers will notice and sync
18# up the code again.18# up the code again.
@@ -43,7 +43,7 @@
43 libqt5test5,43 libqt5test5,
44 libqt5widgets5,44 libqt5widgets5,
45 mediaplayer-app (>= ${source:Version}),45 mediaplayer-app (>= ${source:Version}),
46 python-autopilot,46 python3-autopilot,
47Conflicts: media-player-autopilot47Conflicts: media-player-autopilot
48Replaces: media-player-autopilot48Replaces: media-player-autopilot
49Provides: media-player-autopilot49Provides: media-player-autopilot
5050
=== modified file 'tests/autopilot/CMakeLists.txt'
--- tests/autopilot/CMakeLists.txt 2013-05-23 20:00:37 +0000
+++ tests/autopilot/CMakeLists.txt 2014-06-09 19:48:39 +0000
@@ -1,6 +1,6 @@
1set(AUTOPILOT_DIR mediaplayer_app)1set(AUTOPILOT_DIR mediaplayer_app)
22
3execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"3execute_process(COMMAND python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
4 OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)4 OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
55
6install(DIRECTORY ${AUTOPILOT_DIR}6install(DIRECTORY ${AUTOPILOT_DIR}
77
=== modified file 'tests/autopilot/mediaplayer_app/emulators/main_window.py'
--- tests/autopilot/mediaplayer_app/emulators/main_window.py 2013-10-21 11:47:18 +0000
+++ tests/autopilot/mediaplayer_app/emulators/main_window.py 2014-06-09 19:48:39 +0000
@@ -6,7 +6,7 @@
6# by the Free Software Foundation.6# by the Free Software Foundation.
77
88
9class MainWindow(object):9class MainWindow:
10 """An emulator class that makes it easy to interact with the camera-app."""10 """An emulator class that makes it easy to interact with the camera-app."""
1111
12 def __init__(self, app):12 def __init__(self, app):
@@ -17,10 +17,10 @@
17 return self.app.select_single("QQuickView")17 return self.app.select_single("QQuickView")
1818
19 def get_controls(self):19 def get_controls(self):
20 return self.app.select_single("Controls", objectName="controls")20 return self.app.select_single("Controls", objectName="controls")
2121
22 def get_video_area(self):22 def get_video_area(self):
23 return self.app.select_single("VideoPlayer", objectName="player")23 return self.app.select_single("VideoPlayer", objectName="player")
2424
25 def get_toolbar(self):25 def get_toolbar(self):
26 return self.app.select_single("GenericToolbar", objectName="toolbar")26 return self.app.select_single("GenericToolbar", objectName="toolbar")
2727
=== modified file 'tests/autopilot/mediaplayer_app/tests/__init__.py'
--- tests/autopilot/mediaplayer_app/tests/__init__.py 2013-09-04 16:25:10 +0000
+++ tests/autopilot/mediaplayer_app/tests/__init__.py 2014-06-09 19:48:39 +0000
@@ -7,7 +7,6 @@
77
8"""mediaplayer-app autopilot tests."""8"""mediaplayer-app autopilot tests."""
99
10import os.path
11import os10import os
1211
13from autopilot.input import Mouse, Touch, Pointer12from autopilot.input import Mouse, Touch, Pointer
1413
=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player.py'
--- tests/autopilot/mediaplayer_app/tests/test_player.py 2013-10-21 11:47:18 +0000
+++ tests/autopilot/mediaplayer_app/tests/test_player.py 2014-06-09 19:48:39 +0000
@@ -7,8 +7,6 @@
77
8"""Tests for the Mediaplayer App"""8"""Tests for the Mediaplayer App"""
99
10from __future__ import absolute_import
11
12from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
13from testtools.matchers import Equals11from testtools.matchers import Equals
1412
@@ -26,15 +24,11 @@
26 self.assertThat(24 self.assertThat(
27 self.main_window.get_qml_view().visible, Eventually(Equals(True)))25 self.main_window.get_qml_view().visible, Eventually(Equals(True)))
2826
29 def tearDown(self):
30 super(TestPlayer, self).tearDown()
31
32 def test_no_video_dialog_visible(self):27 def test_no_video_dialog_visible(self):
33 """ Makes sure 'No Video' dialog appears if the meidaplayer is opened28 """ Makes sure 'No Video' dialog appears if the meidaplayer is opened
34 without a video file argument.29 without a video file argument.
3530
36 """31 """
3732
38 dialog = self.main_window.get_no_video_dialog() 33 dialog = self.main_window.get_no_video_dialog()
39 self.assertThat(dialog.visible, Eventually(Equals(True)))34 self.assertThat(dialog.visible, Eventually(Equals(True)))
40
4135
=== modified file 'tests/autopilot/mediaplayer_app/tests/test_player_with_video.py'
--- tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2014-04-17 21:30:48 +0000
+++ tests/autopilot/mediaplayer_app/tests/test_player_with_video.py 2014-06-09 19:48:39 +0000
@@ -7,8 +7,6 @@
77
8"""Tests for the Mediaplayer App"""8"""Tests for the Mediaplayer App"""
99
10from __future__ import absolute_import
11
12from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
13from autopilot.platform import model11from autopilot.platform import model
14from testtools import skipIf12from testtools import skipIf
@@ -26,8 +24,9 @@
26 In the testfarm, the application may take some time to show up."""24 In the testfarm, the application may take some time to show up."""
27 def setUp(self):25 def setUp(self):
28 super(TestPlayerWithVideo, self).setUp()26 super(TestPlayerWithVideo, self).setUp()
29 print model()27 print(model())
30 if model() == 'Nexus 4' or model() == 'Galaxy Nexus' or model() == "Nexus 7 (2013) Wi-Fi" or model() == "Nexus 10":28 if model() in (
29 'Nexus 4', 'Galaxy Nexus', "Nexus 7 (2013) Wi-Fi", "Nexus 10"):
31 self.launch_app("h264.avi")30 self.launch_app("h264.avi")
32 else:31 else:
33 self.launch_app("small.ogg")32 self.launch_app("small.ogg")
@@ -37,9 +36,6 @@
37 player = self.main_window.get_player()36 player = self.main_window.get_player()
38 self.assertThat(player.playing, Eventually(Equals(True)))37 self.assertThat(player.playing, Eventually(Equals(True)))
3938
40 def tearDown(self):
41 super(TestPlayerWithVideo, self).tearDown()
42
43 def show_controls(self):39 def show_controls(self):
44 video_area = self.main_window.get_video_area()40 video_area = self.main_window.get_video_area()
45 self.pointing_device.click_object(video_area)41 self.pointing_device.click_object(video_area)
@@ -56,22 +52,20 @@
56 playback_button = self.main_window.get_playback_button()52 playback_button = self.main_window.get_playback_button()
57 player = self.main_window.get_player()53 player = self.main_window.get_player()
5854
59 """ Default state after load the video is playing and with pause55 # Default state after load the video is playing and with pause icon.
60 icon.
61 """
62 self.assertProperty(player, playing=True, paused=False)56 self.assertProperty(player, playing=True, paused=False)
63 self.assertProperty(playback_button, icon="pause")57 self.assertProperty(playback_button, icon="pause")
6458
65 self.pointing_device.click_object(playback_button)59 self.pointing_device.click_object(playback_button)
6660
67 """ First click must pause the video, change playing state and show61 # First click must pause the video, change playing state and show play
68 play icon. """62 # icon.
69 self.assertProperty(player, playing=False, paused=True)63 self.assertProperty(player, playing=False, paused=True)
70 self.assertProperty(playback_button, icon="play")64 self.assertProperty(playback_button, icon="play")
7165
72 self.pointing_device.click()66 self.pointing_device.click()
7367
74 """ Second click should change the state to playing again """68 # Second click should change the state to playing again
75 self.assertProperty(player, playing=True, paused=False)69 self.assertProperty(player, playing=True, paused=False)
76 self.assertProperty(playback_button, icon="pause")70 self.assertProperty(playback_button, icon="pause")
7771
@@ -83,14 +77,14 @@
83 scene_selector = self.main_window.get_scene_selector()77 scene_selector = self.main_window.get_scene_selector()
84 slider = self.main_window.get_slider()78 slider = self.main_window.get_slider()
8579
86 """ Default state is hide """80 # Default state is hide
87 self.assertProperty(scene_selector, visible=False)81 self.assertProperty(scene_selector, visible=False)
8882
89 """ Scene selector must apper when clicking int the slider handler """83 # Scene selector must apper when clicking int the slider handler
90 self.pointing_device.click_object(slider)84 self.pointing_device.click_object(slider)
91 self.assertProperty(scene_selector, visible=True)85 self.assertProperty(scene_selector, visible=True)
9286
93 """ click again must dismiss the scene selector """87 # click again must dismiss the scene selector
94 self.pointing_device.click()88 self.pointing_device.click()
95 self.assertProperty(scene_selector, visible=False)89 self.assertProperty(scene_selector, visible=False)
9690
@@ -104,26 +98,28 @@
104 selector = self.main_window.get_scene_selector()98 selector = self.main_window.get_scene_selector()
105 self.assertThat(selector.count, Eventually(GreaterThan(3)))99 self.assertThat(selector.count, Eventually(GreaterThan(3)))
106100
107 """ Show scene selector """101 # Show scene selector
108 self.pointing_device.click_object(slider)102 self.pointing_device.click_object(slider)
109103
110 """ Make sure that the scenes are in correct place """104 # Make sure that the scenes are in correct place
111 scene_0 = self.main_window.get_scene_0()105 scene_0 = self.main_window.get_scene_0()
112 selectorRect = selector.globalRect106 selectorRect = selector.globalRect
113 self.pointing_device.drag(107 self.pointing_device.drag(
114 selectorRect[0], selectorRect[1] + selectorRect[3] / 2,108 selectorRect[0], selectorRect[1] + selectorRect[3] // 2,
115 selectorRect[0] + selectorRect[2], selectorRect[1] + selectorRect[3] / 2)109 selectorRect[0] + selectorRect[2],
110 selectorRect[1] + selectorRect[3] // 2)
116 self.assertThat(selector.moving, Eventually(Equals(False)))111 self.assertThat(selector.moving, Eventually(Equals(False)))
117 self.assertThat(scene_0.x, Eventually(Equals(0)))112 self.assertThat(scene_0.x, Eventually(Equals(0)))
118113
119 """ Click in the second scene """114 # Click in the second scene
120 scene_2 = self.main_window.get_scene_2()115 scene_2 = self.main_window.get_scene_2()
121 self.assertThat(scene_2.ready, Eventually(Equals(True)))116 self.assertThat(scene_2.ready, Eventually(Equals(True)))
122 self.pointing_device.click_object(scene_2)117 self.pointing_device.click_object(scene_2)
123 self.assertThat(selector.currentIndex, Eventually(Equals(2)))118 self.assertThat(selector.currentIndex, Eventually(Equals(2)))
124 self.assertProperty(time_line, value=1.107)119 self.assertProperty(time_line, value=1.107)
125120
126 @skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')121 @skipIf(model() in ('Nexus 4', 'Galaxy Nexus'),
122 'Screen width not enough for seekbar')
127 def test_time_display_behavior(self):123 def test_time_display_behavior(self):
128 self.show_controls()124 self.show_controls()
129 self.pause_video()125 self.pause_video()
@@ -131,24 +127,26 @@
131 time_line = self.main_window.get_slider()127 time_line = self.main_window.get_slider()
132 time_label = self.main_window.get_time_label()128 time_label = self.main_window.get_time_label()
133129
134 """ Seek to the midle of the movie """130 # Seek to the midle of the movie
135 self.pointing_device.click_object(time_line)131 self.pointing_device.click_object(time_line)
136132
137 """ Time label must show the current video time (diff from zero or empty) """133 # Time label must show the current video time (diff from zero or empty)
138 self.assertNotEqual(time_label.text, "00:00:00")134 self.assertNotEqual(time_label.text, "00:00:00")
139 self.assertNotEqual(time_label.text, "")135 self.assertNotEqual(time_label.text, "")
140136
141 """ Click in the label to change the state """137 # Click in the label to change the state
142 self.pointing_device.click_object(time_label)138 self.pointing_device.click_object(time_label)
143139
144 """ After the click the label must show the remaning time (with '-' signal) """140 # After the click the label must show the remaning time (with '-'
141 # signal)
145 self.assertEqual(time_label.text[0:1], "-")142 self.assertEqual(time_label.text[0:1], "-")
146143
147 @skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')144 @skipIf(model() in ('Nexus 4', 'Galaxy Nexus'),
145 'Screen width not enough for seekbar')
148 def test_show_controls_at_end(self):146 def test_show_controls_at_end(self):
149 controls = self.main_window.get_controls()147 controls = self.main_window.get_controls()
150 """ The controls are invisible by default """148 # The controls are invisible by default
151 self.assertThat(controls.visible, Eventually(Equals(False)))149 self.assertThat(controls.visible, Eventually(Equals(False)))
152150
153 """ wait for video ends and control appears """151 # wait for video ends and control appears
154 self.assertThat(controls.visible, Eventually(Equals(True), timeout=35))152 self.assertThat(controls.visible, Eventually(Equals(True), timeout=35))

Subscribers

People subscribed via source and target branches