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
1=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
2--- tests/autopilot/unity8/shell/emulators/dash.py 2014-12-01 15:52:52 +0000
3+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-12-05 15:59:15 +0000
4@@ -90,8 +90,12 @@
5
6 def _get_scope_loader(self, scope_id):
7 try:
8- return self.dash_content_list.wait_select_single(
9- 'QQuickLoader', scopeId=scope_id)
10+ aux = self.dash_content_list.get_children_by_type('QQuickItem')[0]
11+ for l in aux.get_children_by_type('QQuickLoader'):
12+ if (l.scopeId == scope_id):
13+ return l;
14+ raise emulators.UnityEmulatorException(
15+ 'No scope found with id {0}'.format(scope_id))
16 except dbus.StateNotFoundError:
17 raise emulators.UnityEmulatorException(
18 'No scope found with id {0}'.format(scope_id))
19@@ -125,10 +129,15 @@
20 original_index = self.dash_content_list.currentIndex
21 dash_content = self.select_single(objectName="dashContent")
22 x, y, width, height = dash_content.globalRect
23- start_x = x + width / 3
24- stop_x = x + width / 3 * 2
25+ # Make the drag range be a multiple of the drag "rate" value.
26+ # Workarounds https://bugs.launchpad.net/mir/+bug/1399690
27+ rate = 10
28+ divisions = 5
29+ jump = ( width / divisions ) // rate * rate
30+ start_x = x + jump
31+ stop_x = x + jump * (divisions - 1)
32 start_y = stop_y = y + 1
33- self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
34+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
35 self.dash_content_list.currentIndex.wait_for(original_index - 1)
36
37 @autopilot_logging.log_action(logger.info)
38@@ -136,10 +145,15 @@
39 original_index = self.dash_content_list.currentIndex
40 dash_content = self.select_single(objectName="dashContent")
41 x, y, width, height = dash_content.globalRect
42- start_x = x + width / 3 * 2
43- stop_x = x + width / 3
44+ # Make the drag range be a multiple of the drag "rate" value.
45+ # Workarounds https://bugs.launchpad.net/mir/+bug/1399690
46+ rate = 10
47+ divisions = 5
48+ jump = ( width / divisions ) // rate * rate
49+ start_x = x + jump * (divisions - 1)
50+ stop_x = x + jump
51 start_y = stop_y = y + 1
52- self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
53+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y, rate)
54 self.dash_content_list.currentIndex.wait_for(original_index + 1)
55
56 def enter_search_query(self, query):

Subscribers

People subscribed via source and target branches