@@ -90,8 +90,12 @@ class Dash(emulators.UnityEmulatorBase):
91 def _get_scope_loader(self, scope_id):
91 def _get_scope_loader(self, scope_id):
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):
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 @@ class Dash(emulators.UnityEmulatorBase):
125 original_index = self.dash_content_list.currentIndex
129 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.globalRect
131 x, y, width, height = dash_content.globalRect
132+ # Make the drag range be a multiple of the drag "rate" value.
133+ # Workarounds https://bugs.launchpad.net/mir/+bug/1399690
136+ jump = ( width / divisions ) // rate * rate
128− start_x = x + width / 3
137+ start_x = x + jump
129− stop_x = x + width / 3 * 2
138+ stop_x = x + jump * (divisions - 1)
130 start_y = stop_y = y + 1
139 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)
134 @autopilot_logging.log_action(logger.info)
143 @autopilot_logging.log_action(logger.info)
@@ -136,10 +145,15 @@ class Dash(emulators.UnityEmulatorBase):
136 original_index = self.dash_content_list.currentIndex
145 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.globalRect
147 x, y, width, height = dash_content.globalRect
148+ # Make the drag range be a multiple of the drag "rate" value.
149+ # Workarounds https://bugs.launchpad.net/mir/+bug/1399690
152+ jump = ( width / divisions ) // rate * rate
139− start_x = x + width / 3 * 2
153+ start_x = x + jump * (divisions - 1)
140− stop_x = x + width / 3
154+ stop_x = x + jump
141 start_y = stop_y = y + 1
155 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)
145 def enter_search_query(self, query):
159 def enter_search_query(self, query):