on xenial help sign in
make AP work again
commit136225827c239dd0839ad4ee9edb8a5a9480ce4c authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 24 Mar 2014, 16:10 (13 years ago) parent607a0aa
5 files changed+19−25
qml/Dash/DashPreview.qml+1 qml/Shell.qml+2−1 tests/autopilot/unity8/shell/emulators/dash.py+14−22 tests/autopilot/unity8/shell/emulators/main_window.py+1−1 tests/autopilot/unity8/shell/tests/test_emulators.py+1−1
qml/Dash/DashPreview.qml+1
@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
1919
2020Item {
2121 id: root
22+ objectName: "dashPreview"
2223
2324 property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
2425 property var previewData
qml/Shell.qml+2−1
@@ -38,7 +38,7 @@ FocusScope {
3838 id: shell
3939
4040 // 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
4242 width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
4343 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
4444
@@ -50,6 +50,7 @@ FocusScope {
5050 property bool dashShown: dash.shown
5151
5252 property bool sideStageEnabled: shell.width >= units.gu(60)
53+ readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
5354
5455 function activateApplication(appId) {
5556 if (ApplicationManager.findApplication(appId)) {
tests/autopilot/unity8/shell/emulators/dash.py+14−22
@@ -84,10 +84,7 @@ class Dash(emulators.UnityEmulatorBase):
8484 'No scope found with id {0}'.format(scope_id))
8585
8686 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)
9188
9289 def _open_scope_scrolling(self, scope_loader):
9390 scroll = self._get_scroll_direction(scope_loader)
@@ -170,7 +167,7 @@ class GenericScopeView(emulators.UnityEmulatorBase):
170167 # --elopio - 2014-1-14
171168 self.pointing_device.click_object(icon)
172169 preview = self.get_root_instance().wait_select_single(
173− self.preview_class, isCurrent=True)
170+ objectName="dashPreview", isCurrent=True)
174171 preview.showProcessingAction.wait_for(False)
175172 return preview
176173
@@ -182,6 +179,18 @@ class GenericScopeView(emulators.UnityEmulatorBase):
182179 raise emulators.UnityEmulatorException(
183180 'No category found with name {}'.format(category))
184181
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+
185194
186195class AppPreview(DashPreview):
187196 """Autopilot emulator for the application preview."""
@@ -195,20 +204,3 @@ class AppPreview(DashPreview):
195204 title=details.get('title'), publisher=details.get('subtitle'),
196205 description=details.get('description'))
197206
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):
116116
117117 def get_current_focused_app_id(self):
118118 """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):
135135 scope_id = 'applications.scope'
136136 scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
137137 self._assert_scope_is_opened(scope, scope_id)
138− self.assertIsInstance(scope, dash_emulators.DashApps)
138+ self.assertIsInstance(scope, dash_emulators.GenericScopeView)
139139
140140
141141class GenericScopeViewEmulatorTestCase(DashBaseTestCase):