Merge lp:~mterry/unity8/notify-authenticated into lp:unity8

Proposed by Michael Terry
Status: Superseded
Proposed branch: lp:~mterry/unity8/notify-authenticated
Merge into: lp:unity8
Diff against target: 558 lines (+368/-1)
21 files modified
plugins/LightDM/Greeter.cpp (+2/-0)
plugins/LightDM/Greeter.h (+2/-1)
plugins/Ubuntu/CMakeLists.txt (+1/-0)
plugins/Ubuntu/Connectivity/CMakeLists.txt (+10/-0)
plugins/Ubuntu/Connectivity/Connectivity.cpp (+33/-0)
plugins/Ubuntu/Connectivity/Connectivity.h (+33/-0)
plugins/Ubuntu/Connectivity/Connectivity.qmltypes (+17/-0)
plugins/Ubuntu/Connectivity/plugin.cpp (+34/-0)
plugins/Ubuntu/Connectivity/plugin.h (+31/-0)
plugins/Ubuntu/Connectivity/qmldir (+3/-0)
qml/Notifications/NotificationMenuItemFactory.qml (+5/-0)
qml/Shell.qml (+5/-0)
tests/mocks/Ubuntu/CMakeLists.txt (+1/-0)
tests/mocks/Ubuntu/Connectivity/CMakeLists.txt (+10/-0)
tests/mocks/Ubuntu/Connectivity/Connectivity.qmltypes (+18/-0)
tests/mocks/Ubuntu/Connectivity/MockConnectivity.cpp (+27/-0)
tests/mocks/Ubuntu/Connectivity/MockConnectivity.h (+36/-0)
tests/mocks/Ubuntu/Connectivity/plugin.cpp (+34/-0)
tests/mocks/Ubuntu/Connectivity/plugin.h (+31/-0)
tests/mocks/Ubuntu/Connectivity/qmldir (+3/-0)
tests/qmltests/tst_Shell.qml (+32/-0)
To merge this branch: bzr merge lp:~mterry/unity8/notify-authenticated
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+231022@code.launchpad.net

This proposal has been superseded by a proposal from 2014-08-21.

Commit message

Always keep indicator/launcher locked state in sync with whether the user is authenticated. (LP:# 1357230)

Description of the change

Always keep indicator/launcher locked state in sync with whether the user is authenticated. (LP:# 1357230)

One of the properties used to determine whether the shell is locked was not notifiable for qml. This branch fixes that.

== Checklist ==

 * 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

 * Did you make sure that your branch does not contain spurious tags?
 - Yes

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

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

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Test and fixes the issue.

Do you think an auto test for this makes sense?

review: Needs Information
Revision history for this message
Michael Terry (mterry) wrote :

> Do you think an auto test for this makes sense?

I didn't think so, because it felt like testing too small a piece. Like, we don't generally have tests to make sure a NOTIFY call works for other properties.

That said, I'd be happy to add one.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Sure, i didn't mean testing the signal works, that we know, i mean something like testing that the swiping of the greeter works.

Revision history for this message
Michael Terry (mterry) wrote :

There is a test added in https://code.launchpad.net/~mterry/unity8/interactive-while-locked/+merge/231253 for checking whether the indicators and/or launcher are enabled by default and respond to changes.

1163. By Michael Terry

Merge from trunk

1164. By Michael Terry

Add a small test to confirm that unlocked properties are correct

Revision history for this message
Michael Terry (mterry) wrote :

OK, added a test to check the unlocked property and whether the edges are enabled as they should be.

Revision history for this message
Albert Astals Cid (aacid) wrote :

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

* Did CI run pass? If not, please explain why.
Yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1165. By Michael Terry

Merge from sim-unlock-on-boot

1166. By Michael Terry

Re-merge from sim-unlock-on-boot with its lifecycle merge

Unmerged revisions

1166. By Michael Terry

Re-merge from sim-unlock-on-boot with its lifecycle merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/LightDM/Greeter.cpp'
--- plugins/LightDM/Greeter.cpp 2014-08-01 13:42:18 +0000
+++ plugins/LightDM/Greeter.cpp 2014-08-21 14:47:14 +0000
@@ -106,6 +106,7 @@
106 }106 }
107107
108 d->m_greeter->authenticate(username);108 d->m_greeter->authenticate(username);
109 Q_EMIT isAuthenticatedChanged();
109 Q_EMIT authenticationUserChanged(username);110 Q_EMIT authenticationUserChanged(username);
110}111}
111112
@@ -150,5 +151,6 @@
150 Q_EMIT promptlessChanged();151 Q_EMIT promptlessChanged();
151 }152 }
152153
154 Q_EMIT isAuthenticatedChanged();
153 Q_EMIT authenticationComplete();155 Q_EMIT authenticationComplete();
154}156}
155157
=== modified file 'plugins/LightDM/Greeter.h'
--- plugins/LightDM/Greeter.h 2014-08-01 13:42:18 +0000
+++ plugins/LightDM/Greeter.h 2014-08-21 14:47:14 +0000
@@ -35,7 +35,7 @@
35 Q_OBJECT35 Q_OBJECT
3636
37 Q_PROPERTY(bool active READ isActive WRITE setIsActive NOTIFY isActiveChanged)37 Q_PROPERTY(bool active READ isActive WRITE setIsActive NOTIFY isActiveChanged)
38 Q_PROPERTY(bool authenticated READ isAuthenticated)38 Q_PROPERTY(bool authenticated READ isAuthenticated NOTIFY isAuthenticatedChanged)
39 Q_PROPERTY(QString authenticationUser READ authenticationUser NOTIFY authenticationUserChanged)39 Q_PROPERTY(QString authenticationUser READ authenticationUser NOTIFY authenticationUserChanged)
40 Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)40 Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)
4141
@@ -59,6 +59,7 @@
59 void authenticationComplete();59 void authenticationComplete();
60 void authenticationUserChanged(const QString &user);60 void authenticationUserChanged(const QString &user);
61 void isActiveChanged();61 void isActiveChanged();
62 void isAuthenticatedChanged();
62 void promptlessChanged();63 void promptlessChanged();
63 void showGreeter();64 void showGreeter();
6465
6566
=== modified file 'plugins/Ubuntu/CMakeLists.txt'
--- plugins/Ubuntu/CMakeLists.txt 2014-07-30 11:08:29 +0000
+++ plugins/Ubuntu/CMakeLists.txt 2014-08-21 14:47:14 +0000
@@ -1,3 +1,4 @@
1add_subdirectory(Connectivity)
1add_subdirectory(Gestures)2add_subdirectory(Gestures)
2add_subdirectory(DownloadDaemonListener)3add_subdirectory(DownloadDaemonListener)
3add_subdirectory(Payments)4add_subdirectory(Payments)
45
=== added directory 'plugins/Ubuntu/Connectivity'
=== added file 'plugins/Ubuntu/Connectivity/CMakeLists.txt'
--- plugins/Ubuntu/Connectivity/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ plugins/Ubuntu/Connectivity/CMakeLists.txt 2014-08-21 14:47:14 +0000
@@ -0,0 +1,10 @@
1set(CONNECTIVITY_SOURCES
2 plugin.cpp
3 Connectivity.cpp
4)
5
6add_library(Connectivity MODULE ${CONNECTIVITY_SOURCES})
7
8qt5_use_modules(Connectivity Qml DBus Core)
9
10add_unity8_plugin(Ubuntu.Connectivity 0.1 Ubuntu/Connectivity TARGETS Connectivity)
011
=== added file 'plugins/Ubuntu/Connectivity/Connectivity.cpp'
--- plugins/Ubuntu/Connectivity/Connectivity.cpp 1970-01-01 00:00:00 +0000
+++ plugins/Ubuntu/Connectivity/Connectivity.cpp 2014-08-21 14:47:14 +0000
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2014 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 "Connectivity.h"
18#include <QDBusConnection>
19#include <QDBusInterface>
20#include <QDBusPendingCall>
21
22Connectivity::Connectivity(QObject *parent)
23 : QObject(parent)
24{
25}
26
27void Connectivity::unlockAllModems()
28{
29 QDBusInterface iface("com.ubuntu.connectivity1",
30 "/com/ubuntu/connectivity1/Private",
31 "com.ubuntu.connectivity1.Private");
32 iface.asyncCall("UnlockAllModems");
33}
034
=== added file 'plugins/Ubuntu/Connectivity/Connectivity.h'
--- plugins/Ubuntu/Connectivity/Connectivity.h 1970-01-01 00:00:00 +0000
+++ plugins/Ubuntu/Connectivity/Connectivity.h 2014-08-21 14:47:14 +0000
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2014 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#ifndef CONNECTIVITY_H
18#define CONNECTIVITY_H
19
20#include <QObject>
21
22class Connectivity : public QObject
23{
24 Q_OBJECT
25 Q_DISABLE_COPY(Connectivity)
26
27public:
28 explicit Connectivity(QObject *parent = 0);
29
30 Q_INVOKABLE void unlockAllModems();
31};
32
33#endif // CONNECTIVITY_H
034
=== added file 'plugins/Ubuntu/Connectivity/Connectivity.qmltypes'
--- plugins/Ubuntu/Connectivity/Connectivity.qmltypes 1970-01-01 00:00:00 +0000
+++ plugins/Ubuntu/Connectivity/Connectivity.qmltypes 2014-08-21 14:47:14 +0000
@@ -0,0 +1,17 @@
1import QtQuick.tooling 1.1
2
3// This file describes the plugin-supplied types contained in the library.
4// It is used for QML tooling purposes only.
5//
6// This file was auto-generated by:
7// 'qmlplugindump -notrelocatable Ubuntu.Connectivity 0.1 plugins'
8
9Module {
10 Component {
11 name: "Connectivity"
12 prototype: "QObject"
13 exports: ["Ubuntu.Connectivity/Connectivity 0.1"]
14 exportMetaObjectRevisions: [0]
15 Method { name: "unlockAllModems" }
16 }
17}
018
=== added file 'plugins/Ubuntu/Connectivity/plugin.cpp'
--- plugins/Ubuntu/Connectivity/plugin.cpp 1970-01-01 00:00:00 +0000
+++ plugins/Ubuntu/Connectivity/plugin.cpp 2014-08-21 14:47:14 +0000
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2014 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#include "Connectivity.h"
19
20#include <QtQml>
21
22static QObject *service_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
23{
24 Q_UNUSED(engine)
25 Q_UNUSED(scriptEngine)
26 return new Connectivity();
27}
28
29void BackendPlugin::registerTypes(const char *uri)
30{
31 Q_ASSERT(uri == QLatin1String("Ubuntu.Connectivity"));
32
33 qmlRegisterSingletonType<Connectivity>(uri, 0, 1, "Connectivity", service_provider);
34}
035
=== added file 'plugins/Ubuntu/Connectivity/plugin.h'
--- plugins/Ubuntu/Connectivity/plugin.h 1970-01-01 00:00:00 +0000
+++ plugins/Ubuntu/Connectivity/plugin.h 2014-08-21 14:47:14 +0000
@@ -0,0 +1,31 @@
1/*
2 * Copyright (C) 2014 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#ifndef CONNECTIVITY_PLUGIN_H
18#define CONNECTIVITY_PLUGIN_H
19
20#include <QQmlExtensionPlugin>
21
22class BackendPlugin : public QQmlExtensionPlugin
23{
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
27public:
28 void registerTypes(const char *uri);
29};
30
31#endif // CONNECTIVITY_PLUGIN_H
032
=== added file 'plugins/Ubuntu/Connectivity/qmldir'
--- plugins/Ubuntu/Connectivity/qmldir 1970-01-01 00:00:00 +0000
+++ plugins/Ubuntu/Connectivity/qmldir 2014-08-21 14:47:14 +0000
@@ -0,0 +1,3 @@
1module Ubuntu.Connectivity
2plugin Connectivity
3typeinfo Connectivity.qmltypes
04
=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
--- qml/Notifications/NotificationMenuItemFactory.qml 2014-08-14 01:28:23 +0000
+++ qml/Notifications/NotificationMenuItemFactory.qml 2014-08-21 14:47:14 +0000
@@ -127,6 +127,11 @@
127 onCancel: {127 onCancel: {
128 menuModel.activate(menuIndex, false);128 menuModel.activate(menuIndex, false);
129 }129 }
130
131 onEmergencyCall: {
132 shell.activateApplication("dialer-app")
133 menuModel.activate(menuIndex, false)
134 }
130 }135 }
131 }136 }
132}137}
133138
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2014-08-20 09:19:32 +0000
+++ qml/Shell.qml 2014-08-21 14:47:14 +0000
@@ -20,6 +20,7 @@
20import Unity.Application 0.120import Unity.Application 0.1
21import Ubuntu.Components 0.121import Ubuntu.Components 0.1
22import Ubuntu.Components.Popups 1.022import Ubuntu.Components.Popups 1.0
23import Ubuntu.Connectivity 0.1
23import Ubuntu.Gestures 0.124import Ubuntu.Gestures 0.1
24import Ubuntu.SystemImage 0.125import Ubuntu.SystemImage 0.1
25import Unity.Launcher 0.126import Unity.Launcher 0.1
@@ -416,6 +417,10 @@
416 }417 }
417 }418 }
418419
420 Component.onCompleted: {
421 Connectivity.unlockAllModems()
422 }
423
419 onUnlocked: greeter.hide()424 onUnlocked: greeter.hide()
420 onSelected: {425 onSelected: {
421 // Update launcher items for new user426 // Update launcher items for new user
422427
=== modified file 'tests/mocks/Ubuntu/CMakeLists.txt'
--- tests/mocks/Ubuntu/CMakeLists.txt 2014-07-30 11:08:29 +0000
+++ tests/mocks/Ubuntu/CMakeLists.txt 2014-08-21 14:47:14 +0000
@@ -1,3 +1,4 @@
1add_subdirectory(Connectivity)
1add_subdirectory(DownloadDaemonListener)2add_subdirectory(DownloadDaemonListener)
2add_subdirectory(Payments)3add_subdirectory(Payments)
3add_subdirectory(SystemImage)4add_subdirectory(SystemImage)
45
=== added directory 'tests/mocks/Ubuntu/Connectivity'
=== added file 'tests/mocks/Ubuntu/Connectivity/CMakeLists.txt'
--- tests/mocks/Ubuntu/Connectivity/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/mocks/Ubuntu/Connectivity/CMakeLists.txt 2014-08-21 14:47:14 +0000
@@ -0,0 +1,10 @@
1set(MOCK_CONNECTIVITY_SOURCES
2 plugin.cpp
3 MockConnectivity.cpp
4)
5
6add_library(MockConnectivity MODULE ${MOCK_CONNECTIVITY_SOURCES})
7
8qt5_use_modules(MockConnectivity Qml Quick Core)
9
10add_unity8_mock(Ubuntu.Connectivity 0.1 Ubuntu/Connectivity TARGETS MockConnectivity)
011
=== added file 'tests/mocks/Ubuntu/Connectivity/Connectivity.qmltypes'
--- tests/mocks/Ubuntu/Connectivity/Connectivity.qmltypes 1970-01-01 00:00:00 +0000
+++ tests/mocks/Ubuntu/Connectivity/Connectivity.qmltypes 2014-08-21 14:47:14 +0000
@@ -0,0 +1,18 @@
1import QtQuick.tooling 1.1
2
3// This file describes the plugin-supplied types contained in the library.
4// It is used for QML tooling purposes only.
5//
6// This file was auto-generated by:
7// 'qmlplugindump -notrelocatable Ubuntu.Connectivity 0.1 plugins'
8
9Module {
10 Component {
11 name: "MockConnectivity"
12 prototype: "QObject"
13 exports: ["Ubuntu.Connectivity/Connectivity 0.1"]
14 exportMetaObjectRevisions: [0]
15 Signal { name: "unlockingAllModems" }
16 Method { name: "unlockAllModems" }
17 }
18}
019
=== added file 'tests/mocks/Ubuntu/Connectivity/MockConnectivity.cpp'
--- tests/mocks/Ubuntu/Connectivity/MockConnectivity.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/Ubuntu/Connectivity/MockConnectivity.cpp 2014-08-21 14:47:14 +0000
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2014 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 "MockConnectivity.h"
18
19MockConnectivity::MockConnectivity(QObject *parent)
20 : QObject(parent)
21{
22}
23
24void MockConnectivity::unlockAllModems()
25{
26 Q_EMIT unlockingAllModems();
27}
028
=== added file 'tests/mocks/Ubuntu/Connectivity/MockConnectivity.h'
--- tests/mocks/Ubuntu/Connectivity/MockConnectivity.h 1970-01-01 00:00:00 +0000
+++ tests/mocks/Ubuntu/Connectivity/MockConnectivity.h 2014-08-21 14:47:14 +0000
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2014 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#ifndef MOCK_CONNECTIVITY_H
18#define MOCK_CONNECTIVITY_H
19
20#include <QObject>
21
22class MockConnectivity : public QObject
23{
24 Q_OBJECT
25 Q_DISABLE_COPY(MockConnectivity)
26
27public:
28 explicit MockConnectivity(QObject *parent = 0);
29
30 Q_INVOKABLE void unlockAllModems();
31
32Q_SIGNALS:
33 void unlockingAllModems(); // only for mock
34};
35
36#endif // MOCK_CONNECTIVITY_H
037
=== added file 'tests/mocks/Ubuntu/Connectivity/plugin.cpp'
--- tests/mocks/Ubuntu/Connectivity/plugin.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/Ubuntu/Connectivity/plugin.cpp 2014-08-21 14:47:14 +0000
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2014 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#include "MockConnectivity.h"
19
20#include <QtQml>
21
22static QObject *service_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
23{
24 Q_UNUSED(engine)
25 Q_UNUSED(scriptEngine)
26 return new MockConnectivity();
27}
28
29void BackendPlugin::registerTypes(const char *uri)
30{
31 Q_ASSERT(uri == QLatin1String("Ubuntu.Connectivity"));
32
33 qmlRegisterSingletonType<MockConnectivity>(uri, 0, 1, "Connectivity", service_provider);
34}
035
=== added file 'tests/mocks/Ubuntu/Connectivity/plugin.h'
--- tests/mocks/Ubuntu/Connectivity/plugin.h 1970-01-01 00:00:00 +0000
+++ tests/mocks/Ubuntu/Connectivity/plugin.h 2014-08-21 14:47:14 +0000
@@ -0,0 +1,31 @@
1/*
2 * Copyright (C) 2014 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#ifndef MOCK_CONNECTIVITY_PLUGIN_H
18#define MOCK_CONNECTIVITY_PLUGIN_H
19
20#include <QQmlExtensionPlugin>
21
22class BackendPlugin : public QQmlExtensionPlugin
23{
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26
27public:
28 void registerTypes(const char *uri);
29};
30
31#endif // MOCK_CONNECTIVITY_PLUGIN_H
032
=== added file 'tests/mocks/Ubuntu/Connectivity/qmldir'
--- tests/mocks/Ubuntu/Connectivity/qmldir 1970-01-01 00:00:00 +0000
+++ tests/mocks/Ubuntu/Connectivity/qmldir 2014-08-21 14:47:14 +0000
@@ -0,0 +1,3 @@
1module Ubuntu.Connectivity
2plugin MockConnectivity
3typeinfo Connectivity.qmltypes
04
=== modified file 'tests/qmltests/tst_Shell.qml'
--- tests/qmltests/tst_Shell.qml 2014-07-29 11:35:10 +0000
+++ tests/qmltests/tst_Shell.qml 2014-08-21 14:47:14 +0000
@@ -21,6 +21,7 @@
21import QtTest 1.021import QtTest 1.0
22import GSettings 1.022import GSettings 1.0
23import LightDM 0.1 as LightDM23import LightDM 0.1 as LightDM
24import Ubuntu.Connectivity 0.1
24import Unity.Application 0.125import Unity.Application 0.1
25import Unity.Test 0.1 as UT26import Unity.Test 0.1 as UT
26import Powerd 0.127import Powerd 0.1
@@ -28,6 +29,7 @@
28import "../../qml"29import "../../qml"
2930
30Item {31Item {
32 id: root
31 width: shell.width33 width: shell.width
32 height: shell.height34 height: shell.height
3335
@@ -51,6 +53,11 @@
51 id: shell53 id: shell
52 }54 }
5355
56 Component {
57 id: shellComponent
58 Shell {}
59 }
60
54 SignalSpy {61 SignalSpy {
55 id: sessionSpy62 id: sessionSpy
56 signalName: "sessionStarted"63 signalName: "sessionStarted"
@@ -61,6 +68,12 @@
61 signalName: "setCurrentScopeCalled"68 signalName: "setCurrentScopeCalled"
62 }69 }
6370
71 SignalSpy {
72 id: unlockAllModemsSpy
73 target: Connectivity
74 signalName: "unlockingAllModems"
75 }
76
64 UT.UnityTestCase {77 UT.UnityTestCase {
65 name: "Shell"78 name: "Shell"
66 when: windowShown79 when: windowShown
@@ -431,5 +444,24 @@
431444
432 touchRelease(shell);445 touchRelease(shell);
433 }446 }
447
448 function test_unlockedProperties() {
449 // Confirm that various properties have the correct values when unlocked
450 tryCompare(shell, "locked", false)
451
452 var launcher = findChild(shell, "launcher")
453 tryCompare(launcher, "available", true)
454
455 var indicators = findChild(shell, "indicators")
456 tryCompare(indicators, "available", true)
457 }
458
459 function test_unlockAllModemsOnBoot() {
460 unlockAllModemsSpy.clear()
461 // actually create an object so we notice the onCompleted signal
462 var greeter = shellComponent.createObject(root)
463 tryCompare(unlockAllModemsSpy, "count", 1)
464 greeter.destroy()
465 }
434 }466 }
435}467}

Subscribers

People subscribed via source and target branches