Merge lp:~om26er/camera-app/fix_failing_test_device into lp:camera-app

Proposed by Omer Akram
Status: Merged
Approved by: Ugo Riboni
Approved revision: 138
Merged at revision: 137
Proposed branch: lp:~om26er/camera-app/fix_failing_test_device
Merge into: lp:camera-app
Diff against target: 72 lines (+16/-12)
3 files modified
tests/autopilot/camera_app/emulators/main_window.py (+5/-7)
tests/autopilot/camera_app/tests/test_flash.py (+6/-0)
tests/autopilot/camera_app/tests/test_zoom.py (+5/-5)
To merge this branch: bzr merge lp:~om26er/camera-app/fix_failing_test_device
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+168675@code.launchpad.net

Commit message

fixes a slider related failing test on the touch devices.

Description of the change

fixes camera_app.tests.test_zoom.TestCameraZoom.test_slider on touch devices.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
137. By Omer Akram

replace is with ==

138. By Omer Akram

also fix second failing jenkins test

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

Looks good to me (and to jenkins)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/camera_app/emulators/main_window.py'
2--- tests/autopilot/camera_app/emulators/main_window.py 2013-03-27 13:36:09 +0000
3+++ tests/autopilot/camera_app/emulators/main_window.py 2013-06-11 16:02:25 +0000
4@@ -69,11 +69,9 @@
5 return self.app.select_single("ToolbarButton", objectName="swapButton")
6
7 def get_orientation(self):
8- controls = self.app.select_single("Item", objectName="controlsArea")
9- if controls:
10- if math.fabs(controls.rotation) == 90:
11- return 'landscape'
12- else:
13- return 'portrait'
14- return ''
15+ orientation = self.app.select_single("DeviceOrientation")
16+ if orientation.isLandscape == True:
17+ return 'landscape'
18+ else:
19+ return 'portrait'
20
21
22=== modified file 'tests/autopilot/camera_app/tests/test_flash.py'
23--- tests/autopilot/camera_app/tests/test_flash.py 2013-05-25 07:16:22 +0000
24+++ tests/autopilot/camera_app/tests/test_flash.py 2013-06-11 16:02:25 +0000
25@@ -78,12 +78,18 @@
26 def test_remember_state(self):
27 flash_button = self.main_window.get_flash_button()
28 record_button = self.main_window.get_record_control()
29+ initial_flash_state = flash_button.flashState
30
31 # Change flash mode, then switch to camera, then back to flash
32 # and verify that previous state is preserved
33 self.pointing_device.move_to_object(flash_button)
34 self.pointing_device.click()
35+ self.assertThat(
36+ flash_button.flashState, Eventually(NotEquals(initial_flash_state)))
37+ second_flash_state = flash_button.flashState
38 self.pointing_device.click()
39+ self.assertThat(
40+ flash_button.flashState, Eventually(NotEquals(second_flash_state)))
41 old_flash_state = flash_button.flashState
42
43 self.pointing_device.move_to_object(record_button)
44
45=== modified file 'tests/autopilot/camera_app/tests/test_zoom.py'
46--- tests/autopilot/camera_app/tests/test_zoom.py 2013-05-25 07:16:22 +0000
47+++ tests/autopilot/camera_app/tests/test_zoom.py 2013-06-11 16:02:25 +0000
48@@ -36,10 +36,10 @@
49 zoom_control = self.main_window.get_zoom_control()
50 zoom_button = self.main_window.get_zoom_slider_button()
51
52- x, y, h, w = zoom_button.globalRect
53+ x, y, w, h = zoom_button.globalRect
54
55- tx = x + (h / 2)
56- ty = y + (w / 2)
57+ tx = x + (w / 2)
58+ ty = y + (h / 2)
59
60 if self.main_window.get_orientation() == "portrait":
61 self.pointing_device.drag(tx, ty, (tx + zoom_control.width), ty)
62@@ -49,8 +49,8 @@
63 self.assertThat(
64 zoom_control.value, Eventually(Equals(zoom_control.maximumValue)))
65
66- tx = x + (h / 2)
67- ty = y + (w / 2)
68+ tx = x + (w / 2)
69+ ty = y + (h / 2)
70
71 if self.main_window.get_orientation() == "portrait":
72 self.pointing_device.drag(tx, ty, (tx - zoom_control.width), ty)

Subscribers

People subscribed via source and target branches