on xenial help sign in
merge prereqs
7e4b5edMichael Zanetti
qml/Stages/DesktopStage.qml+13−10
@@ -24,13 +24,12 @@ import "../Components/PanelState"
24import Utils 0.1
24import Utils 0.1
25import Ubuntu.Gestures 0.1
25import Ubuntu.Gestures 0.1
26
26
27−FocusScope {
27+Rectangle {
28 id: root
28 id: root
29
29
30 anchors.fill: parent
30 anchors.fill: parent
31
31
32 property alias background: wallpaper.source
32 property alias background: wallpaper.source
33− property var windowStateStorage: WindowStateStorage
34 property bool altTabPressed: false
33 property bool altTabPressed: false
35
34
36 onAltTabPressedChanged: {
35 onAltTabPressedChanged: {
@@ -96,7 +95,16 @@ FocusScope {
96 id: priv
95 id: priv
97
96
98 readonly property string focusedAppId: ApplicationManager.focusedApplicationId
97 readonly property string focusedAppId: ApplicationManager.focusedApplicationId
99− readonly property var focusedAppDelegate: focusedAppId ? appRepeater.itemAt(indexOf(focusedAppId)) : null
98+ readonly property var focusedAppDelegate: {
99+ var index = indexOf(focusedAppId);
100+ return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
101+ }
102+
103+ onFocusedAppDelegateChanged: {
104+ if (focusedAppDelegate) {
105+ focusedAppDelegate.focus = true;
106+ }
107+ }
100
108
101 function indexOf(appId) {
109 function indexOf(appId) {
102 for (var i = 0; i < ApplicationManager.count; i++) {
110 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -221,7 +229,7 @@ FocusScope {
221 resizeHandleWidth: units.gu(0.5)
229 resizeHandleWidth: units.gu(0.5)
222 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
230 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
223
231
224− onPressed: decoratedWindow.focus = true;
232+ onPressed: appDelegate.focus = true;
225 }
233 }
226
234
227 DecoratedWindow {
235 DecoratedWindow {
@@ -232,12 +240,7 @@ FocusScope {
232 windowHeight: appDelegate.height
240 windowHeight: appDelegate.height
233 application: ApplicationManager.get(index)
241 application: ApplicationManager.get(index)
234 active: ApplicationManager.focusedApplicationId === model.appId
242 active: ApplicationManager.focusedApplicationId === model.appId
235−
236− onFocusChanged: {
237− if (focus) {
243+ focus: false
238− ApplicationManager.focusApplication(model.appId);
239− }
240− }
241
244
242 onClose: ApplicationManager.stopApplication(model.appId)
245 onClose: ApplicationManager.stopApplication(model.appId)
243 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
246 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
qml/Stages/PhoneStage.qml+4−4
@@ -117,14 +117,14 @@ Rectangle {
117
117
118 readonly property int firstSpreadIndex: root.focusFirstApp ? 1 : 0
118 readonly property int firstSpreadIndex: root.focusFirstApp ? 1 : 0
119 property string focusedAppId: applicationManager.focusedApplicationId
119 property string focusedAppId: applicationManager.focusedApplicationId
120− property var focusedApplication: applicationManager.findApplication(focusedAppId)
120+ readonly property var focusedAppDelegate: {
121− property var focusedAppDelegate: null
121+ var index = indexOf(focusedAppId);
122+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
123+ }
122
124
123 property real oldInverseProgress: 0
125 property real oldInverseProgress: 0
124 property bool animateX: false
126 property bool animateX: false
125
127
126− onFocusedAppIdChanged: focusedAppDelegate = spreadRepeater.itemAt(0);
127−
128 onFocusedAppDelegateChanged: {
128 onFocusedAppDelegateChanged: {
129 if (focusedAppDelegate) {
129 if (focusedAppDelegate) {
130 focusedAppDelegate.focus = true;
130 focusedAppDelegate.focus = true;
qml/Stages/TabletStage.qml+10−11
@@ -53,6 +53,11 @@ Rectangle {
53 id: priv
53 id: priv
54
54
55 property string focusedAppId: ApplicationManager.focusedApplicationId
55 property string focusedAppId: ApplicationManager.focusedApplicationId
56+ readonly property var focusedAppDelegate: {
57+ var index = indexOf(focusedAppId);
58+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
59+ }
60+
56 property string oldFocusedAppId: ""
61 property string oldFocusedAppId: ""
57
62
58 property string mainStageAppId
63 property string mainStageAppId
@@ -76,19 +81,11 @@ Rectangle {
76
81
77 appId0 = ApplicationManager.count >= 1 ? ApplicationManager.get(0).appId : "";
82 appId0 = ApplicationManager.count >= 1 ? ApplicationManager.get(0).appId : "";
78 appId1 = ApplicationManager.count > 1 ? ApplicationManager.get(1).appId : "";
83 appId1 = ApplicationManager.count > 1 ? ApplicationManager.get(1).appId : "";
79−
80− // Update the QML focus accordingly
81− updateSpreadDelegateFocus();
82 }
84 }
83
85
84− function updateSpreadDelegateFocus() {
86+ onFocusedAppDelegateChanged: {
85− if (priv.focusedAppId) {
87+ if (focusedAppDelegate) {
86− var focusedAppIndex = priv.indexOf(priv.focusedAppId);
88+ focusedAppDelegate.focus = true;
87− if (focusedAppIndex !== -1) {
88− spreadRepeater.itemAt(focusedAppIndex).focus = true;
89− } else {
90− console.warn("TabletStage: Failed to find the SpreadDelegate for appID=" + priv.focusedAppId);
91− }
92 }
89 }
93 }
90 }
94
91
@@ -495,6 +492,8 @@ Rectangle {
495
492
496 delegate: TransformedTabletSpreadDelegate {
493 delegate: TransformedTabletSpreadDelegate {
497 id: spreadTile
494 id: spreadTile
495+ objectName: model.appId ? "tabletSpreadDelegate_" + model.appId
496+ : "tabletSpreadDelegate_null";
498 height: spreadView.height
497 height: spreadView.height
499 width: model.stage == ApplicationInfoInterface.MainStage ? spreadView.width : spreadView.sideStageWidth
498 width: model.stage == ApplicationInfoInterface.MainStage ? spreadView.width : spreadView.sideStageWidth
500 active: model.appId == priv.mainStageAppId || model.appId == priv.sideStageAppId
499 active: model.appId == priv.mainStageAppId || model.appId == priv.sideStageAppId
tests/mocks/Utils/HomeKeyWatcher.qmlnew file+21
@@ -0,0 +1,21 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+
19+QtObject {
20+ signal activated()
21+}
tests/mocks/Utils/plugin.cpp+15−2
@@ -1,5 +1,9 @@
1/*
1/*
2+<<<<<<< TREE
2 * Copyright (C) 2012 Canonical, Ltd.
3 * Copyright (C) 2012 Canonical, Ltd.
4+=======
5+ * Copyright (C) 2015 Canonical, Ltd.
6+>>>>>>> MERGE-SOURCE
3 *
7 *
4 * This program is free software; you can redistribute it and/or modify
8 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
9 * it under the terms of the GNU General Public License as published by
@@ -20,10 +24,9 @@
20#include <QQmlContext>
24#include <QQmlContext>
21#include <QtQuick/QQuickWindow>
25#include <QtQuick/QQuickWindow>
22#include <QDebug>
26#include <QDebug>
23−// self
24−#include "plugin.h"
25
27
26// local
28// local
29+#include "plugin.h"
27#include "inputwatcher.h"
30#include "inputwatcher.h"
28#include "qlimitproxymodelqml.h"
31#include "qlimitproxymodelqml.h"
29#include "unitysortfilterproxymodelqml.h"
32#include "unitysortfilterproxymodelqml.h"
@@ -36,6 +39,16 @@
36#include "spreadflickable.h"
39#include "spreadflickable.h"
37#include "constants.h"
40#include "constants.h"
38
41
42+// plugin
43+#include <inputwatcher.h>
44+#include <qlimitproxymodelqml.h>
45+#include <unitysortfilterproxymodelqml.h>
46+#include <relativetimeformatter.h>
47+#include <timeformatter.h>
48+#include <unitymenumodelpaths.h>
49+#include <windowkeysfilter.h>
50+#include <easingcurve.h>
51+
39static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
52static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
40{
53{
41 Q_UNUSED(engine)
54 Q_UNUSED(engine)
tests/mocks/Utils/plugin.h+1−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2012 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
tests/mocks/Utils/qmldir+1
@@ -2,3 +2,4 @@ module Utils
2plugin FakeUtils-qml
2plugin FakeUtils-qml
3typeinfo Utils.qmltypes
3typeinfo Utils.qmltypes
4Style 0.1 Style.js
4Style 0.1 Style.js
5+HomeKeyWatcher 0.1 HomeKeyWatcher.qml
tests/qmltests/Stages/tst_DesktopStage.qml+29−8
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013,2014 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -95,9 +95,6 @@ Rectangle {
95
95
96 property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
96 property Item desktopStage: desktopStageLoader.status === Loader.Ready ? desktopStageLoader.item : null
97
97
98− function init() {
99− }
100−
101 function cleanup() {
98 function cleanup() {
102 desktopStageLoader.itemDestroyed = false;
99 desktopStageLoader.itemDestroyed = false;
103 desktopStageLoader.active = false;
100 desktopStageLoader.active = false;
@@ -163,14 +160,38 @@ Rectangle {
163 tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
160 tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
164 }
161 }
165
162
166− function test_decorationPressFocusesApplication_data() {
163+ function test_tappingOnWindowChangesFocusedApp_data() {
164+ return [
165+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
166+ {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
167+ ]
168+ }
169+
170+ function test_tappingOnWindowChangesFocusedApp(data) {
171+ var i;
172+ for (i = 0; i < data.apps.length; i++) {
173+ startApplication(data.apps[i]);
174+ }
175+
176+ var fromAppWindow = findChild(desktopStage, "appWindow_" + data.apps[data.focusfrom]);
177+ verify(fromAppWindow);
178+ tap(fromAppWindow);
179+ compare(fromAppWindow.application.session.surface.activeFocus, true);
180+
181+ var toAppWindow = findChild(desktopStage, "appWindow_" + data.apps[data.focusTo]);
182+ verify(toAppWindow);
183+ tap(toAppWindow);
184+ compare(toAppWindow.application.session.surface.activeFocus, true);
185+ }
186+
187+ function test_tappingOnDecorationFocusesApplication_data() {
167 return [
188 return [
168 {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
189 {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 0, focusTo: 1 },
169 {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
190 {tag: "dash", apps: [ "unity8-dash", "dialer-app", "camera-app" ], focusfrom: 1, focusTo: 0 },
170 ]
191 ]
171 }
192 }
172
193
173− function test_decorationPressFocusesApplication(data) {
194+ function test_tappingOnDecorationFocusesApplication(data) {
174 var i;
195 var i;
175 for (i = 0; i < data.apps.length; i++) {
196 for (i = 0; i < data.apps.length; i++) {
176 startApplication(data.apps[i]);
197 startApplication(data.apps[i]);
@@ -178,12 +199,12 @@ Rectangle {
178
199
179 var fromAppDecoration = findChild(desktopStage, "appWindowDecoration_" + data.apps[data.focusfrom]);
200 var fromAppDecoration = findChild(desktopStage, "appWindowDecoration_" + data.apps[data.focusfrom]);
180 verify(fromAppDecoration);
201 verify(fromAppDecoration);
181− mouseClick(fromAppDecoration);
202+ tap(fromAppDecoration);
182 tryCompare(ApplicationManager.findApplication(data.apps[data.focusfrom]).session.surface, "activeFocus", true);
203 tryCompare(ApplicationManager.findApplication(data.apps[data.focusfrom]).session.surface, "activeFocus", true);
183
204
184 var toAppDecoration = findChild(desktopStage, "appWindowDecoration_" + data.apps[data.focusTo]);
205 var toAppDecoration = findChild(desktopStage, "appWindowDecoration_" + data.apps[data.focusTo]);
185 verify(toAppDecoration);
206 verify(toAppDecoration);
186− mouseClick(toAppDecoration);
207+ tap(toAppDecoration);
187 tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
208 tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
188 }
209 }
189 }
210 }
tests/qmltests/tst_Shell.qml+134−84
@@ -138,92 +138,105 @@ Rectangle {
138 }
138 }
139 }
139 }
140
140
141− Rectangle {
141+ Flickable {
142 id: controls
142 id: controls
143− color: "darkgrey"
143+ contentHeight: controlRect.height
144− width: units.gu(30)
144+
145 anchors.top: root.top
145 anchors.top: root.top
146 anchors.bottom: root.bottom
146 anchors.bottom: root.bottom
147 anchors.right: root.right
147 anchors.right: root.right
148+ width: units.gu(30)
148
149
149− Column {
150+ Rectangle {
151+ id: controlRect
150− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
152+ anchors { left: parent.left; right: parent.right }
151− spacing: units.gu(1)
153+ color: "darkgrey"
152− Row {
154+ height: childrenRect.height + units.gu(2)
153− Button {
154− text: "Show Greeter"
155− activeFocusOnPress: false
156− onClicked: {
157− if (shellLoader.status !== Loader.Ready)
158− return;
159
155
156+ Column {
157+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
158+ spacing: units.gu(1)
159+
160+ Row {
161+ spacing: units.gu(1)
162+ Button {
163+ text: "Show Greeter"
164+ activeFocusOnPress: false
165+ onClicked: {
166+ if (shellLoader.status !== Loader.Ready)
167+ return;
168+
160− var greeter = testCase.findChild(shellLoader.item, "greeter");
169+ var greeter = testCase.findChild(shellLoader.item, "greeter");
161− if (!greeter.shown) {
170+ if (!greeter.shown) {
162− LightDM.Greeter.showGreeter();
171+ LightDM.Greeter.showGreeter();
172+ }
173+ }
174+ }
175+ Button {
176+ text: "Hide Greeter"
177+ activeFocusOnPress: false
178+ onClicked: {
179+ if (shellLoader.status !== Loader.Ready)
180+ return;
181+
182+ var greeter = testCase.findChild(shellLoader.item, "greeter");
183+ if (greeter.shown) {
184+ greeter.hide()
185+ }
163 }
186 }
164 }
187 }
165 }
188 }
166− Button {
189+ ListItem.ItemSelector {
167− text: "Hide Greeter"
190+ anchors { left: parent.left; right: parent.right }
168 activeFocusOnPress: false
191 activeFocusOnPress: false
169− onClicked: {
192+ text: "LightDM mock mode"
193+ model: ["single", "single-passphrase", "single-pin", "full"]
194+ onSelectedIndexChanged: {
170− if (shellLoader.status !== Loader.Ready)
195+ shellLoader.active = false;
171− return;
196+ LightDM.Greeter.mockMode = model[selectedIndex];
172−
197+ LightDM.Users.mockMode = model[selectedIndex];
173− var greeter = testCase.findChild(shellLoader.item, "greeter");
198+ shellLoader.active = true;
174− if (greeter.shown) {
175− greeter.hide()
176− }
177 }
199 }
178 }
200 }
179− }
180− ListItem.ItemSelector {
201+ ListItem.ItemSelector {
181− anchors { left: parent.left; right: parent.right }
202+ anchors { left: parent.left; right: parent.right }
182− activeFocusOnPress: false
203+ activeFocusOnPress: false
183− text: "LightDM mock mode"
204+ text: "Size"
184− model: ["single", "single-passphrase", "single-pin", "full"]
205+ model: ["phone", "tablet", "desktop"]
185− onSelectedIndexChanged: {
206+ onSelectedIndexChanged: {
186− shellLoader.active = false;
207+ shellLoader.active = false;
187− LightDM.Greeter.mockMode = model[selectedIndex];
188− LightDM.Users.mockMode = model[selectedIndex];
208+ shellLoader.state = model[selectedIndex];
189− shellLoader.active = true;
209+ shellLoader.active = true;
210+ }
190 }
211 }
191− }
192− ListItem.ItemSelector {
212+ ListItem.ItemSelector {
213+ id: usageModeSelector
193− anchors { left: parent.left; right: parent.right }
214+ anchors { left: parent.left; right: parent.right }
194− activeFocusOnPress: false
215+ activeFocusOnPress: false
195− text: "Size"
216+ text: "Usage mode"
196− model: ["phone", "tablet", "desktop"]
217+ model: ["Staged", "Windowed"]
197− onSelectedIndexChanged: {
218+ onSelectedIndexChanged: {
198− shellLoader.active = false;
199− shellLoader.state = model[selectedIndex];
219+ GSettingsController.setUsageMode(model[selectedIndex]);
200− shellLoader.active = true;
220+ }
201 }
221 }
202− }
203− MouseTouchEmulationCheckbox {
222+ MouseTouchEmulationCheckbox {
204− id: mouseEmulation
223+ id: mouseEmulation
205− checked: true
224+ checked: true
206− color: "white"
225+ color: "white"
207− }
226+ }
227+
228+ Label { text: "Applications"; font.bold: true }
208
229
209− Button {
230+ Button {
210− anchors { left: parent.left; right: parent.right }
211− text: "Start all apps"
231+ text: "Start all apps"
232+ width: parent.width
212− onClicked: {
233+ onClicked: {
213− for (var i = 0; i < appRepeater.count; i++) {
234+ for (var i = 0; i < ApplicationManager.availableApplications.length; i++) {
214− var appId = ApplicationManager.availableApplications[i]
235+ var appId = ApplicationManager.availableApplications[i];
215− if (!ApplicationManager.findApplication(appId)) {
216 ApplicationManager.startApplication(appId)
236 ApplicationManager.startApplication(appId)
217 }
237 }
218 }
238 }
219 }
239 }
220− }
221−
222− Column {
223− anchors { left: parent.left; right: parent.right }
224− spacing: units.gu(1)
225−
226− Label { text: "Applications"; font.bold: true }
227
240
228 Repeater {
241 Repeater {
229 id: appRepeater
242 id: appRepeater
@@ -313,6 +326,7 @@ Rectangle {
313 mouseEmulation.checked = true;
326 mouseEmulation.checked = true;
314 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
327 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
315 tearDown();
328 tearDown();
329+ GSettingsController.setUsageMode("Staged");
316 }
330 }
317
331
318 function loadShell(formFactor) {
332 function loadShell(formFactor) {
@@ -759,23 +773,57 @@ Rectangle {
759
773
760 function test_launchedAppHasActiveFocus_data() {
774 function test_launchedAppHasActiveFocus_data() {
761 return [
775 return [
762− {tag: "phone", formFactor: "phone"},
776+ {tag: "phone", formFactor: "phone", usageMode: "Staged"},
763− {tag: "tablet", formFactor: "tablet"},
777+ {tag: "tablet", formFactor: "tablet", usageMode: "Staged"},
764− {tag: "desktop", formFactor: "desktop"}
778+ {tag: "desktop", formFactor: "tablet", usageMode: "Windowed"}
765− ];
779+ ]
766 }
780 }
767
781
768 function test_launchedAppHasActiveFocus(data) {
782 function test_launchedAppHasActiveFocus(data) {
783+ GSettingsController.setUsageMode(data.usageMode);
769 loadShell(data.formFactor);
784 loadShell(data.formFactor);
770 swipeAwayGreeter();
785 swipeAwayGreeter();
771
786
772− var dialerApp = ApplicationManager.startApplication("webbrowser-app");
787+ var webApp = ApplicationManager.startApplication("webbrowser-app");
773− verify(dialerApp);
788+ verify(webApp);
789+ waitUntilAppSurfaceShowsUp("webbrowser-app")
790+
791+ verify(webApp.session.surface);
792+
793+ tryCompare(webApp.session.surface, "activeFocus", true);
794+ }
795+
796+ function test_launchedAppKeepsActiveFocusOnUsageModeChange() {
797+ loadShell("tablet");
798+ swipeAwayGreeter();
799+
800+ var webApp = ApplicationManager.startApplication("webbrowser-app");
801+ verify(webApp);
774 waitUntilAppSurfaceShowsUp("webbrowser-app")
802 waitUntilAppSurfaceShowsUp("webbrowser-app")
775
803
776− verify(dialerApp.session.surface);
804+ verify(webApp.session.surface);
805+
806+ tryCompare(webApp.session.surface, "activeFocus", true);
807+
808+ GSettingsController.setUsageMode("Windowed");
809+
810+ // check that the desktop stage and window have been loaded
811+ {
812+ var desktopWindow = findChild(shell, "decoratedWindow_webbrowser-app");
813+ verify(desktopWindow);
814+ }
815+
816+ tryCompare(webApp.session.surface, "activeFocus", true);
777
817
818+ GSettingsController.setUsageMode("Staged");
819+
820+ // check that the tablet stage and app surface delegate have been loaded
821+ {
822+ var desktopWindow = findChild(shell, "tabletSpreadDelegate_webbrowser-app");
823+ verify(desktopWindow);
824+ }
825+
778− tryCompare(dialerApp.session.surface, "activeFocus", true);
826+ tryCompare(webApp.session.surface, "activeFocus", true);
779 }
827 }
780
828
781 function waitUntilAppSurfaceShowsUp(appId) {
829 function waitUntilAppSurfaceShowsUp(appId) {
@@ -1261,31 +1309,33 @@ Rectangle {
1261
1309
1262 function test_stageLoader_data() {
1310 function test_stageLoader_data() {
1263 return [
1311 return [
1264− {tag: "phone", source: "Stages/PhoneStage.qml"},
1312+ {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageMode: "Staged"},
1265− {tag: "tablet", source: "Stages/TabletStage.qml"},
1313+ {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageMode: "Staged"},
1266− {tag: "desktop", source: "Stages/DesktopStage.qml"}
1314+ {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageMode: "Windowed"}
1267 ]
1315 ]
1268 }
1316 }
1269
1317
1270 function test_stageLoader(data) {
1318 function test_stageLoader(data) {
1319+ GSettingsController.setUsageMode(data.usageMode);
1271− loadShell(data.tag);
1320+ loadShell(data.formFactor);
1272 var stageLoader = findChild(shell, "applicationsDisplayLoader");
1321 var stageLoader = findChild(shell, "applicationsDisplayLoader");
1273 verify(String(stageLoader.source).indexOf(data.source) >= 0);
1322 verify(String(stageLoader.source).indexOf(data.source) >= 0);
1274 }
1323 }
1275
1324
1276 function test_launcherInverted_data() {
1325 function test_launcherInverted_data() {
1277 return [
1326 return [
1278− {tag: "phone", formFactor: "phone"},
1327+ {tag: "phone", formFactor: "phone", usageMode: "Staged", launcherInverted: true},
1279− {tag: "tablet", formFactor: "tablet"},
1328+ {tag: "tablet", formFactor: "tablet", usageMode: "Staged", launcherInverted: true},
1280− {tag: "desktop", formFactor: "desktop"}
1329+ {tag: "desktop", formFactor: "tablet", usageMode: "Windowed", launcherInverted: false}
1281− ];
1330+ ]
1282 }
1331 }
1283
1332
1284 function test_launcherInverted(data) {
1333 function test_launcherInverted(data) {
1334+ GSettingsController.setUsageMode(data.usageMode);
1285 loadShell(data.formFactor);
1335 loadShell(data.formFactor);
1286
1336
1287 var launcher = findChild(shell, "launcher");
1337 var launcher = findChild(shell, "launcher");
1288− compare(launcher.inverted, data.formFactor !== "desktop");
1338+ compare(launcher.inverted, data.launcherInverted);
1289 }
1339 }
1290 }
1340 }
1291}
1341}