Merge lp:~mterry/unity8/sim-unlock-on-boot into lp:unity8

Proposed by Michael Terry
Status: Superseded
Proposed branch: lp:~mterry/unity8/sim-unlock-on-boot
Merge into: lp:unity8
Prerequisite: lp:~dandrader/unity8/lifecycle
Diff against target: 507 lines (+353/-0)
19 files modified
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 (+21/-0)
To merge this branch: bzr merge lp:~mterry/unity8/sim-unlock-on-boot
Reviewer Review Type Date Requested Status
Michael Zanetti Pending
PS Jenkins bot continuous-integration Pending
Review via email: mp+231796@code.launchpad.net

This proposal supersedes a proposal from 2014-08-15.

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

Commit message

Show the SIM unlock dialog immediately after booting, and enable its emergency call button.

Description of the change

Show the SIM unlock dialog immediately after booting, and enable its emergency call button.

A couple notes about the implementation:

- I've added *yet another* tiny plugin for one DBus call. I didn't think there was an existing plugin that really fit it. I'm not thrilled about it either, but it fits the current plugin tradition. A future branch should consolidate our tiny plugins in some sensible way.

- I've deliberately ignored design's request that the dialog appear *under* the infographic screen. Oddly enough, this is technically challenging to do. We'd have to re-parent the dialog and place it there, make it non-modal (to some parts of the shell), and have the notification system treat it specially. We'd also have to be careful to only treat just that one request differently, and to do that, we'd probably need more support for tracing which notifications came from which component and such. I figure that for a first pass, we can just do this the dumb way. If the notification frontend becomes smarter, we can make it nice. We're way past UI freeze, so I didn't want to delay this branch too much longer just to get that right.

== Checklist ==

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 - Yes, https://code.launchpad.net/~unity-api-team/indicator-network/connectivity-service/+merge/229965

 * 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?
 - Design specifies that the unlock dialog should be below the infographic screen (see above), but otherwise this is what design specs out in https://docs.google.com/a/canonical.com/document/d/1VajNkWbBH61iVixXJAmOvNGiG__GWQTMXGNOZijXWJw

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

code review looks good. Only one inline comment.

Functional testing still in progress.

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

hmm... doesn't work here... no SIM unlock popup showing up :/

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

> hmm... doesn't work here... no SIM unlock popup showing up :/

Sorry, my bad. It *does* work!

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

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

Yes. its worky :)

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

It did. get it in before that changes!

review: Approve

Unmerged revisions

1167. By Michael Terry

Merge lifecycle branch in

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Ubuntu/CMakeLists.txt'
2--- plugins/Ubuntu/CMakeLists.txt 2014-07-30 11:08:29 +0000
3+++ plugins/Ubuntu/CMakeLists.txt 2014-08-21 20:00:48 +0000
4@@ -1,3 +1,4 @@
5+add_subdirectory(Connectivity)
6 add_subdirectory(Gestures)
7 add_subdirectory(DownloadDaemonListener)
8 add_subdirectory(Payments)
9
10=== added directory 'plugins/Ubuntu/Connectivity'
11=== added file 'plugins/Ubuntu/Connectivity/CMakeLists.txt'
12--- plugins/Ubuntu/Connectivity/CMakeLists.txt 1970-01-01 00:00:00 +0000
13+++ plugins/Ubuntu/Connectivity/CMakeLists.txt 2014-08-21 20:00:48 +0000
14@@ -0,0 +1,10 @@
15+set(CONNECTIVITY_SOURCES
16+ plugin.cpp
17+ Connectivity.cpp
18+)
19+
20+add_library(Connectivity MODULE ${CONNECTIVITY_SOURCES})
21+
22+qt5_use_modules(Connectivity Qml DBus Core)
23+
24+add_unity8_plugin(Ubuntu.Connectivity 0.1 Ubuntu/Connectivity TARGETS Connectivity)
25
26=== added file 'plugins/Ubuntu/Connectivity/Connectivity.cpp'
27--- plugins/Ubuntu/Connectivity/Connectivity.cpp 1970-01-01 00:00:00 +0000
28+++ plugins/Ubuntu/Connectivity/Connectivity.cpp 2014-08-21 20:00:48 +0000
29@@ -0,0 +1,33 @@
30+/*
31+ * Copyright (C) 2014 Canonical, Ltd.
32+ *
33+ * This program is free software; you can redistribute it and/or modify
34+ * it under the terms of the GNU General Public License as published by
35+ * the Free Software Foundation; version 3.
36+ *
37+ * This program is distributed in the hope that it will be useful,
38+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
39+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40+ * GNU General Public License for more details.
41+ *
42+ * You should have received a copy of the GNU General Public License
43+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
44+ */
45+
46+#include "Connectivity.h"
47+#include <QDBusConnection>
48+#include <QDBusInterface>
49+#include <QDBusPendingCall>
50+
51+Connectivity::Connectivity(QObject *parent)
52+ : QObject(parent)
53+{
54+}
55+
56+void Connectivity::unlockAllModems()
57+{
58+ QDBusInterface iface("com.ubuntu.connectivity1",
59+ "/com/ubuntu/connectivity1/Private",
60+ "com.ubuntu.connectivity1.Private");
61+ iface.asyncCall("UnlockAllModems");
62+}
63
64=== added file 'plugins/Ubuntu/Connectivity/Connectivity.h'
65--- plugins/Ubuntu/Connectivity/Connectivity.h 1970-01-01 00:00:00 +0000
66+++ plugins/Ubuntu/Connectivity/Connectivity.h 2014-08-21 20:00:48 +0000
67@@ -0,0 +1,33 @@
68+/*
69+ * Copyright (C) 2014 Canonical, Ltd.
70+ *
71+ * This program is free software; you can redistribute it and/or modify
72+ * it under the terms of the GNU General Public License as published by
73+ * the Free Software Foundation; version 3.
74+ *
75+ * This program is distributed in the hope that it will be useful,
76+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
77+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78+ * GNU General Public License for more details.
79+ *
80+ * You should have received a copy of the GNU General Public License
81+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
82+ */
83+
84+#ifndef CONNECTIVITY_H
85+#define CONNECTIVITY_H
86+
87+#include <QObject>
88+
89+class Connectivity : public QObject
90+{
91+ Q_OBJECT
92+ Q_DISABLE_COPY(Connectivity)
93+
94+public:
95+ explicit Connectivity(QObject *parent = 0);
96+
97+ Q_INVOKABLE void unlockAllModems();
98+};
99+
100+#endif // CONNECTIVITY_H
101
102=== added file 'plugins/Ubuntu/Connectivity/Connectivity.qmltypes'
103--- plugins/Ubuntu/Connectivity/Connectivity.qmltypes 1970-01-01 00:00:00 +0000
104+++ plugins/Ubuntu/Connectivity/Connectivity.qmltypes 2014-08-21 20:00:48 +0000
105@@ -0,0 +1,17 @@
106+import QtQuick.tooling 1.1
107+
108+// This file describes the plugin-supplied types contained in the library.
109+// It is used for QML tooling purposes only.
110+//
111+// This file was auto-generated by:
112+// 'qmlplugindump -notrelocatable Ubuntu.Connectivity 0.1 plugins'
113+
114+Module {
115+ Component {
116+ name: "Connectivity"
117+ prototype: "QObject"
118+ exports: ["Ubuntu.Connectivity/Connectivity 0.1"]
119+ exportMetaObjectRevisions: [0]
120+ Method { name: "unlockAllModems" }
121+ }
122+}
123
124=== added file 'plugins/Ubuntu/Connectivity/plugin.cpp'
125--- plugins/Ubuntu/Connectivity/plugin.cpp 1970-01-01 00:00:00 +0000
126+++ plugins/Ubuntu/Connectivity/plugin.cpp 2014-08-21 20:00:48 +0000
127@@ -0,0 +1,34 @@
128+/*
129+ * Copyright (C) 2014 Canonical, Ltd.
130+ *
131+ * This program is free software; you can redistribute it and/or modify
132+ * it under the terms of the GNU General Public License as published by
133+ * the Free Software Foundation; version 3.
134+ *
135+ * This program is distributed in the hope that it will be useful,
136+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
137+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
138+ * GNU General Public License for more details.
139+ *
140+ * You should have received a copy of the GNU General Public License
141+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
142+ */
143+
144+#include "plugin.h"
145+#include "Connectivity.h"
146+
147+#include <QtQml>
148+
149+static QObject *service_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
150+{
151+ Q_UNUSED(engine)
152+ Q_UNUSED(scriptEngine)
153+ return new Connectivity();
154+}
155+
156+void BackendPlugin::registerTypes(const char *uri)
157+{
158+ Q_ASSERT(uri == QLatin1String("Ubuntu.Connectivity"));
159+
160+ qmlRegisterSingletonType<Connectivity>(uri, 0, 1, "Connectivity", service_provider);
161+}
162
163=== added file 'plugins/Ubuntu/Connectivity/plugin.h'
164--- plugins/Ubuntu/Connectivity/plugin.h 1970-01-01 00:00:00 +0000
165+++ plugins/Ubuntu/Connectivity/plugin.h 2014-08-21 20:00:48 +0000
166@@ -0,0 +1,31 @@
167+/*
168+ * Copyright (C) 2014 Canonical, Ltd.
169+ *
170+ * This program is free software; you can redistribute it and/or modify
171+ * it under the terms of the GNU General Public License as published by
172+ * the Free Software Foundation; version 3.
173+ *
174+ * This program is distributed in the hope that it will be useful,
175+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
176+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
177+ * GNU General Public License for more details.
178+ *
179+ * You should have received a copy of the GNU General Public License
180+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
181+ */
182+
183+#ifndef CONNECTIVITY_PLUGIN_H
184+#define CONNECTIVITY_PLUGIN_H
185+
186+#include <QQmlExtensionPlugin>
187+
188+class BackendPlugin : public QQmlExtensionPlugin
189+{
190+ Q_OBJECT
191+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
192+
193+public:
194+ void registerTypes(const char *uri);
195+};
196+
197+#endif // CONNECTIVITY_PLUGIN_H
198
199=== added file 'plugins/Ubuntu/Connectivity/qmldir'
200--- plugins/Ubuntu/Connectivity/qmldir 1970-01-01 00:00:00 +0000
201+++ plugins/Ubuntu/Connectivity/qmldir 2014-08-21 20:00:48 +0000
202@@ -0,0 +1,3 @@
203+module Ubuntu.Connectivity
204+plugin Connectivity
205+typeinfo Connectivity.qmltypes
206
207=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
208--- qml/Notifications/NotificationMenuItemFactory.qml 2014-08-14 01:28:23 +0000
209+++ qml/Notifications/NotificationMenuItemFactory.qml 2014-08-21 20:00:48 +0000
210@@ -127,6 +127,11 @@
211 onCancel: {
212 menuModel.activate(menuIndex, false);
213 }
214+
215+ onEmergencyCall: {
216+ shell.activateApplication("dialer-app")
217+ menuModel.activate(menuIndex, false)
218+ }
219 }
220 }
221 }
222
223=== modified file 'qml/Shell.qml'
224--- qml/Shell.qml 2014-08-20 09:19:32 +0000
225+++ qml/Shell.qml 2014-08-21 20:00:48 +0000
226@@ -20,6 +20,7 @@
227 import Unity.Application 0.1
228 import Ubuntu.Components 0.1
229 import Ubuntu.Components.Popups 1.0
230+import Ubuntu.Connectivity 0.1
231 import Ubuntu.Gestures 0.1
232 import Ubuntu.SystemImage 0.1
233 import Unity.Launcher 0.1
234@@ -416,6 +417,10 @@
235 }
236 }
237
238+ Component.onCompleted: {
239+ Connectivity.unlockAllModems()
240+ }
241+
242 onUnlocked: greeter.hide()
243 onSelected: {
244 // Update launcher items for new user
245
246=== modified file 'tests/mocks/Ubuntu/CMakeLists.txt'
247--- tests/mocks/Ubuntu/CMakeLists.txt 2014-07-30 11:08:29 +0000
248+++ tests/mocks/Ubuntu/CMakeLists.txt 2014-08-21 20:00:48 +0000
249@@ -1,3 +1,4 @@
250+add_subdirectory(Connectivity)
251 add_subdirectory(DownloadDaemonListener)
252 add_subdirectory(Payments)
253 add_subdirectory(SystemImage)
254
255=== added directory 'tests/mocks/Ubuntu/Connectivity'
256=== added file 'tests/mocks/Ubuntu/Connectivity/CMakeLists.txt'
257--- tests/mocks/Ubuntu/Connectivity/CMakeLists.txt 1970-01-01 00:00:00 +0000
258+++ tests/mocks/Ubuntu/Connectivity/CMakeLists.txt 2014-08-21 20:00:48 +0000
259@@ -0,0 +1,10 @@
260+set(MOCK_CONNECTIVITY_SOURCES
261+ plugin.cpp
262+ MockConnectivity.cpp
263+)
264+
265+add_library(MockConnectivity MODULE ${MOCK_CONNECTIVITY_SOURCES})
266+
267+qt5_use_modules(MockConnectivity Qml Quick Core)
268+
269+add_unity8_mock(Ubuntu.Connectivity 0.1 Ubuntu/Connectivity TARGETS MockConnectivity)
270
271=== added file 'tests/mocks/Ubuntu/Connectivity/Connectivity.qmltypes'
272--- tests/mocks/Ubuntu/Connectivity/Connectivity.qmltypes 1970-01-01 00:00:00 +0000
273+++ tests/mocks/Ubuntu/Connectivity/Connectivity.qmltypes 2014-08-21 20:00:48 +0000
274@@ -0,0 +1,18 @@
275+import QtQuick.tooling 1.1
276+
277+// This file describes the plugin-supplied types contained in the library.
278+// It is used for QML tooling purposes only.
279+//
280+// This file was auto-generated by:
281+// 'qmlplugindump -notrelocatable Ubuntu.Connectivity 0.1 plugins'
282+
283+Module {
284+ Component {
285+ name: "MockConnectivity"
286+ prototype: "QObject"
287+ exports: ["Ubuntu.Connectivity/Connectivity 0.1"]
288+ exportMetaObjectRevisions: [0]
289+ Signal { name: "unlockingAllModems" }
290+ Method { name: "unlockAllModems" }
291+ }
292+}
293
294=== added file 'tests/mocks/Ubuntu/Connectivity/MockConnectivity.cpp'
295--- tests/mocks/Ubuntu/Connectivity/MockConnectivity.cpp 1970-01-01 00:00:00 +0000
296+++ tests/mocks/Ubuntu/Connectivity/MockConnectivity.cpp 2014-08-21 20:00:48 +0000
297@@ -0,0 +1,27 @@
298+/*
299+ * Copyright (C) 2014 Canonical, Ltd.
300+ *
301+ * This program is free software; you can redistribute it and/or modify
302+ * it under the terms of the GNU General Public License as published by
303+ * the Free Software Foundation; version 3.
304+ *
305+ * This program is distributed in the hope that it will be useful,
306+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
307+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
308+ * GNU General Public License for more details.
309+ *
310+ * You should have received a copy of the GNU General Public License
311+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
312+ */
313+
314+#include "MockConnectivity.h"
315+
316+MockConnectivity::MockConnectivity(QObject *parent)
317+ : QObject(parent)
318+{
319+}
320+
321+void MockConnectivity::unlockAllModems()
322+{
323+ Q_EMIT unlockingAllModems();
324+}
325
326=== added file 'tests/mocks/Ubuntu/Connectivity/MockConnectivity.h'
327--- tests/mocks/Ubuntu/Connectivity/MockConnectivity.h 1970-01-01 00:00:00 +0000
328+++ tests/mocks/Ubuntu/Connectivity/MockConnectivity.h 2014-08-21 20:00:48 +0000
329@@ -0,0 +1,36 @@
330+/*
331+ * Copyright (C) 2014 Canonical, Ltd.
332+ *
333+ * This program is free software; you can redistribute it and/or modify
334+ * it under the terms of the GNU General Public License as published by
335+ * the Free Software Foundation; version 3.
336+ *
337+ * This program is distributed in the hope that it will be useful,
338+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
339+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
340+ * GNU General Public License for more details.
341+ *
342+ * You should have received a copy of the GNU General Public License
343+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
344+ */
345+
346+#ifndef MOCK_CONNECTIVITY_H
347+#define MOCK_CONNECTIVITY_H
348+
349+#include <QObject>
350+
351+class MockConnectivity : public QObject
352+{
353+ Q_OBJECT
354+ Q_DISABLE_COPY(MockConnectivity)
355+
356+public:
357+ explicit MockConnectivity(QObject *parent = 0);
358+
359+ Q_INVOKABLE void unlockAllModems();
360+
361+Q_SIGNALS:
362+ void unlockingAllModems(); // only for mock
363+};
364+
365+#endif // MOCK_CONNECTIVITY_H
366
367=== added file 'tests/mocks/Ubuntu/Connectivity/plugin.cpp'
368--- tests/mocks/Ubuntu/Connectivity/plugin.cpp 1970-01-01 00:00:00 +0000
369+++ tests/mocks/Ubuntu/Connectivity/plugin.cpp 2014-08-21 20:00:48 +0000
370@@ -0,0 +1,34 @@
371+/*
372+ * Copyright (C) 2014 Canonical, Ltd.
373+ *
374+ * This program is free software; you can redistribute it and/or modify
375+ * it under the terms of the GNU General Public License as published by
376+ * the Free Software Foundation; version 3.
377+ *
378+ * This program is distributed in the hope that it will be useful,
379+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
380+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
381+ * GNU General Public License for more details.
382+ *
383+ * You should have received a copy of the GNU General Public License
384+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
385+ */
386+
387+#include "plugin.h"
388+#include "MockConnectivity.h"
389+
390+#include <QtQml>
391+
392+static QObject *service_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
393+{
394+ Q_UNUSED(engine)
395+ Q_UNUSED(scriptEngine)
396+ return new MockConnectivity();
397+}
398+
399+void BackendPlugin::registerTypes(const char *uri)
400+{
401+ Q_ASSERT(uri == QLatin1String("Ubuntu.Connectivity"));
402+
403+ qmlRegisterSingletonType<MockConnectivity>(uri, 0, 1, "Connectivity", service_provider);
404+}
405
406=== added file 'tests/mocks/Ubuntu/Connectivity/plugin.h'
407--- tests/mocks/Ubuntu/Connectivity/plugin.h 1970-01-01 00:00:00 +0000
408+++ tests/mocks/Ubuntu/Connectivity/plugin.h 2014-08-21 20:00:48 +0000
409@@ -0,0 +1,31 @@
410+/*
411+ * Copyright (C) 2014 Canonical, Ltd.
412+ *
413+ * This program is free software; you can redistribute it and/or modify
414+ * it under the terms of the GNU General Public License as published by
415+ * the Free Software Foundation; version 3.
416+ *
417+ * This program is distributed in the hope that it will be useful,
418+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
419+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
420+ * GNU General Public License for more details.
421+ *
422+ * You should have received a copy of the GNU General Public License
423+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
424+ */
425+
426+#ifndef MOCK_CONNECTIVITY_PLUGIN_H
427+#define MOCK_CONNECTIVITY_PLUGIN_H
428+
429+#include <QQmlExtensionPlugin>
430+
431+class BackendPlugin : public QQmlExtensionPlugin
432+{
433+ Q_OBJECT
434+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
435+
436+public:
437+ void registerTypes(const char *uri);
438+};
439+
440+#endif // MOCK_CONNECTIVITY_PLUGIN_H
441
442=== added file 'tests/mocks/Ubuntu/Connectivity/qmldir'
443--- tests/mocks/Ubuntu/Connectivity/qmldir 1970-01-01 00:00:00 +0000
444+++ tests/mocks/Ubuntu/Connectivity/qmldir 2014-08-21 20:00:48 +0000
445@@ -0,0 +1,3 @@
446+module Ubuntu.Connectivity
447+plugin MockConnectivity
448+typeinfo Connectivity.qmltypes
449
450=== modified file 'tests/qmltests/tst_Shell.qml'
451--- tests/qmltests/tst_Shell.qml 2014-08-21 20:00:48 +0000
452+++ tests/qmltests/tst_Shell.qml 2014-08-21 20:00:48 +0000
453@@ -21,6 +21,7 @@
454 import QtTest 1.0
455 import GSettings 1.0
456 import LightDM 0.1 as LightDM
457+import Ubuntu.Connectivity 0.1
458 import Unity.Application 0.1
459 import Unity.Test 0.1 as UT
460 import Powerd 0.1
461@@ -28,6 +29,7 @@
462 import "../../qml"
463
464 Item {
465+ id: root
466 width: shell.width
467 height: shell.height
468
469@@ -51,6 +53,11 @@
470 id: shell
471 }
472
473+ Component {
474+ id: shellComponent
475+ Shell {}
476+ }
477+
478 SignalSpy {
479 id: sessionSpy
480 signalName: "sessionStarted"
481@@ -61,6 +68,12 @@
482 signalName: "setCurrentScopeCalled"
483 }
484
485+ SignalSpy {
486+ id: unlockAllModemsSpy
487+ target: Connectivity
488+ signalName: "unlockingAllModems"
489+ }
490+
491 UT.UnityTestCase {
492 name: "Shell"
493 when: windowShown
494@@ -431,5 +444,13 @@
495
496 touchRelease(shell);
497 }
498+
499+ function test_unlockAllModemsOnBoot() {
500+ unlockAllModemsSpy.clear()
501+ // actually create an object so we notice the onCompleted signal
502+ var greeter = shellComponent.createObject(root)
503+ tryCompare(unlockAllModemsSpy, "count", 1)
504+ greeter.destroy()
505+ }
506 }
507 }

Subscribers

People subscribed via source and target branches