on xenial help sign in
Use LightDMController plugin from Albert
c5ae041Michael Terry
plugins/LightDM/CMakeLists.txt−1
@@ -7,7 +7,6 @@ include_directories(
7 ${CMAKE_CURRENT_SOURCE_DIR}
7 ${CMAKE_CURRENT_SOURCE_DIR}
8 ${CMAKE_CURRENT_BINARY_DIR}
8 ${CMAKE_CURRENT_BINARY_DIR}
9 ${CMAKE_SOURCE_DIR}/plugins/Utils
9 ${CMAKE_SOURCE_DIR}/plugins/Utils
10− ${CMAKE_BINARY_DIR}/tests/mocks/LightDM/IntegratedLightDM
11 ${libunity8-private_SOURCE_DIR}
10 ${libunity8-private_SOURCE_DIR}
12 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
11 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
13)
12)
plugins/LightDM/Greeter.cpp−6
@@ -147,9 +147,3 @@ void Greeter::authenticationCompleteFilter()
147 Q_EMIT isAuthenticatedChanged();
147 Q_EMIT isAuthenticatedChanged();
148 Q_EMIT authenticationComplete();
148 Q_EMIT authenticationComplete();
149}
149}
150−
151−QObject *Greeter::mock()
152−{
153− Q_D(Greeter);
154− return d->m_greeter->property("mock").value<QObject*>();
155−}
plugins/LightDM/Greeter.h−4
@@ -39,8 +39,6 @@ class Greeter : public QObject
39 Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)
39 Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)
40 Q_PROPERTY(QString selectUser READ selectUser CONSTANT)
40 Q_PROPERTY(QString selectUser READ selectUser CONSTANT)
41
41
42− Q_PROPERTY(QObject *mock READ mock CONSTANT) // for testing
43−
44public:
42public:
45 explicit Greeter(QObject* parent=0);
43 explicit Greeter(QObject* parent=0);
46
44
@@ -51,8 +49,6 @@ public:
51 bool promptless() const;
49 bool promptless() const;
52 QString selectUser() const;
50 QString selectUser() const;
53
51
54− QObject *mock();
55−
56public Q_SLOTS:
52public Q_SLOTS:
57 void authenticate(const QString &username=QString());
53 void authenticate(const QString &username=QString());
58 void respond(const QString &response);
54 void respond(const QString &response);
plugins/LightDM/SessionsModel.cpp−5
@@ -111,11 +111,6 @@ QVariant SessionsModel::data(const QModelIndex& index, int role) const
111 }
111 }
112}
112}
113
113
114−QObject *SessionsModel::mock()
115−{
116− return m_model->property("mock").value<QObject*>();
117−}
118−
119SessionsModel::SessionsModel(QObject* parent)
114SessionsModel::SessionsModel(QObject* parent)
120 : UnitySortFilterProxyModelQML(parent)
115 : UnitySortFilterProxyModelQML(parent)
121{
116{
plugins/LightDM/SessionsModel.h−4
@@ -32,8 +32,6 @@ class SessionsModel : public UnitySortFilterProxyModelQML
32 Q_PROPERTY(QList<QUrl> iconSearchDirectories READ iconSearchDirectories
32 Q_PROPERTY(QList<QUrl> iconSearchDirectories READ iconSearchDirectories
33 WRITE setIconSearchDirectories NOTIFY iconSearchDirectoriesChanged)
33 WRITE setIconSearchDirectories NOTIFY iconSearchDirectoriesChanged)
34
34
35− Q_PROPERTY(QObject *mock READ mock CONSTANT) // for testing
36−
37Q_SIGNALS:
35Q_SIGNALS:
38 void iconSearchDirectoriesChanged();
36 void iconSearchDirectoriesChanged();
39
37
@@ -58,8 +56,6 @@ public:
58
56
59 void setIconSearchDirectories(const QList<QUrl> searchDirectories);
57 void setIconSearchDirectories(const QList<QUrl> searchDirectories);
60
58
61− QObject *mock();
62−
63private:
59private:
64 QLightDM::SessionsModel* m_model;
60 QLightDM::SessionsModel* m_model;
65 QHash<int, QByteArray> m_roleNames;
61 QHash<int, QByteArray> m_roleNames;
plugins/LightDM/UsersModel.cpp−7
@@ -68,11 +68,4 @@ UsersModel::UsersModel(QObject* parent)
68 sort(0);
68 sort(0);
69}
69}
70
70
71−QObject *UsersModel::mock()
72−{
73− // get through MangleModel down to QLightDM::UsersModel
74− MangleModel *mangleModel = static_cast<MangleModel*>(sourceModel());
75− return mangleModel->sourceModel()->property("mock").value<QObject*>();
76−}
77−
78#include "UsersModel.moc"
71#include "UsersModel.moc"
plugins/LightDM/UsersModel.h−4
@@ -27,10 +27,6 @@ class UsersModel : public UnitySortFilterProxyModelQML
27{
27{
28 Q_OBJECT
28 Q_OBJECT
29
29
30− Q_PROPERTY(QObject *mock READ mock CONSTANT) // for testing
31−
32public:
30public:
33 explicit UsersModel(QObject* parent=0);
31 explicit UsersModel(QObject* parent=0);
34−
35− QObject *mock();
36};
32};
tests/mocks/CMakeLists.txt+1
@@ -35,6 +35,7 @@ add_subdirectory(GSettings.1.0)
35add_subdirectory(indicator-service)
35add_subdirectory(indicator-service)
36add_subdirectory(liblightdm)
36add_subdirectory(liblightdm)
37add_subdirectory(libusermetrics)
37add_subdirectory(libusermetrics)
38+add_subdirectory(LightDMController)
38add_subdirectory(Lights)
39add_subdirectory(Lights)
39add_subdirectory(MeeGo)
40add_subdirectory(MeeGo)
40add_subdirectory(Powerd)
41add_subdirectory(Powerd)
tests/mocks/LightDMController/CMakeLists.txtnew file+15
@@ -0,0 +1,15 @@
1+add_library(LightDMController MODULE
2+ plugin.cpp
3+ )
4+
5+target_include_directories(LightDMController PUBLIC
6+ ${CMAKE_SOURCE_DIR}/tests/mocks/liblightdm/
7+ )
8+
9+target_link_libraries(LightDMController
10+ MockLightDM
11+ )
12+
13+qt5_use_modules(LightDMController Qml)
14+
15+add_unity8_mock(LightDMController 0.1 LightDMController TARGETS LightDMController)
tests/mocks/LightDMController/plugin.cppnew file+34
@@ -0,0 +1,34 @@
1+/*
2+ * Copyright (C) 2016 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+#include "plugin.h"
18+
19+#include "MockController.h"
20+
21+#include <QtQml/qqml.h>
22+
23+static QObject *mock_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
24+{
25+ Q_UNUSED(engine)
26+ Q_UNUSED(scriptEngine)
27+ return QLightDM::MockController::instance();
28+}
29+
30+void LightDMControllerPlugin::registerTypes(const char *uri)
31+{
32+ Q_ASSERT(uri == QLatin1String("LightDMController"));
33+ qmlRegisterSingletonType<QLightDM::MockController>(uri, 0, 1, "LightDMController", mock_provider);
34+}
tests/mocks/LightDMController/plugin.hnew file+29
@@ -0,0 +1,29 @@
1+/*
2+ * Copyright (C) 2016 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+#pragma once
18+
19+#include <QQmlEngine>
20+#include <QQmlExtensionPlugin>
21+
22+class LightDMControllerPlugin : public QQmlExtensionPlugin
23+{
24+ Q_OBJECT
25+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26+
27+public:
28+ void registerTypes(const char *uri) override;
29+};
tests/mocks/LightDMController/qmldirnew file+2
@@ -0,0 +1,2 @@
1+module LightDMController
2+plugin LightDMController
tests/mocks/liblightdm/MockGreeter.cpp−5
@@ -248,9 +248,4 @@ void Greeter::sendAuthenticationComplete()
248 }
248 }
249}
249}
250
250
251−QObject *Greeter::mock()
252−{
253− return MockController::instance();
254−}
255−
256}
251}
tests/mocks/liblightdm/MockGreeter.h−4
@@ -42,8 +42,6 @@ class Q_DECL_EXPORT Greeter : public QObject
42
42
43 Q_ENUMS(PromptType MessageType)
43 Q_ENUMS(PromptType MessageType)
44
44
45− Q_PROPERTY(QObject *mock READ mock CONSTANT) // only in mock
46−
47public:
45public:
48 enum PromptType {
46 enum PromptType {
49 PromptTypeQuestion,
47 PromptTypeQuestion,
@@ -75,8 +73,6 @@ public:
75 QString authenticationUser() const;
73 QString authenticationUser() const;
76 QString hostname() const;
74 QString hostname() const;
77
75
78− QObject *mock();
79−
80public Q_SLOTS:
76public Q_SLOTS:
81 bool connectSync();
77 bool connectSync();
82 void authenticate(const QString &username=QString());
78 void authenticate(const QString &username=QString());
tests/mocks/liblightdm/MockSessionsModel.cpp−5
@@ -114,9 +114,4 @@ void SessionsModel::resetEntries()
114 endResetModel();
114 endResetModel();
115}
115}
116
116
117−QObject *SessionsModel::mock()
118−{
119− return MockController::instance();
120−}
121−
122} // namespace QLightDM
117} // namespace QLightDM
tests/mocks/liblightdm/MockSessionsModel.h−4
@@ -30,8 +30,6 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
30 {
30 {
31 Q_OBJECT
31 Q_OBJECT
32
32
33− Q_PROPERTY(QObject *mock READ mock CONSTANT) // only in mock
34−
35 Q_ENUMS(SessionModelRoles SessionType)
33 Q_ENUMS(SessionModelRoles SessionType)
36
34
37 public:
35 public:
@@ -56,8 +54,6 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
56 int rowCount(const QModelIndex& parent) const override;
54 int rowCount(const QModelIndex& parent) const override;
57 QVariant data(const QModelIndex& index, int role) const override;
55 QVariant data(const QModelIndex& index, int role) const override;
58
56
59− QObject *mock();
60−
61 private Q_SLOTS:
57 private Q_SLOTS:
62 void resetEntries();
58 void resetEntries();
63
59
tests/mocks/liblightdm/MockUsersModel.cpp−5
@@ -183,9 +183,4 @@ void UsersModel::resetEntries()
183 endResetModel();
183 endResetModel();
184}
184}
185
185
186−QObject *UsersModel::mock()
187−{
188− return MockController::instance();
189−}
190−
191}
186}
tests/mocks/liblightdm/MockUsersModel.h−4
@@ -31,8 +31,6 @@ class Q_DECL_EXPORT UsersModel : public QAbstractListModel
31
31
32 Q_ENUMS(UserModelRoles)
32 Q_ENUMS(UserModelRoles)
33
33
34− Q_PROPERTY(QObject *mock READ mock CONSTANT) // only in mock
35−
36public:
34public:
37 explicit UsersModel(QObject *parent = 0);
35 explicit UsersModel(QObject *parent = 0);
38 virtual ~UsersModel();
36 virtual ~UsersModel();
@@ -51,8 +49,6 @@ public:
51 int rowCount(const QModelIndex &parent) const override;
49 int rowCount(const QModelIndex &parent) const override;
52 QVariant data(const QModelIndex &index, int role) const override;
50 QVariant data(const QModelIndex &index, int role) const override;
53
51
54− QObject *mock();
55−
56private Q_SLOTS:
52private Q_SLOTS:
57 void resetEntries();
53 void resetEntries();
58
54
tests/plugins/LightDM/IntegratedLightDM/CMakeLists.txt+1
@@ -58,6 +58,7 @@ target_include_directories(GreeterSessionsModelTestExec PUBLIC
58 ${CMAKE_SOURCE_DIR}/plugins/LightDM
58 ${CMAKE_SOURCE_DIR}/plugins/LightDM
59 ${CMAKE_SOURCE_DIR}/plugins/Utils
59 ${CMAKE_SOURCE_DIR}/plugins/Utils
60 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM/IntegratedLightDM
60 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM/IntegratedLightDM
61+ ${CMAKE_SOURCE_DIR}/tests/mocks/liblightdm/
61 )
62 )
62add_unity8_uitest(GreeterSessions GreeterSessionsModelTestExec
63add_unity8_uitest(GreeterSessions GreeterSessionsModelTestExec
63 DEPENDS MockLightDM
64 DEPENDS MockLightDM
tests/plugins/LightDM/IntegratedLightDM/sessionsmodel.cpp+3−1
@@ -16,6 +16,8 @@
16
16
17#include "SessionsModel.h"
17#include "SessionsModel.h"
18
18
19+#include "MockController.h"
20+
19#include <QLightDM/SessionsModel>
21#include <QLightDM/SessionsModel>
20#include <QtCore/QModelIndex>
22#include <QtCore/QModelIndex>
21#include <QtTest>
23#include <QtTest>
@@ -31,7 +33,7 @@ private Q_SLOTS:
31 {
33 {
32 model = new SessionsModel();
34 model = new SessionsModel();
33 QVERIFY(model);
35 QVERIFY(model);
34− mock = model->mock();
36+ mock = QLightDM::MockController::instance();
35 QVERIFY(mock);
37 QVERIFY(mock);
36 }
38 }
37
39
tests/qmltests/Greeter/tst_Greeter.qml+5−4
@@ -22,6 +22,7 @@ import Ubuntu.Components 1.3
22import AccountsService 0.1
22import AccountsService 0.1
23import Biometryd 0.0
23import Biometryd 0.0
24import GSettings 1.0
24import GSettings 1.0
25+import LightDMController 0.1
25import LightDM.FullLightDM 0.1 as LightDM
26import LightDM.FullLightDM 0.1 as LightDM
26import Unity.Test 0.1 as UT
27import Unity.Test 0.1 as UT
27
28
@@ -143,7 +144,7 @@ Item {
143
144
144 function init() {
145 function init() {
145 greeterSettings.lockedOutTime = 0;
146 greeterSettings.lockedOutTime = 0;
146− LightDM.Greeter.mock.selectUserHint = "";
147+ LightDMController.selectUserHint = "";
147 greeter.failedLoginsDelayAttempts = 7;
148 greeter.failedLoginsDelayAttempts = 7;
148 greeter.failedLoginsDelayMinutes = 5;
149 greeter.failedLoginsDelayMinutes = 5;
149 teaseSpy.clear();
150 teaseSpy.clear();
@@ -567,20 +568,20 @@ Item {
567 }
568 }
568
569
569 function test_selectUserHint() {
570 function test_selectUserHint() {
570− LightDM.Greeter.mock.selectUserHint = "info-prompt";
571+ LightDMController.selectUserHint = "info-prompt";
571 resetLoader();
572 resetLoader();
572 var i = verifySelected("info-prompt");
573 var i = verifySelected("info-prompt");
573 verify(i != 0); // sanity-check that info-prompt isn't default 0 answer
574 verify(i != 0); // sanity-check that info-prompt isn't default 0 answer
574 }
575 }
575
576
576 function test_selectUserHintUnset() {
577 function test_selectUserHintUnset() {
577− LightDM.Greeter.mock.selectUserHint = "";
578+ LightDMController.selectUserHint = "";
578 resetLoader();
579 resetLoader();
579 verifySelected(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
580 verifySelected(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
580 }
581 }
581
582
582 function test_selectUserHintInvalid() {
583 function test_selectUserHintInvalid() {
583− LightDM.Greeter.mock.selectUserHint = "not-a-real-user";
584+ LightDMController.selectUserHint = "not-a-real-user";
584 resetLoader();
585 resetLoader();
585 verifySelected(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
586 verifySelected(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
586 }
587 }
tests/qmltests/Greeter/tst_WideView.qml+12−11
@@ -18,6 +18,7 @@ import QtQuick 2.4
18import QtTest 1.0
18import QtTest 1.0
19import ".."
19import ".."
20import "../../../qml/Greeter"
20import "../../../qml/Greeter"
21+import LightDMController 0.1
21import LightDM.FullLightDM 0.1 as LightDM
22import LightDM.FullLightDM 0.1 as LightDM
22import Ubuntu.Components 1.3
23import Ubuntu.Components 1.3
23import Unity.Test 0.1 as UT
24import Unity.Test 0.1 as UT
@@ -265,15 +266,15 @@ StyledItem {
265 id: multipleSessionsCheckbox
266 id: multipleSessionsCheckbox
266 onClicked: {
267 onClicked: {
267 if (checked) {
268 if (checked) {
268− LightDM.Sessions.mock.sessionMode = "full";
269+ LightDMController.sessionMode = "full";
269 } else {
270 } else {
270− LightDM.Sessions.mock.sessionMode = "single";
271+ LightDMController.sessionMode = "single";
271 }
272 }
272 }
273 }
273 Connections {
274 Connections {
274 target: LightDM.Sessions.mock
275 target: LightDM.Sessions.mock
275 onSessionModeChanged: {
276 onSessionModeChanged: {
276− if (LightDM.Sessions.mock.sessionMode === "full") {
277+ if (LightDMController.sessionMode === "full") {
277 multipleSessionsCheckbox.checked = true;
278 multipleSessionsCheckbox.checked = true;
278 } else {
279 } else {
279 multipleSessionsCheckbox.checked = false;
280 multipleSessionsCheckbox.checked = false;
@@ -291,9 +292,9 @@ StyledItem {
291
292
292 width: units.gu(10)
293 width: units.gu(10)
293 minimumValue: 0
294 minimumValue: 0
294− maximumValue: LightDM.Sessions.mock.numAvailableSessions
295+ maximumValue: LightDMController.numAvailableSessions
295− value: LightDM.Sessions.mock.numSessions
296+ value: LightDMController.numSessions
296− visible: LightDM.Sessions.mock.sessionMode === "full"
297+ visible: LightDMController.sessionMode === "full"
297 Binding {
298 Binding {
298 target: LightDM.Sessions.mock
299 target: LightDM.Sessions.mock
299 property: "numSessions"
300 property: "numSessions"
@@ -362,7 +363,7 @@ StyledItem {
362 respondedSpy.clear();
363 respondedSpy.clear();
363 teaseSpy.clear();
364 teaseSpy.clear();
364 emergencySpy.clear();
365 emergencySpy.clear();
365− LightDM.Sessions.mock.sessionMode = "full";
366+ LightDMController.sessionMode = "full";
366 LightDM.Sessions.iconSearchDirectories = [testIconDirectory];
367 LightDM.Sessions.iconSearchDirectories = [testIconDirectory];
367 }
368 }
368
369
@@ -467,12 +468,12 @@ StyledItem {
467 }
468 }
468
469
469 function test_noSessionsDoesntBreakView() {
470 function test_noSessionsDoesntBreakView() {
470− LightDM.Sessions.mock.sessionMode = "none";
471+ LightDMController.sessionMode = "none";
471 compare(LightDM.Sessions.count, 0)
472 compare(LightDM.Sessions.count, 0)
472 }
473 }
473
474
474 function test_sessionIconNotShownWithOneSession() {
475 function test_sessionIconNotShownWithOneSession() {
475− LightDM.Sessions.mock.sessionMode = "single";
476+ LightDMController.sessionMode = "single";
476 compare(LightDM.Sessions.count, 1);
477 compare(LightDM.Sessions.count, 1);
477
478
478 var sessionChooserButton = findChild(view, "sessionChooserButton");
479 var sessionChooserButton = findChild(view, "sessionChooserButton");
@@ -480,7 +481,7 @@ StyledItem {
480 }
481 }
481
482
482 function test_sessionIconNotShownWithActiveUser() {
483 function test_sessionIconNotShownWithActiveUser() {
483− LightDM.Sessions.mock.sessionMode = "full";
484+ LightDMController.sessionMode = "full";
484 compare(LightDM.Sessions.count > 1, true);
485 compare(LightDM.Sessions.count > 1, true);
485
486
486 selectUser("active");
487 selectUser("active");
@@ -490,7 +491,7 @@ StyledItem {
490 }
491 }
491
492
492 function test_sessionIconShownWithMultipleSessions() {
493 function test_sessionIconShownWithMultipleSessions() {
493− LightDM.Sessions.mock.sessionMode = "full";
494+ LightDMController.sessionMode = "full";
494 compare(LightDM.Sessions.count > 1, true);
495 compare(LightDM.Sessions.count > 1, true);
495
496
496 selectUser("has-password");
497 selectUser("has-password");
tests/qmltests/Tutorial/tst_Tutorial.qml+2−1
@@ -17,6 +17,7 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import QtTest 1.0
18import QtTest 1.0
19import AccountsService 0.1
19import AccountsService 0.1
20+import LightDMController 0.1
20import LightDM.FullLightDM 0.1 as LightDM
21import LightDM.FullLightDM 0.1 as LightDM
21import Ubuntu.Components 1.3
22import Ubuntu.Components 1.3
22import Ubuntu.Components.ListItems 1.3
23import Ubuntu.Components.ListItems 1.3
@@ -85,7 +86,7 @@ Rectangle {
85
86
86 Component.onCompleted: {
87 Component.onCompleted: {
87 // must set the mock mode before loading the Shell
88 // must set the mock mode before loading the Shell
88− LightDM.Users.mock.userMode = "single-pin";
89+ LightDMController.userMode = "single-pin";
89 shellLoader.active = true;
90 shellLoader.active = true;
90 }
91 }
91
92
tests/qmltests/tst_Shell.qml+4−3
@@ -18,6 +18,7 @@ import QtQuick 2.4
18import QtTest 1.0
18import QtTest 1.0
19import AccountsService 0.1
19import AccountsService 0.1
20import GSettings 1.0
20import GSettings 1.0
21+import LightDMController 0.1
21import LightDM.FullLightDM 0.1 as LightDM
22import LightDM.FullLightDM 0.1 as LightDM
22import SessionBroadcast 0.1
23import SessionBroadcast 0.1
23import Ubuntu.Components 1.3
24import Ubuntu.Components 1.3
@@ -46,7 +47,7 @@ Rectangle {
46
47
47 Component.onCompleted: {
48 Component.onCompleted: {
48 // must set the mock mode before loading the Shell
49 // must set the mock mode before loading the Shell
49− LightDM.Users.mock.userMode = "single";
50+ LightDMController.userMode = "single";
50 shellLoader.active = true;
51 shellLoader.active = true;
51 }
52 }
52
53
@@ -227,7 +228,7 @@ Rectangle {
227 model: ["single", "single-passphrase", "single-pin", "full"]
228 model: ["single", "single-passphrase", "single-pin", "full"]
228 onSelectedIndexChanged: {
229 onSelectedIndexChanged: {
229 shellLoader.active = false;
230 shellLoader.active = false;
230− LightDM.Users.mock.userMode = model[selectedIndex];
231+ LightDMController.userMode = model[selectedIndex];
231 shellLoader.active = true;
232 shellLoader.active = true;
232 }
233 }
233 }
234 }
@@ -801,7 +802,7 @@ Rectangle {
801 }
802 }
802
803
803 function setLightDMMockMode(mode) {
804 function setLightDMMockMode(mode) {
804− LightDM.Users.mock.userMode = mode;
805+ LightDMController.userMode = mode;
805 }
806 }
806
807
807 function test_showInputMethod() {
808 function test_showInputMethod() {
tests/qmltests/tst_ShellWithPin.qml+2−1
@@ -19,6 +19,7 @@ import Ubuntu.Components 1.3
19import QtTest 1.0
19import QtTest 1.0
20import AccountsService 0.1
20import AccountsService 0.1
21import GSettings 1.0
21import GSettings 1.0
22+import LightDMController 0.1
22import LightDM.FullLightDM 0.1 as LightDM
23import LightDM.FullLightDM 0.1 as LightDM
23import Ubuntu.SystemImage 0.1
24import Ubuntu.SystemImage 0.1
24import Ubuntu.Telephony 0.1 as Telephony
25import Ubuntu.Telephony 0.1 as Telephony
@@ -35,7 +36,7 @@ Item {
35
36
36 Component.onCompleted: {
37 Component.onCompleted: {
37 // must set the mock mode before loading the Shell
38 // must set the mock mode before loading the Shell
38− LightDM.Users.mock.userMode = "single-pin";
39+ LightDMController.userMode = "single-pin";
39 shellLoader.active = true;
40 shellLoader.active = true;
40 }
41 }
41
42