Merge lp:~mterry/unity8/greeter-mock-bg into lp:unity8

Proposed by Michael Terry on 2016-08-04
Status: Superseded
Proposed branch: lp:~mterry/unity8/greeter-mock-bg
Merge into: lp:unity8
Diff against target: 209 lines (+60/-8)
8 files modified
debian/rules (+3/-2)
tests/mocks/AccountsService/AccountsService.cpp (+19/-3)
tests/mocks/AccountsService/AccountsService.h (+3/-0)
tests/mocks/AccountsService/CMakeLists.txt (+14/-0)
tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.cpp (+5/-0)
tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.h (+2/-0)
tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp (+12/-1)
tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp (+2/-2)
To merge this branch: bzr merge lp:~mterry/unity8/greeter-mock-bg
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing on 2016-08-05
Daniel d'Andrada (community) 2016-08-04 Approve on 2016-08-04
Review via email: mp+302030@code.launchpad.net

This proposal has been superseded by a proposal from 2016-08-11.

Commit Message

Fix tryShell to actually show appropriate backgrounds for each mock user.

Description of the Change

This only affects the mocks. Backgrounds are pulled from AccountsService, but the data is set in liblightdm. Previously, they weren't connected.

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 I'm on the team

 * If you changed the UI, has there been a design review?
 NA

To post a comment you must log in.
Daniel d'Andrada (dandrader) wrote :

* Did you perform an exploratory manual test run of the code change and any related functionality?
Works fine in "make tryShell"

* Did CI run pass? If not, please explain why.
No results yet.

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2553
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1882/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2457/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2485
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2372
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2372
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2372
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2365/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2365/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2365/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2365/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2365/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2365/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2365/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2365/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2365/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1882/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/greeter-mock-bg updated on 2016-08-04
2554. By Michael Terry on 2016-08-04

Fix deb build

Michael Terry (mterry) wrote :

Whoops, updated debian/rules to match changes, so the debuild succeeds.

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2554
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1888/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2463
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1340/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1340/console
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1340
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2491
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2378
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2378
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2378
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2371/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2371/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2371/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2371/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2371/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2371/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2371/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2371/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2371
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2371/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1888/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/greeter-mock-bg updated on 2016-08-05
2555. By Michael Terry on 2016-08-05

Fix usersmodel test

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2555
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1895/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2470
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1344
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1344
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1344
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2498
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2385
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2385
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2385
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2378/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2378/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2378/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2378/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2378/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2378/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2378/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2378/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2378
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2378/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1895/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/greeter-mock-bg updated on 2016-09-06
2556. By Michael Terry on 2016-08-11

Merge greeter-apps

2557. By Michael Terry on 2016-08-11

Merge greeter-apps

2558. By Michael Terry on 2016-08-22

Just always link to mock liblightdm, especially now that our mock AS module needs it

2559. By Michael Terry on 2016-08-22

Don't set mock backgrounds if none exist

2560. By Michael Terry on 2016-08-30

Merge greeter-apps

2561. By Michael Terry on 2016-09-06

Merge greeter-apps

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/rules'
2--- debian/rules 2016-06-20 14:56:40 +0000
3+++ debian/rules 2016-08-05 12:55:42 +0000
4@@ -37,6 +37,7 @@
5 override_dh_makeshlibs:
6 dh_makeshlibs -Nunity8-private -Nunity8-fake-env
7
8-# libMockLightDM-qml.so links against liblightdm-qt5-3.so which doesn't exist
9 override_dh_shlibdeps:
10- dh_shlibdeps -XlibMockLightDM-qml.so
11+ # Some mock libraries link against liblightdm-qt5-3.so which we want to
12+ # avoid, since we only really link against our mock one, not the system one.
13+ dh_shlibdeps -XlibMockLightDM-qml.so -XlibMockAccountsService-qml.so
14
15=== modified file 'tests/mocks/AccountsService/AccountsService.cpp'
16--- tests/mocks/AccountsService/AccountsService.cpp 2016-06-20 15:24:27 +0000
17+++ tests/mocks/AccountsService/AccountsService.cpp 2016-08-05 12:55:42 +0000
18@@ -15,7 +15,9 @@
19 */
20
21 #include "AccountsService.h"
22+#include "MockUsersModel.h"
23
24+#include <QLightDM/UsersModel>
25 #include <paths.h>
26
27 AccountsService::AccountsService(QObject* parent)
28@@ -23,15 +25,17 @@
29 m_enableFingerprintIdentification(true),
30 m_enableLauncherWhileLocked(true),
31 m_enableIndicatorsWhileLocked(true),
32- m_backgroundFile(qmlDirectory() + "/graphics/phone_background.jpg"),
33+ m_backgroundFile(),
34 m_statsWelcomeScreen(true),
35 m_failedLogins(0),
36 m_failedFingerprintLogins(0),
37 m_demoEdges(false),
38 m_demoEdgesCompleted(),
39 m_hereEnabled(false),
40- m_hereLicensePath("")
41+ m_hereLicensePath(""),
42+ m_usersModel(new MockUsersModel(this))
43 {
44+ m_usersModel->setMockMode("full");
45 }
46
47 QString AccountsService::user() const
48@@ -44,6 +48,7 @@
49 m_user = user;
50 Q_EMIT userChanged();
51 Q_EMIT passwordDisplayHintChanged();
52+ Q_EMIT backgroundFileChanged();
53 }
54
55 bool AccountsService::demoEdges() const
56@@ -111,7 +116,18 @@
57
58 QString AccountsService::backgroundFile() const
59 {
60- return m_backgroundFile;
61+ if (!m_backgroundFile.isEmpty()) {
62+ return m_backgroundFile;
63+ }
64+
65+ // Check if our mock user has a background set in liblightdm
66+ for (int i = 0; i < m_usersModel->count(); i++) {
67+ if (m_usersModel->data(i, QLightDM::UsersModel::NameRole) == m_user) {
68+ return m_usersModel->data(i, QLightDM::UsersModel::BackgroundPathRole).toString();
69+ }
70+ }
71+
72+ return QString();
73 }
74
75 void AccountsService::setBackgroundFile(const QString &backgroundFile)
76
77=== modified file 'tests/mocks/AccountsService/AccountsService.h'
78--- tests/mocks/AccountsService/AccountsService.h 2016-06-20 15:24:27 +0000
79+++ tests/mocks/AccountsService/AccountsService.h 2016-08-05 12:55:42 +0000
80@@ -22,6 +22,8 @@
81 #include <QStringList>
82 #include <QVariant>
83
84+class MockUsersModel;
85+
86 class AccountsService: public QObject
87 {
88 Q_OBJECT
89@@ -163,6 +165,7 @@
90 QString m_realName;
91 QStringList m_kbdMap;
92 QString m_email;
93+ MockUsersModel *m_usersModel;
94 };
95
96 #endif
97
98=== modified file 'tests/mocks/AccountsService/CMakeLists.txt'
99--- tests/mocks/AccountsService/CMakeLists.txt 2014-07-02 16:17:14 +0000
100+++ tests/mocks/AccountsService/CMakeLists.txt 2016-08-05 12:55:42 +0000
101@@ -1,10 +1,24 @@
102+include_directories(
103+ ${CMAKE_CURRENT_BINARY_DIR}
104+ ${CMAKE_SOURCE_DIR}/plugins/LightDM
105+ ${CMAKE_SOURCE_DIR}/plugins/Utils
106+ ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM/IntegratedLightDM
107+ )
108+
109 add_library(MockAccountsService-qml MODULE
110+ ${CMAKE_SOURCE_DIR}/plugins/LightDM/UsersModel.cpp
111+ ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
112+ ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.cpp
113 AccountsService.cpp
114 plugin.cpp
115 )
116
117 qt5_use_modules(MockAccountsService-qml DBus Qml)
118
119+target_link_libraries(MockAccountsService-qml
120+ MockLightDM
121+ )
122+
123 add_unity8_mock(AccountsService 0.1 AccountsService
124 PREFIX mocks
125 TARGETS MockAccountsService-qml
126
127=== modified file 'tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.cpp'
128--- tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.cpp 2015-09-25 13:01:00 +0000
129+++ tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.cpp 2016-08-05 12:55:42 +0000
130@@ -19,6 +19,11 @@
131 #include <QLightDM/UsersModel>
132 #include <QSortFilterProxyModel>
133
134+MockUsersModel::MockUsersModel(QObject* parent)
135+ : UsersModel(parent)
136+{
137+}
138+
139 QString MockUsersModel::mockMode() const
140 {
141 QLightDM::UsersModel* qUsersModel =
142
143=== modified file 'tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.h'
144--- tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.h 2015-09-25 13:01:00 +0000
145+++ tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.h 2016-08-05 12:55:42 +0000
146@@ -27,6 +27,8 @@
147 Q_PROPERTY(QString mockMode READ mockMode WRITE setMockMode NOTIFY mockModeChanged)
148
149 public:
150+ explicit MockUsersModel(QObject* parent=0);
151+
152 QString mockMode() const;
153 void setMockMode(QString mockMode);
154
155
156=== modified file 'tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp'
157--- tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp 2016-06-30 15:49:16 +0000
158+++ tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp 2016-08-05 12:55:42 +0000
159@@ -17,6 +17,8 @@
160 #include "UsersModelPrivate.h"
161 #include "UsersModel.h"
162
163+#include <QDir>
164+
165 namespace QLightDM
166 {
167
168@@ -53,6 +55,15 @@
169 entries[i].uid = i + 1;
170 }
171
172+ // Assign backgrounds
173+ QDir backgroundDir("/usr/share/backgrounds");
174+ QStringList backgrounds = backgroundDir.entryList(QDir::Files);
175+ for (int i = 0; i < entries.size(); i++) {
176+ if (entries[i].background.isNull()) {
177+ entries[i].background = backgroundDir.filePath(backgrounds[i % backgrounds.size()]);
178+ }
179+ }
180+
181 q->endResetModel();
182 }
183
184@@ -96,7 +107,7 @@
185 { "wide-info-prompt", "Wide Info Prompt", 0, 0, false, false, "ubuntu", 0 },
186 { "multi-info-prompt", "Multi Info Prompt", 0, 0, false, false, "ubuntu", 0 },
187 { "long-name", "Long name (far far too long to fit, seriously this would never fit on the screen, you will never see this part of the name)", 0, 0, false, false, "ubuntu", 0 },
188- { "color-background", "Color Background", "#dd4814", 0, false, false, "ubuntu", 0 },
189+ { "color-background", "Color Background", "#E95420", 0, false, false, "ubuntu", 0 },
190 // white and black are a bit redundant, but useful for manually testing if UI is still readable
191 { "white-background", "White Background", "#ffffff", 0, false, false, "ubuntu", 0 },
192 { "black-background", "Black Background", "#000000", 0, false, false, "ubuntu", 0 },
193
194=== modified file 'tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp'
195--- tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp 2015-09-28 18:00:44 +0000
196+++ tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp 2016-08-05 12:55:42 +0000
197@@ -59,10 +59,10 @@
198 void testMangleColor()
199 {
200 QString background = getStringValue(sourceModel, "color-background", QLightDM::UsersModel::BackgroundPathRole);
201- QVERIFY(background == "#dd4814");
202+ QVERIFY(background == "#E95420");
203
204 background = getStringValue(model, "color-background", QLightDM::UsersModel::BackgroundPathRole);
205- QVERIFY(background == "data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>");
206+ QVERIFY(background == "data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#E95420'/></svg>");
207 }
208
209 void testMangleEmptyName()

Subscribers

People subscribed via source and target branches