Merge lp:~aacid/unity8/autopilot_drag_more into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1464
Merged at revision: 1512
Proposed branch: lp:~aacid/unity8/autopilot_drag_more
Merge into: lp:unity8
Diff against target: 56 lines (+22/-8)
1 file modified
tests/autopilot/unity8/shell/emulators/dash.py (+22/-8)
To merge this branch: bzr merge lp:~aacid/unity8/autopilot_drag_more
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Andrea Cimitan (community) Needs Fixing
Review via email: mp+243367@code.launchpad.net

Commit message

Make the drag range be a multiple of the drag "rate" value. Workarounds https://bugs.launchpad.net/mir/+bug/1399690

Also small fixlet to make _get_scope_loader faster

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~aacid/unity8/autopilot_drag_more updated
1462. By Albert Astals Cid

Some debug, let's see what is going on on CI

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) :
review: Needs Fixing
lp:~aacid/unity8/autopilot_drag_more updated
1463. By Albert Astals Cid

Make the dragged distance be a multiple of the dragged area

This is a workaround for a bug in if the last remaining bit of dragging
is just 1 pixel to the left of one of the multiples the drag seems to go back

I've traced this as far as the bug seems to be in /dev/uinput or the input layer in mir
so filed a bug for it and workarounding it here for the test

1464. By Albert Astals Cid

Add the comment here too

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

The test in question passes now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
--- tests/autopilot/unity8/shell/emulators/dash.py 2014-12-01 15:52:52 +0000
+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-12-05 15:59:15 +0000
@@ -90,8 +90,12 @@
9090
91 def _get_scope_loader(self, scope_id):91 def _get_scope_loader(self, scope_id):
92 try:92 try:
93 return self.dash_content_list.wait_select_single(93 aux = self.dash_content_list.get_children_by_type('QQuickItem')[0]
94 'QQuickLoader', scopeId=scope_id)94 for l in aux.get_children_by_type('QQuickLoader'):
95 if (l.scopeId == scope_id):
96 return l;
97 raise emulators.UnityEmulatorException(
98 'No scope found with id {0}'.format(scope_id))
95 except dbus.StateNotFoundError:99 except dbus.StateNotFoundError:
96 raise emulators.UnityEmulatorException(100 raise emulators.UnityEmulatorException(
97 'No scope found with id {0}'.format(scope_id))101 'No scope found with id {0}'.format(scope_id))
@@ -125,10 +129,15 @@
125 original_index = self.dash_content_list.currentIndex129 original_index = self.dash_content_list.currentIndex
126 dash_content = self.select_single(objectName="dashContent")130 dash_content = self.select_single(objectName="dashContent")
127 x, y, width, height = dash_content.globalRect131 x, y, width, height = dash_content.globalRect
128 start_x = x + width / 3132 # Make the drag range be a multiple of the drag "rate" value.
129 stop_x = x + width / 3 * 2133 # Workarounds https://bugs.launchpad.net/mir/+bug/1399690
134 rate = 10
135 divisions = 5
136 jump = ( width / divisions ) // rate * rate
137 start_x = x + jump
138 stop_x = x + jump * (divisions - 1)
130 start_y = stop_y = y + 1139 start_y = stop_y = y + 1
131 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)140 self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
132 self.dash_content_list.currentIndex.wait_for(original_index - 1)141 self.dash_content_list.currentIndex.wait_for(original_index - 1)
133142
134 @autopilot_logging.log_action(logger.info)143 @autopilot_logging.log_action(logger.info)
@@ -136,10 +145,15 @@
136 original_index = self.dash_content_list.currentIndex145 original_index = self.dash_content_list.currentIndex
137 dash_content = self.select_single(objectName="dashContent")146 dash_content = self.select_single(objectName="dashContent")
138 x, y, width, height = dash_content.globalRect147 x, y, width, height = dash_content.globalRect
139 start_x = x + width / 3 * 2148 # Make the drag range be a multiple of the drag "rate" value.
140 stop_x = x + width / 3149 # Workarounds https://bugs.launchpad.net/mir/+bug/1399690
150 rate = 10
151 divisions = 5
152 jump = ( width / divisions ) // rate * rate
153 start_x = x + jump * (divisions - 1)
154 stop_x = x + jump
141 start_y = stop_y = y + 1155 start_y = stop_y = y + 1
142 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)156 self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
143 self.dash_content_list.currentIndex.wait_for(original_index + 1)157 self.dash_content_list.currentIndex.wait_for(original_index + 1)
144158
145 def enter_search_query(self, query):159 def enter_search_query(self, query):

Subscribers

People subscribed via source and target branches