@@ -0,0 +1,161 @@
1+/*
2+ * Copyright (C) 2017 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.4
18+import Ubuntu.Components 1.3
19+import LightDM.FullLightDM 0.1 as LightDM
20+import LightDMController 0.1
21+import Unity.Application 0.1
22+import Unity.Test 0.1
23+
24+import "../../qml"
25+import "Stage"
26+
27+Rectangle {
28+ id: root
29+ color: "grey"
30+ width: units.gu(100)
31+ height: units.gu(71)
32+
33+ QtObject {
34+ id: args
35+ property bool hasFullscreen: false
36+ property bool hasFrameless: false
37+ property bool hasGeometry: true
38+ property size windowGeometry: Qt.size(root.width, root.height)
39+ property string deviceName: "desktop"
40+ property string mode: "full-greeter"
41+ }
42+ property alias applicationArguments: args
43+
44+ Component.onCompleted: {
45+ // must set the mock mode before loading the Shell
46+ LightDMController.userMode = "single";
47+ }
48+
49+ Flickable {
50+ id: controls
51+ contentHeight: controlRect.height
52+
53+ anchors.top: root.top
54+ anchors.bottom: root.bottom
55+ anchors.right: root.right
56+ width: units.gu(30)
57+
58+ Rectangle {
59+ id: controlRect
60+ anchors { left: parent.left; right: parent.right }
61+ color: "darkgrey"
62+ height: childrenRect.height + units.gu(2)
63+
64+ Column {
65+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
66+ spacing: units.gu(1)
67+
68+ Flow {
69+ spacing: units.gu(1)
70+ anchors { left: parent.left; right: parent.right }
71+
72+ Button {
73+ text: "Show Greeter"
74+ activeFocusOnPress: false
75+ onClicked: {
76+ LightDM.Greeter.showGreeter();
77+ }
78+ }
79+ Button {
80+ text: "Hide Greeter"
81+ activeFocusOnPress: false
82+ onClicked: {
83+ LightDM.Greeter.hideGreeter()
84+ }
85+ }
86+ }
87+
88+ MouseTouchEmulationCheckbox {
89+ id: mouseEmulation
90+ checked: true
91+ }
92+
93+ Row {
94+ anchors { left: parent.left; right: parent.right }
95+ CheckBox {
96+ id: autohideLauncherCheckbox
97+ onCheckedChanged: {
98+ GSettingsController.setAutohideLauncher(checked)
99+ }
100+ }
101+ Label {
102+ text: "Autohide launcher"
103+ }
104+ }
105+
106+ Label { text: "Applications"; font.bold: true }
107+
108+ Button {
109+ text: "Start all apps"
110+ width: parent.width
111+ activeFocusOnPress: false
112+ onClicked: {
113+ for (var i = 0; i < ApplicationManager.availableApplications.length; i++) {
114+ var appId = ApplicationManager.availableApplications[i];
115+ ApplicationManager.startApplication(appId)
116+ }
117+ }
118+ }
119+
120+ Repeater {
121+ id: appCheckBoxRepeater
122+ model: ApplicationManager.availableApplications
123+ ApplicationCheckBox {
124+ appId: modelData
125+ }
126+ }
127+
128+ Label {
129+ text: "Fingerprint"
130+ }
131+ Row {
132+ Button {
133+ text: "Success"
134+ onClicked: {
135+ var biometryd = testCase.findInvisibleChild(shellContainer, "biometryd");
136+ var uid = 0;
137+ for (var i = 0; i < LightDM.Users.count; i++) {
138+ if (LightDM.Users.data(i, LightDM.UserRoles.NameRole) == AccountsService.user) {
139+ uid = LightDM.Users.data(i, LightDM.UserRoles.UidRole);
140+ break;
141+ }
142+ }
143+ biometryd.operation.mockSuccess(uid);
144+ }
145+ }
146+
147+ Button {
148+ text: "Failure"
149+ onClicked: {
150+ var biometryd = testCase.findInvisibleChild(shellContainer, "biometryd");
151+ biometryd.operation.mockFailure("error");
152+ }
153+ }
154+ }
155+ }
156+ }
157+ }
158+
159+ ShellApplication {
160+ }
161+}