on xenial help sign in
make AP work again
1362258Michael Zanetti
qml/Dash/DashPreview.qml+1
@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
19
19
20Item {
20Item {
21 id: root
21 id: root
22+ objectName: "dashPreview"
22
23
23 property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
24 property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
24 property var previewData
25 property var previewData
qml/Shell.qml+2−1
@@ -38,7 +38,7 @@ FocusScope {
38 id: shell
38 id: shell
39
39
40 // this is only here to select the width / height of the window if not running fullscreen
40 // this is only here to select the width / height of the window if not running fullscreen
41− property bool tablet: true
41+ property bool tablet: false
42 width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
42 width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
43 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
43 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
44
44
@@ -50,6 +50,7 @@ FocusScope {
50 property bool dashShown: dash.shown
50 property bool dashShown: dash.shown
51
51
52 property bool sideStageEnabled: shell.width >= units.gu(60)
52 property bool sideStageEnabled: shell.width >= units.gu(60)
53+ readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
53
54
54 function activateApplication(appId) {
55 function activateApplication(appId) {
55 if (ApplicationManager.findApplication(appId)) {
56 if (ApplicationManager.findApplication(appId)) {
tests/autopilot/unity8/shell/emulators/dash.py+14−22
@@ -84,10 +84,7 @@ class Dash(emulators.UnityEmulatorBase):
84 'No scope found with id {0}'.format(scope_id))
84 'No scope found with id {0}'.format(scope_id))
85
85
86 def _get_scope_from_loader(self, loader):
86 def _get_scope_from_loader(self, loader):
87− if loader.scopeId == 'applications.scope':
88− return loader.select_single(DashApps)
89− else:
90− return loader.select_single(GenericScopeView)
87+ return loader.select_single(GenericScopeView)
91
88
92 def _open_scope_scrolling(self, scope_loader):
89 def _open_scope_scrolling(self, scope_loader):
93 scroll = self._get_scroll_direction(scope_loader)
90 scroll = self._get_scroll_direction(scope_loader)
@@ -170,7 +167,7 @@ class GenericScopeView(emulators.UnityEmulatorBase):
170 # --elopio - 2014-1-14
167 # --elopio - 2014-1-14
171 self.pointing_device.click_object(icon)
168 self.pointing_device.click_object(icon)
172 preview = self.get_root_instance().wait_select_single(
169 preview = self.get_root_instance().wait_select_single(
173− self.preview_class, isCurrent=True)
170+ objectName="dashPreview", isCurrent=True)
174 preview.showProcessingAction.wait_for(False)
171 preview.showProcessingAction.wait_for(False)
175 return preview
172 return preview
176
173
@@ -182,6 +179,18 @@ class GenericScopeView(emulators.UnityEmulatorBase):
182 raise emulators.UnityEmulatorException(
179 raise emulators.UnityEmulatorException(
183 'No category found with name {}'.format(category))
180 'No category found with name {}'.format(category))
184
181
182+ def get_applications(self, category):
183+ """Return the list of applications on a category.
184+
185+ :parameter category: The name of the category.
186+
187+ """
188+ category_element = self._get_category_element(category)
189+ application_tiles = category_element.select_many('Tile')
190+ # TODO return them on the same order they are displayed.
191+ # --elopio - 2014-1-15
192+ return [tile.text for tile in application_tiles]
193+
185
194
186class AppPreview(DashPreview):
195class AppPreview(DashPreview):
187 """Autopilot emulator for the application preview."""
196 """Autopilot emulator for the application preview."""
@@ -195,20 +204,3 @@ class AppPreview(DashPreview):
195 title=details.get('title'), publisher=details.get('subtitle'),
204 title=details.get('title'), publisher=details.get('subtitle'),
196 description=details.get('description'))
205 description=details.get('description'))
197
206
198−
199−class DashApps(GenericScopeView):
200− """Autopilot emulator for the applications scope."""
201−
202− preview_class = AppPreview
203−
204− def get_applications(self, category):
205− """Return the list of applications on a category.
206−
207− :parameter category: The name of the category.
208−
209− """
210− category_element = self._get_category_element(category)
211− application_tiles = category_element.select_many('Tile')
212− # TODO return them on the same order they are displayed.
213− # --elopio - 2014-1-15
214− return [tile.text for tile in application_tiles]
tests/autopilot/unity8/shell/emulators/main_window.py+1−1
@@ -116,4 +116,4 @@ class QQuickView(emulators.UnityEmulatorBase):
116
116
117 def get_current_focused_app_id(self):
117 def get_current_focused_app_id(self):
118 """Return the id of the focused application."""
118 """Return the id of the focused application."""
119− return self.select_single('Shell').currentFocusedAppId
119+ return self.select_single('Shell').focusedApplicationId
tests/autopilot/unity8/shell/tests/test_emulators.py+1−1
@@ -135,7 +135,7 @@ class DashEmulatorTestCase(DashBaseTestCase):
135 scope_id = 'applications.scope'
135 scope_id = 'applications.scope'
136 scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
136 scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
137 self._assert_scope_is_opened(scope, scope_id)
137 self._assert_scope_is_opened(scope, scope_id)
138− self.assertIsInstance(scope, dash_emulators.DashApps)
138+ self.assertIsInstance(scope, dash_emulators.GenericScopeView)
139
139
140
140
141class GenericScopeViewEmulatorTestCase(DashBaseTestCase):
141class GenericScopeViewEmulatorTestCase(DashBaseTestCase):