Merge lp:~jonas-drange/ubuntu-system-settings/hotspots-new-design into lp:~jonas-drange/ubuntu-system-settings/hotspots

Proposed by Jonas G. Drange
Status: Superseded
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/hotspots-new-design
Merge into: lp:~jonas-drange/ubuntu-system-settings/hotspots
Diff against target: 1638 lines (+746/-326)
21 files modified
debian/changelog (+8/-0)
debian/control (+1/-1)
plugins/CMakeLists.txt (+1/-0)
plugins/cellular/CMakeLists.txt (+0/-3)
plugins/cellular/Components/MultiSim.qml (+0/-19)
plugins/cellular/Components/SingleSim.qml (+0/-24)
plugins/cellular/cellular.settings (+1/-3)
plugins/hotspot/CMakeLists.txt (+12/-0)
plugins/hotspot/HotspotSetup.qml (+31/-7)
plugins/hotspot/PageComponent.qml (+146/-79)
plugins/hotspot/hotspot.settings (+18/-0)
plugins/hotspot/qmldir (+2/-0)
plugins/hotspot/settings-hotspot.svg (+182/-0)
tests/autopilot/ubuntu_system_settings/__init__.py (+46/-48)
tests/autopilot/ubuntu_system_settings/tests/__init__.py (+3/-1)
tests/autopilot/ubuntu_system_settings/tests/connectivity.py (+15/-2)
tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py (+14/-4)
tests/autopilot/ubuntu_system_settings/tests/test_cellular.py (+1/-105)
tests/autopilot/ubuntu_system_settings/tests/test_hotspot.py (+228/-0)
tests/autopilot/ubuntu_system_settings/tests/test_phone.py (+30/-30)
tests/autopilot/ubuntu_system_settings/tests/test_plugins.py (+7/-0)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/hotspots-new-design
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Jonas G. Drange Pending
Review via email: mp+267256@code.launchpad.net

This proposal has been superseded by a proposal from 2015-08-14.

Commit message

debs

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1499. By Jonas G. Drange

change icon, attempt switch majigger

1500. By Jonas G. Drange

bzr merge ../fix-pep8/

1501. By Jonas G. Drange

sync with dep

1502. By Jonas G. Drange

fix dep merge properly

1503. By Jonas G. Drange

use connectivity for wifi on/off sniff

1504. By Jonas G. Drange

rename wifieneabled

1505. By Jonas G. Drange

implement enabling wifi on setup, as well as happy path test for it

1506. By Jonas G. Drange

make tests quicker, and fix bug where you couldn't close the enable-wifi diag

1507. By Jonas G. Drange

sync with trunk

1508. By Jonas G. Drange

fix bad merge with trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1509. By Jonas G. Drange

fix json error in cellular.settings

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1510. By Jonas G. Drange

add hotspot test plugin

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: Needs Fixing (continuous-integration)
1511. By Jonas G. Drange

use new connectivity props to enable/disable user actions and add new tests + refactor existing.

1512. By Jonas G. Drange

it is not necessary to disable the back button anymore, so remove that piece

1513. By Jonas G. Drange

prune mp

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1514. By Jonas G. Drange

use lower case prop names for consistency and cut the USC prop sync

1515. By Jonas G. Drange

we don't need to toggle the hotspot switch directly after enabling wifi. Also, we need to listen for change events directly for the switch to work properly.

1516. By Jonas G. Drange

we need a newer suru icon theme for the hotspot icon

1517. By Jonas G. Drange

improve the logic here

1518. By Jonas G. Drange

use new lower case names

1519. By Jonas G. Drange

revert phone changes, and use flightMode flag

1520. By Jonas G. Drange

revert indicatornetwork stuff we don't use

1521. By Jonas G. Drange

no 1.3 imports

1522. By Jonas G. Drange

unpollute diff

1523. By Jonas G. Drange

bump package dep

Unmerged revisions

1523. By Jonas G. Drange

bump package dep

1522. By Jonas G. Drange

unpollute diff

1521. By Jonas G. Drange

no 1.3 imports

1520. By Jonas G. Drange

revert indicatornetwork stuff we don't use

1519. By Jonas G. Drange

revert phone changes, and use flightMode flag

1518. By Jonas G. Drange

use new lower case names

1517. By Jonas G. Drange

improve the logic here

1516. By Jonas G. Drange

we need a newer suru icon theme for the hotspot icon

1515. By Jonas G. Drange

we don't need to toggle the hotspot switch directly after enabling wifi. Also, we need to listen for change events directly for the switch to work properly.

1514. By Jonas G. Drange

use lower case prop names for consistency and cut the USC prop sync

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2015-08-10 13:20:25 +0000
+++ debian/changelog 2015-08-14 11:52:44 +0000
@@ -1,3 +1,11 @@
1ubuntu-system-settings (0.3+15.10.20150812-0ubuntu1) wily; urgency=medium
2
3 [ jonas-drange ]
4 * [cellular] add hotspot support by use of the Connectivity API (LP:
5 #1477300, #1421583)
6
7 -- CI Train Bot <ci-train-bot@canonical.com> Wed, 12 Aug 2015 12:20:19 +0000
8
1ubuntu-system-settings (0.3+15.10.20150810-0ubuntu1) wily; urgency=medium9ubuntu-system-settings (0.3+15.10.20150810-0ubuntu1) wily; urgency=medium
210
3 [ Ken VanDine ]11 [ Ken VanDine ]
412
=== modified file 'debian/control'
--- debian/control 2015-07-16 09:22:42 +0000
+++ debian/control 2015-08-14 11:52:44 +0000
@@ -23,7 +23,7 @@
23 libunity-api-dev,23 libunity-api-dev,
24 libupower-glib-dev,24 libupower-glib-dev,
25 pkg-config,25 pkg-config,
26 qml-module-ubuntu-connectivity (>= 0.5.2),26 qml-module-ubuntu-connectivity (>= 0.5.3),
27 qt5-default,27 qt5-default,
28 qtbase5-dev,28 qtbase5-dev,
29 qtdeclarative5-dev,29 qtdeclarative5-dev,
3030
=== modified file 'plugins/CMakeLists.txt'
--- plugins/CMakeLists.txt 2014-07-09 01:05:29 +0000
+++ plugins/CMakeLists.txt 2015-08-14 11:52:44 +0000
@@ -9,6 +9,7 @@
9add_subdirectory(cellular)9add_subdirectory(cellular)
10add_subdirectory(example)10add_subdirectory(example)
11add_subdirectory(flight-mode)11add_subdirectory(flight-mode)
12add_subdirectory(hotspot)
12add_subdirectory(language)13add_subdirectory(language)
13add_subdirectory(notifications)14add_subdirectory(notifications)
14add_subdirectory(orientation-lock)15add_subdirectory(orientation-lock)
1516
=== modified file 'plugins/cellular/CMakeLists.txt'
--- plugins/cellular/CMakeLists.txt 2015-08-06 10:33:16 +0000
+++ plugins/cellular/CMakeLists.txt 2015-08-14 11:52:44 +0000
@@ -7,15 +7,12 @@
7 apn_manager.js7 apn_manager.js
8 apn_editor.js8 apn_editor.js
9 carriers.js9 carriers.js
10 Common.qml
11 PageApnEditor.qml10 PageApnEditor.qml
12 PageChooseApn.qml11 PageChooseApn.qml
13 PageChooseCarrier.qml12 PageChooseCarrier.qml
14 PageCarrierAndApn.qml13 PageCarrierAndApn.qml
15 PageCarriersAndApns.qml14 PageCarriersAndApns.qml
16 PageComponent.qml15 PageComponent.qml
17 Hotspot.qml
18 HotspotSetup.qml
19 sims.js16 sims.js
20)17)
2118
2219
=== modified file 'plugins/cellular/Components/MultiSim.qml'
--- plugins/cellular/Components/MultiSim.qml 2015-07-24 20:00:06 +0000
+++ plugins/cellular/Components/MultiSim.qml 2015-08-14 11:52:44 +0000
@@ -53,25 +53,6 @@
53 anchors { left: parent.left; right: parent.right }53 anchors { left: parent.left; right: parent.right }
54 }54 }
5555
56 ListItem.SingleValue {
57 text : i18n.tr("Hotspot disabled because Wi-Fi is off.")
58 visible: !hotspotItem.visible &&
59 UpdateManager.deviceName !== "mako"
60 }
61
62 ListItem.SingleValue {
63 id: hotspotItem
64 text: i18n.tr("Wi-Fi hotspot")
65 progression: true
66 onClicked: {
67 pageStack.push(Qt.resolvedUrl("../Hotspot.qml"))
68 }
69 visible: (actionGroup.actionObject.valid ?
70 actionGroup.actionObject.state : false) &&
71 UpdateManager.deviceName !== "mako"
72
73 }
74
75 ListItem.Standard {56 ListItem.Standard {
76 id: dataUsage57 id: dataUsage
77 text: i18n.tr("Data usage statistics")58 text: i18n.tr("Data usage statistics")
7859
=== modified file 'plugins/cellular/Components/SingleSim.qml'
--- plugins/cellular/Components/SingleSim.qml 2015-07-24 20:00:06 +0000
+++ plugins/cellular/Components/SingleSim.qml 2015-08-14 11:52:44 +0000
@@ -22,11 +22,6 @@
22import Ubuntu.Components 0.122import Ubuntu.Components 0.1
23import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 0.1 as ListItem
2424
25/* This is a temporary solution to the issue of Hotspots failing on mako. If
26the device is mako, we hide the hotspot entry. Will be removed once lp:1434591
27has been resolved. */
28import Ubuntu.SystemSettings.Update 1.0
29
30Column {25Column {
3126
32 objectName: "singleSim"27 objectName: "singleSim"
@@ -64,25 +59,6 @@
64 }59 }
65 }60 }
6661
67 ListItem.SingleValue {
68 text : i18n.tr("Hotspot disabled because Wi-Fi is off.")
69 visible: !hotspotItem.visible &&
70 UpdateManager.deviceName !== "mako"
71 }
72
73 ListItem.SingleValue {
74 id: hotspotItem
75 objectName: "hotspotEntry"
76 text: i18n.tr("Wi-Fi hotspot")
77 progression: true
78 onClicked: {
79 pageStack.push(Qt.resolvedUrl("../Hotspot.qml"))
80 }
81 visible: (actionGroup.actionObject.valid ?
82 actionGroup.actionObject.state : false) &&
83 UpdateManager.deviceName !== "mako"
84 }
85
86 ListItem.Standard {62 ListItem.Standard {
87 text: i18n.tr("Data usage statistics")63 text: i18n.tr("Data usage statistics")
88 progression: true64 progression: true
8965
=== modified file 'plugins/cellular/cellular.settings'
--- plugins/cellular/cellular.settings 2015-08-10 09:27:01 +0000
+++ plugins/cellular/cellular.settings 2015-08-14 11:52:44 +0000
@@ -20,9 +20,7 @@
20 "lte",20 "lte",
21 "apn",21 "apn",
22 "roam",22 "roam",
23 "sim",23 "sim"
24 "hotspot",
25 "tethering"
26 ],24 ],
27 "has-dynamic-keywords": false,25 "has-dynamic-keywords": false,
28 "has-dynamic-visibility": false,26 "has-dynamic-visibility": false,
2927
=== added directory 'plugins/hotspot'
=== added file 'plugins/hotspot/CMakeLists.txt'
--- plugins/hotspot/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ plugins/hotspot/CMakeLists.txt 2015-08-14 11:52:44 +0000
@@ -0,0 +1,12 @@
1set(QML_SOURCES
2 Common.qml
3 HotspotSetup.qml
4 PageComponent.qml
5)
6
7set(PLUG_DIR ${PLUGIN_PRIVATE_MODULE_DIR}/Ubuntu/SystemSettings/Hotspot)
8
9install(FILES qmldir DESTINATION ${PLUG_DIR})
10install(FILES hotspot.settings DESTINATION ${PLUGIN_MANIFEST_DIR})
11install(FILES settings-hotspot.svg DESTINATION ${PLUGIN_MANIFEST_DIR}/icons)
12install(FILES ${QML_SOURCES} DESTINATION ${PLUGIN_QML_DIR}/hotspot)
013
=== renamed file 'plugins/cellular/Common.qml' => 'plugins/hotspot/Common.qml'
=== renamed file 'plugins/cellular/HotspotSetup.qml' => 'plugins/hotspot/HotspotSetup.qml'
--- plugins/cellular/HotspotSetup.qml 2015-08-10 20:04:29 +0000
+++ plugins/hotspot/HotspotSetup.qml 2015-08-14 11:52:44 +0000
@@ -208,6 +208,17 @@
208 }208 }
209 }209 }
210210
211 ListItem.Caption {
212 anchors {
213 left: parent.left
214 right: parent.right
215 leftMargin: units.gu(1)
216 rightMargin: units.gu(1)
217 }
218 text: i18n.tr("In order to create a hotspot, you need to turn Wi-Fi on.")
219 visible: !Connectivity.WifiEnabled
220 }
221
211 Row {222 Row {
212223
213 anchors {224 anchors {
@@ -230,11 +241,14 @@
230 objectName: "confirmButton"241 objectName: "confirmButton"
231 width: (parent.width / 2) - units.gu(1)242 width: (parent.width / 2) - units.gu(1)
232 text: hotspotSetupDialog.stored ? i18n.tr("Change") :243 text: hotspotSetupDialog.stored ? i18n.tr("Change") :
233 i18n.tr("Enable")244 i18n.tr("Start")
234 enabled: settingsValid()245 enabled: settingsValid()
235 activeFocusOnPress: false246 activeFocusOnPress: false
236 onClicked: {247 onClicked: {
237 if (hotspotSetupDialog.stored) {248 if (!Connectivity.WifiEnabled &&
249 !hotspotSetupDialog.stored) {
250 enableWifiAction.trigger();
251 } else if (hotspotSetupDialog.stored) {
238 changeAction.trigger()252 changeAction.trigger()
239 } else {253 } else {
240 enableAction.trigger();254 enableAction.trigger();
@@ -259,12 +273,22 @@
259 height: parent.height - units.gu(1.5)273 height: parent.height - units.gu(1.5)
260 }274 }
261 }275 }
262276 }
263 Button {277 }
264 visible: showAllUI278
265 // TRANSLATORS: This string is hidden.279 Action {
266 text: i18n.tr("Start")280 id: enableWifiAction
281 onTriggered: {
282 hotspotSetupDialog.state = "STARTING";
283
284 // As soon as Wi-Fi has been turned on, trigger enableAction.
285 function wifiUpdated (updated) {
286 Connectivity.wifiEnabledUpdated.disconnect(wifiUpdated);
287 enableAction.trigger();
267 }288 }
289
290 Connectivity.wifiEnabledUpdated.connect(wifiUpdated);
291 Connectivity.setwifiEnabled(true);
268 }292 }
269 }293 }
270294
271295
=== renamed file 'plugins/cellular/Hotspot.qml' => 'plugins/hotspot/PageComponent.qml'
--- plugins/cellular/Hotspot.qml 2015-08-10 20:04:29 +0000
+++ plugins/hotspot/PageComponent.qml 2015-08-14 11:52:44 +0000
@@ -1,7 +1,9 @@
1/*1/*
2 * This file is part of system-settings2 * This file is part of system-settings
3 *3 *
4 * Copyright (C) 2014 Canonical Ltd.4 * Copyright (C) 2015 Canonical Ltd.
5 *
6 * Contact: Jonas G. Drange <jonas.drange@canonical.com>
5 *7 *
6 * This program is free software: you can redistribute it and/or modify it8 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 3, as published9 * under the terms of the GNU General Public License version 3, as published
@@ -17,99 +19,167 @@
17 */19 */
1820
19import QtQuick 2.021import QtQuick 2.0
22import QMenuModel 0.1
20import SystemSettings 1.023import SystemSettings 1.0
21import Ubuntu.Components 0.124import Ubuntu.Components 1.3
22import Ubuntu.Components.ListItems 0.1 as ListItem25import Ubuntu.Components.ListItems 1.3 as ListItem
23import Ubuntu.Components.Popups 0.126import Ubuntu.Components.Popups 0.1
24import Ubuntu.Connectivity 1.027import Ubuntu.Connectivity 1.0
25import Ubuntu.Settings.Components 0.1 as USC28import Ubuntu.Settings.Components 0.1 as USC
26import Ubuntu.SystemSettings.Cellular 1.029
30/* This is a temporary solution to the issue of Hotspots failing on mako. If
31the device is mako, we hide the hotspot entry. Will be removed once lp:1434591
32has been resolved. */
33import Ubuntu.SystemSettings.Update 1.0
2734
28ItemPage {35ItemPage {
2936
30 id: hotspot37 id: root
31 objectName: "hotspotPage"38 objectName: "hotspotPage"
3239 title: i18n.tr("Hotspot")
33 // TRANSLATORS: “Hotspot” is hidden.40
34 title: showAllUI ? i18n.tr("Hotspot") : i18n.tr("Wi-Fi hotspot")41 states: [
3542 State {
36 // We disable the back action while a hotspot is in the process of either43 name: "disabled"
37 // being enabled or disabled.44 // Undefined WifiEnabled means Connectivity is unavailable.
38 head.backAction: Action {45 when: (typeof Connectivity.WifiEnabled === "undefined" &&
39 iconName: "back"46 UpdateManager.deviceName !== "mako")
40 enabled: !Connectivity.unstoppableOperationHappening47 PropertyChanges {
41 onTriggered: {48 target: hotspotItem
42 pageStack.pop();49 enabled: false
50 }
51 PropertyChanges {
52 target: hotspotSetupButton
53 enabled: false
54 }
55 },
56 State {
57 name: "nowifi"
58 when: (typeof Connectivity.WifiEnabled === "boolean" &&
59 !Connectivity.WifiEnabled)
60 PropertyChanges {
61 target: hotspotSwitchWhenWifiDisabled
62 visible: true
63 }
43 }64 }
44 }65 ]
4566
46 Loader {67 Loader {
47 id: setup68 id: setup
48 asynchronous: false69 asynchronous: false
49 }70 }
5071
51 Column {72 Flickable {
73 id: flick
5274
53 anchors.fill: parent75 anchors.fill: parent
54 spacing: units.gu(2)76 contentWidth: parent.width
5577 contentHeight: contentItem.childrenRect.height
56 ListItem.Standard {78 boundsBehavior: (contentHeight > root.height) ?
57 text: i18n.tr("Hotspot")79 Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
58 enabled: Connectivity.hotspotStored80
59 control: Switch {81 Column {
60 id: hotspotSwitch
61 objectName: "hotspotSwitch"
62 enabled: !switchSync.syncWaiting
63
64 USC.ServerPropertySynchroniser {
65 id: switchSync
66 userTarget: hotspotSwitch
67 userProperty: "checked"
68 serverTarget: Connectivity
69 serverProperty: "hotspotEnabled"
70 useWaitBuffer: true
71
72 // Since this blocks the UI thread, we wait until
73 // the UI has completed the checkbox animation before we
74 // ask the server to uipdate.
75 onSyncTriggered: {
76 triggerTimer.value = value;
77 triggerTimer.start();
78 }
79 }
80
81 Timer {
82 id: triggerTimer
83 property bool value
84 interval: 250; repeat: false
85 onTriggered: Connectivity.hotspotEnabled = value
86 }
87 }
88 }
89
90 ListItem.Caption {
91 anchors {82 anchors {
92 left: parent.left83 left: parent.left
93 right: parent.right84 right: parent.right
94 leftMargin: units.gu(2)85 }
95 rightMargin: units.gu(2)86 spacing: units.gu(2)
96 }87
97 text : hotspotSwitch.stored ?88 ListItem.Standard {
98 i18n.tr("When hotspot is on, other devices can use your cellular data connection over Wi-Fi. Normal data charges apply.")89 text: i18n.tr("Hotspot")
99 : i18n.tr("Other devices can use your cellular data connection over the Wi-Fi network. Normal data charges apply.")90 enabled: (Connectivity.hotspotStored &&
91 Connectivity.HotspotSwitchEnabled)
92 control: Switch {
93 id: hotspotSwitch
94 objectName: "hotspotSwitch"
95 enabled: Connectivity.HotspotSwitchEnabled
96
97 USC.ServerPropertySynchroniser {
98 id: switchSync
99 userTarget: hotspotSwitch
100 userProperty: "checked"
101 serverTarget: Connectivity
102 serverProperty: "hotspotEnabled"
103 useWaitBuffer: true
104
105 // Since this blocks the UI thread, we wait until
106 // the UI has completed the checkbox animation before we
107 // ask the server to uipdate.
108 onSyncTriggered: {
109 triggerTimer.value = value;
110 triggerTimer.start();
111 }
112 }
113
114 // Catch taps if Wi-Fi is disable and prompt user.
115 MouseArea {
116 id: hotspotSwitchWhenWifiDisabled
117 anchors.fill: parent
118 visible: false
119 onClicked: enableWifiAction.diag = PopupUtils.open(
120 enableWifiDialog
121 );
122 }
123
124 Timer {
125 id: triggerTimer
126 property bool value
127 interval: 250; repeat: false
128 onTriggered: Connectivity.hotspotEnabled = value
129 }
130 }
131 }
132
133 ListItem.Caption {
134 anchors {
135 left: parent.left
136 right: parent.right
137 leftMargin: units.gu(2)
138 rightMargin: units.gu(2)
139 }
140 text : Connectivity.hotspotStored ?
141 i18n.tr("When hotspot is on, other devices can use your cellular data connection over Wi-Fi. Normal data charges apply.")
142 : i18n.tr("Other devices can use your cellular data connection over the Wi-Fi network. Normal data charges apply.")
143 }
144
145 Button {
146 id: hotspotSetupButton
147 objectName: "hotspotSetupButton"
148 anchors.horizontalCenter: parent.horizontalCenter
149 width: parent.width - units.gu(4)
150
151 // If the hotspot is stored, we allow it to be changed. If it's
152 // non-existent, we only allow setup if it can be turned on.
153 // This is a by product of the current design.
154 enabled: (Connectivity.hotspotStored ||
155 Connectivity.HotspotSwitchEnabled)
156 text: Connectivity.hotspotStored ?
157 i18n.tr("Change password/setup…") : i18n.tr("Set up hotspot…")
158
159 onClicked: {
160 setup.setSource(Qt.resolvedUrl("HotspotSetup.qml"));
161 PopupUtils.open(setup.item, root, {});
162 }
163 }
100 }164 }
101165 }
102 Button {166
103 objectName: "hotspotSetupEntry"167 Action {
104 anchors.horizontalCenter: parent.horizontalCenter168 id: enableWifiAction
105 width: parent.width - units.gu(4)169 property var diag
106 text: Connectivity.hotspotStored ?170 onTriggered: {
107 i18n.tr("Change password/setup…") : i18n.tr("Set up hotspot…")171 // As soon as Wi-Fi has been turned on, activate the USC
108172 // synchroniser.
109 onClicked: {173 function wifiUpdated (updated) {
110 setup.setSource(Qt.resolvedUrl("HotspotSetup.qml"));174 Connectivity.wifiEnabledUpdated.disconnect(wifiUpdated);
111 PopupUtils.open(setup.item, hotspot, {175 switchSync.activate();
112 });176 PopupUtils.close(diag);
177 }
178
179 if (!Connectivity.wifiEnabled) {
180 Connectivity.wifiEnabledUpdated.connect(wifiUpdated);
181 hotspotSwitch.checked = true;
182 Connectivity.setwifiEnabled(true);
113 }183 }
114 }184 }
115 }185 }
@@ -117,23 +187,20 @@
117 Component {187 Component {
118 id: enableWifiDialog188 id: enableWifiDialog
119 Dialog {189 Dialog {
120 id: dialogue190 id: dialog
121 objectName: "enableWifiDialog"191 objectName: "enableWifiDialog"
122 // TRANSLATORS: This string is hidden.
123 title: i18n.tr("Wi-Fi is off")192 title: i18n.tr("Wi-Fi is off")
124 // TRANSLATORS: This string is hidden.
125 text: i18n.tr("In order to create a hotspot, you need to turn Wi-Fi on.")193 text: i18n.tr("In order to create a hotspot, you need to turn Wi-Fi on.")
126 visible: showAllUI
127194
128 Button {195 Button {
129 text: i18n.tr("Cancel")196 text: i18n.tr("Cancel")
130 onClicked: PopupUtils.close(dialogue)197 onClicked: PopupUtils.close(dialog)
131 }198 }
132199
133 Button {200 Button {
134 objectName: "confirmEnable"201 objectName: "confirmEnable"
135 // TRANSLATORS: This string is hidden.
136 text: i18n.tr("Turn on Wi-Fi")202 text: i18n.tr("Turn on Wi-Fi")
203 onClicked: enableWifiAction.trigger()
137 }204 }
138 }205 }
139 }206 }
140207
=== added file 'plugins/hotspot/hotspot.settings'
--- plugins/hotspot/hotspot.settings 1970-01-01 00:00:00 +0000
+++ plugins/hotspot/hotspot.settings 2015-08-14 11:52:44 +0000
@@ -0,0 +1,18 @@
1{
2 "icon": "preferences-network-hotspot-symbolic",
3 "name": "Hotspot",
4 "translations": "ubuntu-system-settings",
5 "category": "network",
6 "priority": 2,
7 "form-factors": [
8 "phone"
9 ],
10 "keywords": [
11 "network",
12 "hotspot",
13 "tethering"
14 ],
15 "has-dynamic-keywords": false,
16 "has-dynamic-visibility": false,
17 "page-component": "PageComponent.qml"
18}
019
=== added file 'plugins/hotspot/qmldir'
--- plugins/hotspot/qmldir 1970-01-01 00:00:00 +0000
+++ plugins/hotspot/qmldir 2015-08-14 11:52:44 +0000
@@ -0,0 +1,2 @@
1module Ubuntu.SystemSettings.Hotspot
2plugin UbuntuHotspotPanel
03
=== added file 'plugins/hotspot/settings-hotspot.svg'
--- plugins/hotspot/settings-hotspot.svg 1970-01-01 00:00:00 +0000
+++ plugins/hotspot/settings-hotspot.svg 2015-08-14 11:52:44 +0000
@@ -0,0 +1,182 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 width="96"
13 height="96"
14 id="svg4874"
15 version="1.1"
16 inkscape:version="0.91+devel r"
17 viewBox="0 0 96 96.000001"
18 sodipodi:docname="preferences-network-hotspot-symbolic.svg">
19 <defs
20 id="defs4876" />
21 <sodipodi:namedview
22 id="base"
23 pagecolor="#ffffff"
24 bordercolor="#666666"
25 borderopacity="1.0"
26 inkscape:pageopacity="0.0"
27 inkscape:pageshadow="2"
28 inkscape:zoom="5.6199991"
29 inkscape:cx="-39.092542"
30 inkscape:cy="39.181476"
31 inkscape:document-units="px"
32 inkscape:current-layer="g4780"
33 showgrid="true"
34 showborder="true"
35 fit-margin-top="0"
36 fit-margin-left="0"
37 fit-margin-right="0"
38 fit-margin-bottom="0"
39 inkscape:snap-bbox="true"
40 inkscape:bbox-paths="true"
41 inkscape:bbox-nodes="true"
42 inkscape:snap-bbox-edge-midpoints="true"
43 inkscape:snap-bbox-midpoints="true"
44 inkscape:object-paths="true"
45 inkscape:snap-intersection-paths="true"
46 inkscape:object-nodes="true"
47 inkscape:snap-smooth-nodes="true"
48 inkscape:snap-midpoints="true"
49 inkscape:snap-object-midpoints="true"
50 inkscape:snap-center="true"
51 showguides="true"
52 inkscape:guide-bbox="true"
53 inkscape:snap-global="true">
54 <inkscape:grid
55 type="xygrid"
56 id="grid5451"
57 empspacing="8" />
58 <sodipodi:guide
59 orientation="1,0"
60 position="8,-8.0000001"
61 id="guide4063" />
62 <sodipodi:guide
63 orientation="1,0"
64 position="4,-8.0000001"
65 id="guide4065" />
66 <sodipodi:guide
67 orientation="0,1"
68 position="-8,88.000001"
69 id="guide4067" />
70 <sodipodi:guide
71 orientation="0,1"
72 position="-8,92.000001"
73 id="guide4069" />
74 <sodipodi:guide
75 orientation="0,1"
76 position="104,4"
77 id="guide4071" />
78 <sodipodi:guide
79 orientation="0,1"
80 position="-5,8.0000001"
81 id="guide4073" />
82 <sodipodi:guide
83 orientation="1,0"
84 position="88,-8.0000001"
85 id="guide4077" />
86 <sodipodi:guide
87 orientation="0,1"
88 position="-8,84.000001"
89 id="guide4074" />
90 <sodipodi:guide
91 orientation="1,0"
92 position="12,-8.0000001"
93 id="guide4076" />
94 <sodipodi:guide
95 orientation="1,0"
96 position="84,-8.0000001"
97 id="guide4080" />
98 <sodipodi:guide
99 position="48,-8.0000001"
100 orientation="1,0"
101 id="guide4170" />
102 <sodipodi:guide
103 position="-8,48"
104 orientation="0,1"
105 id="guide4172" />
106 <sodipodi:guide
107 position="92,-8.0000001"
108 orientation="1,0"
109 id="guide4760" />
110 <sodipodi:guide
111 position="106,12"
112 orientation="0,1"
113 id="guide4211" />
114 </sodipodi:namedview>
115 <metadata
116 id="metadata4879">
117 <rdf:RDF>
118 <cc:Work
119 rdf:about="">
120 <dc:format>image/svg+xml</dc:format>
121 <dc:type
122 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
123 <dc:title></dc:title>
124 </cc:Work>
125 </rdf:RDF>
126 </metadata>
127 <g
128 inkscape:label="Layer 1"
129 inkscape:groupmode="layer"
130 id="layer1"
131 transform="translate(67.857146,-78.50504)">
132 <g
133 transform="matrix(0,-1,-1,0,373.50506,516.50504)"
134 id="g4845"
135 style="display:inline">
136 <g
137 inkscape:export-ydpi="90"
138 inkscape:export-xdpi="90"
139 inkscape:export-filename="next01.png"
140 transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
141 id="g4778"
142 inkscape:label="Layer 1">
143 <g
144 transform="matrix(-1,0,0,1,575.99999,611)"
145 id="g4780"
146 style="display:inline">
147 <rect
148 style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
149 id="rect4782"
150 width="96.037987"
151 height="96"
152 x="-438.00244"
153 y="345.36221"
154 transform="scale(-1,1)" />
155 <ellipse
156 style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60031652;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
157 id="path4213"
158 cx="-393.36221"
159 cy="-389.98346"
160 transform="matrix(0,-1,-1,0,0,0)"
161 rx="7.9999995"
162 ry="8.0031652" />
163 <path
164 style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
165 d="m 349.9668,391.36133 v 4.00195 h 40.01758 v -4.00195 z"
166 id="path4215"
167 inkscape:connector-curvature="0" />
168 <path
169 style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
170 d="m 415.98047,393.36133 c 0,6.65833 -2.5351,13.31837 -7.60547,18.38672 -10.14073,10.13669 -26.64247,10.13669 -36.7832,0 l 2.82812,-2.83008 c 8.61153,8.6081 22.51542,8.6081 31.12696,0 8.61153,-8.60811 8.61153,-22.50322 0,-31.11133 -8.61154,-8.6081 -22.51543,-8.6081 -31.12696,0 l -2.82812,-2.83008 c 10.14073,-10.1367 26.64247,-10.1367 36.7832,0 5.07037,5.06835 7.60547,11.72644 7.60547,18.38477 z"
171 id="ellipse4202"
172 inkscape:connector-curvature="0" />
173 <path
174 style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.00079107;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
175 d="m 431.98828,393.36133 c 0,10.75327 -4.09896,21.50653 -12.29492,29.69922 -16.39192,16.38537 -43.02801,16.38537 -59.41992,0 l 2.82812,-2.82813 c 14.86272,14.85678 38.90096,14.85678 53.76367,0 14.86272,-14.85678 14.86272,-38.88345 0,-53.74023 -14.86271,-14.85679 -38.90095,-14.85679 -53.76367,0 l -2.82812,-2.83008 c 16.39191,-16.38538 43.028,-16.38538 59.41992,0 8.19596,8.19269 12.29492,18.94594 12.29492,29.69922 z"
176 id="ellipse4204"
177 inkscape:connector-curvature="0" />
178 </g>
179 </g>
180 </g>
181 </g>
182</svg>
0183
=== modified file 'tests/autopilot/ubuntu_system_settings/__init__.py'
--- tests/autopilot/ubuntu_system_settings/__init__.py 2015-08-10 20:05:22 +0000
+++ tests/autopilot/ubuntu_system_settings/__init__.py 2015-08-14 11:52:44 +0000
@@ -87,6 +87,10 @@
87 return self._go_to_page('entryComponent-cellular', 'cellularPage')87 return self._go_to_page('entryComponent-cellular', 'cellularPage')
8888
89 @autopilot.logging.log_action(logger.debug)89 @autopilot.logging.log_action(logger.debug)
90 def go_to_hotspot_page(self):
91 return self._go_to_page('entryComponent-hotspot', 'hotspotPage')
92
93 @autopilot.logging.log_action(logger.debug)
90 def go_to_bluetooth_page(self):94 def go_to_bluetooth_page(self):
91 return self._go_to_page('entryComponent-bluetooth', 'bluetoothPage')95 return self._go_to_page('entryComponent-bluetooth', 'bluetoothPage')
9296
@@ -333,52 +337,8 @@
333 field.write(name)337 field.write(name)
334 self.pointing_device.click_object(ok)338 self.pointing_device.click_object(ok)
335339
336 """340
337 :returns: Whether or not hotspot can be used.341class HotspotPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
338 """
339 @autopilot.logging.log_action(logger.debug)
340 def have_hotspot(self):
341 return self.wait_select_single(objectName='hotspotEntry').visible
342
343 """
344 :param: Configuration with keys ssid and password.
345 :returns: Hotspot page.
346 """
347 @autopilot.logging.log_action(logger.debug)
348 def setup_hotspot(self, config=None):
349 hotspot_page = self._enter_hotspot()
350 hotspot_page.setup_hotspot(config)
351 return hotspot_page
352
353 """
354 Enables hotspot.
355 :returns: Hotspot page.
356 """
357 @autopilot.logging.log_action(logger.debug)
358 def enable_hotspot(self):
359 hotspot_page = self._enter_hotspot()
360 hotspot_page.enable_hotspot()
361 return hotspot_page
362
363 """
364 Disables hotspot.
365 :returns: Hotspot page.
366 """
367 @autopilot.logging.log_action(logger.debug)
368 def disable_hotspot(self):
369 hotspot_page = self._enter_hotspot()
370 hotspot_page.disable_hotspot()
371 return hotspot_page
372
373 @autopilot.logging.log_action(logger.debug)
374 def _enter_hotspot(self):
375 obj = self.wait_select_single(objectName="hotspotEntry")
376 self.pointing_device.click_object(obj)
377 return self.get_root_instance().wait_select_single(
378 objectName='hotspotPage')
379
380
381class Hotspot(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
382342
383 """Autopilot helper for Hotspot page."""343 """Autopilot helper for Hotspot page."""
384344
@@ -398,7 +358,23 @@
398358
399 @autopilot.logging.log_action(logger.debug)359 @autopilot.logging.log_action(logger.debug)
400 def enable_hotspot(self):360 def enable_hotspot(self):
401 self._switch.check()361 # We assume that the following AssertionError is due to the panel
362 # instantly setting checked to False, prompting the user to turn on
363 # Wi-Fi instead.
364 try:
365 self._switch.check(timeout=2)
366 except AssertionError:
367 pass
368
369 try:
370 prompt = self.get_root_instance().wait_select_single(
371 objectName='enableWifiDialog')
372 except StateNotFoundError:
373 prompt = None
374
375 if prompt:
376 prompt.confirm_enable()
377 prompt.wait_until_destroyed(timeout=5)
402378
403 @autopilot.logging.log_action(logger.debug)379 @autopilot.logging.log_action(logger.debug)
404 def disable_hotspot(self):380 def disable_hotspot(self):
@@ -406,7 +382,7 @@
406382
407 @autopilot.logging.log_action(logger.debug)383 @autopilot.logging.log_action(logger.debug)
408 def setup_hotspot(self, config):384 def setup_hotspot(self, config):
409 obj = self.select_single(objectName='hotspotSetupEntry')385 obj = self.select_single(objectName='hotspotSetupButton')
410 self.pointing_device.click_object(obj)386 self.pointing_device.click_object(obj)
411 setup = self.get_root_instance().wait_select_single(387 setup = self.get_root_instance().wait_select_single(
412 objectName='hotspotSetup')388 objectName='hotspotSetup')
@@ -423,6 +399,28 @@
423 def get_hotspot_status(self):399 def get_hotspot_status(self):
424 return self._switch.checked400 return self._switch.checked
425401
402 @autopilot.logging.log_action(logger.debug)
403 def get_hotspot_possible(self):
404 return self._switch.enabled
405
406
407class HotspotEnableWifiDialog(
408 ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
409 """Autopilot helper for the 'Turn on Wi-Fi' dialog in hotspot panel."""
410
411 @classmethod
412 def validate_dbus_object(cls, path, state):
413 name = introspection.get_classname_from_path(path)
414 if name == b'Dialog':
415 if state['objectName'][1] == 'enableWifiDialog':
416 return True
417 return False
418
419 @autopilot.logging.log_action(logger.debug)
420 def confirm_enable(self):
421 button = self.select_single('Button', objectName='confirmEnable')
422 self.pointing_device.click_object(button)
423
426424
427class HotspotSetup(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):425class HotspotSetup(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
428426
429427
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py'
--- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2015-08-06 17:15:50 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2015-08-14 11:52:44 +0000
@@ -395,7 +395,8 @@
395 context.SetProperty(key, value)395 context.SetProperty(key, value)
396396
397397
398class HotspotBaseTestCase(CellularBaseTestCase):398class HotspotBaseTestCase(UbuntuSystemSettingsTestCase,
399 dbusmock.DBusTestCase):
399400
400 connectivity_parameters = {}401 connectivity_parameters = {}
401 indicatornetwork_parameters = {}402 indicatornetwork_parameters = {}
@@ -431,6 +432,7 @@
431 stdout=subprocess.PIPE)432 stdout=subprocess.PIPE)
432433
433 super(HotspotBaseTestCase, self).setUp()434 super(HotspotBaseTestCase, self).setUp()
435 self.hotspot_page = self.main_view.go_to_hotspot_page()
434436
435 def tearDown(self):437 def tearDown(self):
436 self.ctv_mock.terminate()438 self.ctv_mock.terminate()
437439
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/connectivity.py'
--- tests/autopilot/ubuntu_system_settings/tests/connectivity.py 2015-08-10 11:01:34 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/connectivity.py 2015-08-14 11:52:44 +0000
@@ -47,6 +47,10 @@
47 self.SetProperty(PRIV_OBJ, PRIV_IFACE, 'HotspotPassword', value)47 self.SetProperty(PRIV_OBJ, PRIV_IFACE, 'HotspotPassword', value)
4848
4949
50def set_wifi_enabled(self, value):
51 self.SetProperty(NETS_OBJ, NETS_IFACE, 'WifiEnabled', value)
52
53
50def load(mock, parameters):54def load(mock, parameters):
51 global _parameters55 global _parameters
52 _parameters = parameters56 _parameters = parameters
@@ -54,6 +58,7 @@
54 mock.set_hotspot_enabled = set_hotspot_enabled58 mock.set_hotspot_enabled = set_hotspot_enabled
55 mock.set_hotspot_ssid = set_hotspot_ssid59 mock.set_hotspot_ssid = set_hotspot_ssid
56 mock.set_hotspot_password = set_hotspot_password60 mock.set_hotspot_password = set_hotspot_password
61 mock.set_wifi_enabled = set_wifi_enabled
5762
58 mock.AddObject(63 mock.AddObject(
59 NETS_OBJ,64 NETS_OBJ,
@@ -67,7 +72,15 @@
67 'HotspotStored': _parameters.get(72 'HotspotStored': _parameters.get(
68 'HotspotStored', dbus.Boolean(False)73 'HotspotStored', dbus.Boolean(False)
69 ),74 ),
70 'UnstoppableOperationHappening': dbus.Boolean(False),75 'FlightModeSwitchEnabled': _parameters.get(
76 'FlightModeSwitchEnabled', dbus.Boolean(False)
77 ),
78 'WifiSwitchEnabled': _parameters.get(
79 'WifiSwitchEnabled', dbus.Boolean(False)
80 ),
81 'HotspotSwitchEnabled': _parameters.get(
82 'HotspotSwitchEnabled', dbus.Boolean(False)
83 ),
71 'WifiEnabled': _parameters.get('WifiEnabled', dbus.Boolean(False)),84 'WifiEnabled': _parameters.get('WifiEnabled', dbus.Boolean(False)),
72 # One of online, offline and connecting.85 # One of online, offline and connecting.
73 'Status': _parameters.get('Status', 'offline')86 'Status': _parameters.get('Status', 'offline')
@@ -98,7 +111,7 @@
98 ),111 ),
99 (112 (
100 'SetWifiEnabled', 'b', '',113 'SetWifiEnabled', 'b', '',
101 ''114 'objects["/"].set_wifi_enabled(self, args[0])'
102 ),115 ),
103 (116 (
104 'SetHotspotSsid', 'ay', '',117 'SetHotspotSsid', 'ay', '',
105118
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py'
--- tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py 2015-08-10 11:01:34 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py 2015-08-14 11:52:44 +0000
@@ -26,7 +26,16 @@
2626
2727
28def activate(self, action_name, parameters, platform_data):28def activate(self, action_name, parameters, platform_data):
29 pass29
30 if action_name == 'wifi.enable':
31 enabled, sig, states = self.actions[action_name]
32 state = dbus.Boolean(not states[0], variant_level=1)
33 new_struct = (enabled, sig, [state])
34 self.actions[action_name] = new_struct
35 self.Changes(dbus.Array([], signature='s'),
36 dbus.Dictionary({}, signature='sb'),
37 dbus.Dictionary({action_name: state}, signature='sv'),
38 dbus.Dictionary({}, signature='s(bgav)'))
3039
3140
32def describe(self, action_name):41def describe(self, action_name):
@@ -52,19 +61,19 @@
52 obj.EmitSignal(MAIN_IFACE, 'Changed', 'asa{sb}a{sv}a{s(bgav)}', [61 obj.EmitSignal(MAIN_IFACE, 'Changed', 'asa{sb}a{sv}a{s(bgav)}', [
53 removals, enable_changes, state_changes, additions62 removals, enable_changes, state_changes, additions
54 ])63 ])
55 pass
5664
5765
58def load(mock, parameters):66def load(mock, parameters):
59 global _parameters67 global _parameters
60 _parameters = parameters68 _parameters = parameters
6169
70 mock.activate = activate
62 mock.describe = describe71 mock.describe = describe
63 mock.describe_all = describe_all72 mock.describe_all = describe_all
64 mock.list_actions = list_actions73 mock.list_actions = list_actions
65 mock.set_state = set_state74 mock.set_state = set_state
6675
67 mock.actions = parameters.get('actions', {76 mock.actions = _parameters.get('actions', {
68 'wifi.enable': (True, '', [True]),77 'wifi.enable': (True, '', [True]),
69 })78 })
7079
@@ -72,7 +81,8 @@
72 MAIN_IFACE,81 MAIN_IFACE,
73 [82 [
74 (83 (
75 'Activate', 'sava{sv}', '', ''84 'Activate', 'sava{sv}', '',
85 'self.activate(self, args[0], args[1], args[2])'
76 ),86 ),
77 (87 (
78 'Describe', 's', '(bgav)',88 'Describe', 's', '(bgav)',
7989
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_cellular.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2015-08-10 20:05:22 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2015-08-14 11:52:44 +0000
@@ -13,14 +13,10 @@
13from testtools.matchers import Equals, raises, StartsWith13from testtools.matchers import Equals, raises, StartsWith
1414
15from ubuntu_system_settings.tests import (15from ubuntu_system_settings.tests import (
16 CellularBaseTestCase, HotspotBaseTestCase, CONNMAN_IFACE, RDO_IFACE,16 CellularBaseTestCase, CONNMAN_IFACE, RDO_IFACE,
17 NETREG_IFACE)17 NETREG_IFACE)
1818
1919
20from ubuntu_system_settings.tests.connectivity import (
21 PRIV_IFACE as CTV_PRIV_IFACE, NETS_IFACE as CTV_NETS_IFACE
22)
23
24DEV_IFACE = 'org.freedesktop.NetworkManager.Device'20DEV_IFACE = 'org.freedesktop.NetworkManager.Device'
2521
2622
@@ -307,106 +303,6 @@
307 Eventually(Equals('/ril_1')))303 Eventually(Equals('/ril_1')))
308304
309305
310class HotspotNonExistantTestCase(HotspotBaseTestCase):
311
312 connectivity_parameters = {
313 'HotspotEnabled': False,
314 'HotspotStored': False
315 }
316
317 def test_setup(self):
318 ssid = 'bar'
319 password = 'zomgzomg'
320 config = {'ssid': ssid, 'password': password}
321
322 hotspot_page = self.cellular_page.setup_hotspot(config)
323
324 # Assert that the switch is on.
325 self.assertTrue(hotspot_page.get_hotspot_status())
326
327 self.assertThat(
328 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
329 Eventually(Equals(True))
330 )
331
332 self.assertThat(
333 lambda: bytearray(
334 self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotSsid')
335 ).decode('UTF-8'),
336 Eventually(Equals(ssid))
337 )
338
339 self.assertThat(
340 lambda: self.ctv_private.Get(CTV_PRIV_IFACE, 'HotspotPassword'),
341 Eventually(Equals(password))
342 )
343
344 self.assertThat(
345 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotStored'),
346 Eventually(Equals(True))
347 )
348
349
350class HotspotExistsTestCase(HotspotBaseTestCase):
351
352 connectivity_parameters = {
353 'HotspotStored': True
354 }
355
356 def test_enabling(self):
357 self.assertThat(
358 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
359 Eventually(Equals(False))
360 )
361
362 self.cellular_page.enable_hotspot()
363
364 self.assertThat(
365 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
366 Eventually(Equals(True))
367 )
368
369 def test_changing(self):
370 ssid = 'bar'
371 password = 'zomgzomg'
372 config = {'ssid': ssid, 'password': password}
373 self.cellular_page.setup_hotspot(config)
374
375 self.assertThat(
376 lambda: bytearray(
377 self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotSsid')
378 ).decode('UTF-8'),
379 Eventually(Equals(ssid))
380 )
381
382 self.assertThat(
383 lambda: self.ctv_private.Get(CTV_PRIV_IFACE, 'HotspotPassword'),
384 Eventually(Equals(password))
385 )
386
387
388class HotspotEnabledTestCase(HotspotBaseTestCase):
389
390 connectivity_parameters = {
391 'HotspotStored': True,
392 'HotspotEnabled': True
393 }
394
395 def test_disabling(self):
396
397 self.assertThat(
398 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
399 Eventually(Equals(True))
400 )
401
402 self.cellular_page.disable_hotspot()
403
404 self.assertThat(
405 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
406 Eventually(Equals(False))
407 )
408
409
410class ApnTestCase(CellularBaseTestCase):306class ApnTestCase(CellularBaseTestCase):
411307
412 def test_remove_apn(self):308 def test_remove_apn(self):
413309
=== added file 'tests/autopilot/ubuntu_system_settings/tests/test_hotspot.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_hotspot.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_hotspot.py 2015-08-14 11:52:44 +0000
@@ -0,0 +1,228 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2# Copyright 2014 Canonical
3#
4# This program is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License version 3, as published
6# by the Free Software Foundation.
7
8from autopilot.matchers import Eventually
9from testtools.matchers import Equals
10
11from ubuntu_system_settings.tests import HotspotBaseTestCase
12
13from ubuntu_system_settings.tests.connectivity import (
14 PRIV_IFACE as CTV_PRIV_IFACE, NETS_IFACE as CTV_NETS_IFACE
15)
16
17
18class HotspotSetupTestCase(HotspotBaseTestCase):
19
20 connectivity_parameters = {
21 'HotspotEnabled': False,
22 'HotspotStored': False,
23 'WifiEnabled': True,
24 'HotspotSwitchEnabled': True
25 }
26
27 def test_setup(self):
28 ssid = 'bar'
29 password = 'zomgzomg'
30 config = {'ssid': ssid, 'password': password}
31
32 self.hotspot_page.setup_hotspot(config)
33
34 # Assert that the switch is on.
35 self.assertTrue(self.hotspot_page.get_hotspot_status())
36
37 self.assertThat(
38 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
39 Eventually(Equals(True))
40 )
41
42 self.assertThat(
43 lambda: bytearray(
44 self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotSsid')
45 ).decode('UTF-8'),
46 Eventually(Equals(ssid))
47 )
48
49 self.assertThat(
50 lambda: self.ctv_private.Get(CTV_PRIV_IFACE, 'HotspotPassword'),
51 Eventually(Equals(password))
52 )
53
54 self.assertThat(
55 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotStored'),
56 Eventually(Equals(True))
57 )
58
59
60class HotspotExistsTestCase(HotspotBaseTestCase):
61
62 connectivity_parameters = {
63 'HotspotStored': True,
64 'WifiEnabled': True,
65 'HotspotSwitchEnabled': True
66 }
67
68 def test_enabling(self):
69 self.assertThat(
70 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
71 Eventually(Equals(False))
72 )
73
74 self.hotspot_page.enable_hotspot()
75
76 self.assertThat(
77 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
78 Eventually(Equals(True))
79 )
80
81 def test_changing(self):
82 ssid = 'bar'
83 password = 'zomgzomg'
84 config = {'ssid': ssid, 'password': password}
85 self.hotspot_page.setup_hotspot(config)
86
87 self.assertThat(
88 lambda: bytearray(
89 self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotSsid')
90 ).decode('UTF-8'),
91 Eventually(Equals(ssid))
92 )
93
94 self.assertThat(
95 lambda: self.ctv_private.Get(CTV_PRIV_IFACE, 'HotspotPassword'),
96 Eventually(Equals(password))
97 )
98
99
100class HotspotRunningTestCase(HotspotBaseTestCase):
101
102 connectivity_parameters = {
103 'HotspotStored': True,
104 'HotspotEnabled': True,
105 'WifiEnabled': True,
106 'HotspotSwitchEnabled': True
107 }
108
109 def test_disabling(self):
110
111 self.assertThat(
112 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
113 Eventually(Equals(True))
114 )
115
116 self.hotspot_page.disable_hotspot()
117
118 self.assertThat(
119 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
120 Eventually(Equals(False))
121 )
122
123
124class HotspotChangeNoWiFiTestCase(HotspotBaseTestCase):
125
126 connectivity_parameters = {
127 'HotspotStored': True,
128 'HotspotEnabled': False,
129 'WifiEnabled': False,
130 'HotspotSwitchEnabled': True
131 }
132
133 def test_enabling(self):
134
135 self.assertThat(
136 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
137 Eventually(Equals(False))
138 )
139
140 self.assertThat(
141 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'WifiEnabled'),
142 Eventually(Equals(False))
143 )
144
145 self.hotspot_page.enable_hotspot()
146
147 self.assertThat(
148 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
149 Eventually(Equals(True))
150 )
151
152 self.assertThat(
153 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'WifiEnabled'),
154 Eventually(Equals(True))
155 )
156
157
158class HotspotSetupNoWiFiTestCase(HotspotBaseTestCase):
159
160 connectivity_parameters = {
161 'HotspotStored': False,
162 'HotspotEnabled': False,
163 'WifiEnabled': False,
164 'HotspotSwitchEnabled': True
165 }
166
167 def test_setup(self):
168 ssid = 'bar'
169 password = 'zomgzomg'
170 config = {'ssid': ssid, 'password': password}
171
172 self.assertThat(
173 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotStored'),
174 Eventually(Equals(False))
175 )
176
177 self.assertThat(
178 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'WifiEnabled'),
179 Eventually(Equals(False))
180 )
181
182 self.hotspot_page.setup_hotspot(config)
183
184 self.assertThat(
185 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotStored'),
186 Eventually(Equals(True))
187 )
188
189 self.assertThat(
190 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'),
191 Eventually(Equals(True))
192 )
193
194 self.assertThat(
195 lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'WifiEnabled'),
196 Eventually(Equals(True))
197 )
198
199
200class HotspotChangeInFlightModeTestCase(HotspotBaseTestCase):
201
202 connectivity_parameters = {
203 'HotspotStored': True,
204 'HotspotEnabled': False,
205 'WifiEnabled': True,
206 'HotspotSwitchEnabled': False
207 }
208
209 def test_switch_disabled(self):
210 self.assertFalse(self.hotspot_page.get_hotspot_possible())
211
212
213class HotspotSetupInFlightModeTestCase(
214 HotspotBaseTestCase):
215
216 connectivity_parameters = {
217 'HotspotStored': False,
218 'HotspotEnabled': False,
219 'WifiEnabled': True,
220 'HotspotSwitchEnabled': False
221 }
222
223 def test_setup_disabled(self):
224 setup = self.hotspot_page.select_single(
225 objectName='hotspotSetupButton'
226 )
227 self.assertFalse(setup.enabled)
228 self.assertFalse(self.hotspot_page.get_hotspot_possible())
0229
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_phone.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2015-08-05 13:19:19 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2015-08-14 11:52:44 +0000
@@ -31,7 +31,7 @@
3131
32 # Check that the forward has been set32 # Check that the forward has been set
33 self.assertThat(33 self.assertThat(
34 call_fwd_page.get_forward_unconditionally,34 call_fwd_page.get_forward_unconditionally(),
35 Eventually(Equals('41444424')))35 Eventually(Equals('41444424')))
3636
37 # Check that dbus properties have been updated37 # Check that dbus properties have been updated
@@ -53,7 +53,7 @@
5353
54 # Check that the forward has been unset54 # Check that the forward has been unset
55 self.assertThat(55 self.assertThat(
56 call_fwd_page.get_forward_unconditionally,56 call_fwd_page.get_forward_unconditionally(),
57 Eventually(Equals('')))57 Eventually(Equals('')))
5858
59 # Check that dbus properties have been updated59 # Check that dbus properties have been updated
@@ -67,7 +67,7 @@
6767
68 # Check that the forward has been set68 # Check that the forward has been set
69 self.assertThat(69 self.assertThat(
70 call_fwd_page.get_forward_on_busy,70 call_fwd_page.get_forward_on_busy(),
71 Eventually(Equals('41444424')))71 Eventually(Equals('41444424')))
7272
73 # Check that dbus properties have been updated73 # Check that dbus properties have been updated
@@ -80,7 +80,7 @@
8080
81 # Check that the forward has been unset81 # Check that the forward has been unset
82 self.assertThat(82 self.assertThat(
83 call_fwd_page.get_forward_on_busy,83 call_fwd_page.get_forward_on_busy(),
84 Eventually(Equals('')))84 Eventually(Equals('')))
8585
86 # Check that dbus properties have been updated86 # Check that dbus properties have been updated
@@ -94,7 +94,7 @@
9494
95 # Check that the forward has been set95 # Check that the forward has been set
96 self.assertThat(96 self.assertThat(
97 call_fwd_page.get_forward_when_no_answer,97 call_fwd_page.get_forward_when_no_answer(),
98 Eventually(Equals('41444424')))98 Eventually(Equals('41444424')))
9999
100 # Check that dbus properties have been updated100 # Check that dbus properties have been updated
@@ -107,7 +107,7 @@
107107
108 # Check that the forward has been unset108 # Check that the forward has been unset
109 self.assertThat(109 self.assertThat(
110 call_fwd_page.get_forward_when_no_answer,110 call_fwd_page.get_forward_when_no_answer(),
111 Eventually(Equals('')))111 Eventually(Equals('')))
112112
113 # Check that dbus properties have been updated113 # Check that dbus properties have been updated
@@ -123,7 +123,7 @@
123123
124 # Check that the forward has been set124 # Check that the forward has been set
125 self.assertThat(125 self.assertThat(
126 call_fwd_page.get_forward_when_unreachable,126 call_fwd_page.get_forward_when_unreachable(),
127 Eventually(Equals('41444424')))127 Eventually(Equals('41444424')))
128128
129 # Check that dbus properties have been updated129 # Check that dbus properties have been updated
@@ -136,7 +136,7 @@
136136
137 # Check that the forward has been unset137 # Check that the forward has been unset
138 self.assertThat(138 self.assertThat(
139 call_fwd_page.get_forward_when_unreachable,139 call_fwd_page.get_forward_when_unreachable(),
140 Eventually(Equals('')))140 Eventually(Equals('')))
141141
142 # Check that dbus properties have been updated142 # Check that dbus properties have been updated
@@ -174,7 +174,7 @@
174 # TODO: Test the Services page itself.174 # TODO: Test the Services page itself.
175 def test_sim_services(self):175 def test_sim_services(self):
176 self.assertThat(176 self.assertThat(
177 self.phone_page.get_sim_services_enabled,177 self.phone_page.get_sim_services_enabled(),
178 Eventually(Equals(True)))178 Eventually(Equals(True)))
179 self.phone_page.go_to_sim_services()179 self.phone_page.go_to_sim_services()
180 self.main_view.go_back()180 self.main_view.go_back()
@@ -182,7 +182,7 @@
182 SIM_IFACE, 'PropertyChanged', 'sv',182 SIM_IFACE, 'PropertyChanged', 'sv',
183 ['ServiceNumbers', ''])183 ['ServiceNumbers', ''])
184 self.assertThat(184 self.assertThat(
185 self.phone_page.get_sim_services_enabled,185 self.phone_page.get_sim_services_enabled(),
186 Eventually(Equals(False)))186 Eventually(Equals(False)))
187187
188188
@@ -199,7 +199,7 @@
199199
200 # Check that the forward has been set200 # Check that the forward has been set
201 self.assertThat(201 self.assertThat(
202 call_fwd_page.get_forward_unconditionally,202 call_fwd_page.get_forward_unconditionally(),
203 Eventually(Equals('41444424')))203 Eventually(Equals('41444424')))
204204
205 # Check that dbus properties have been updated205 # Check that dbus properties have been updated
@@ -221,7 +221,7 @@
221221
222 # Check that the forward has been unset222 # Check that the forward has been unset
223 self.assertThat(223 self.assertThat(
224 call_fwd_page.get_forward_unconditionally,224 call_fwd_page.get_forward_unconditionally(),
225 Eventually(Equals('')))225 Eventually(Equals('')))
226226
227 # Check that dbus properties have been updated227 # Check that dbus properties have been updated
@@ -236,7 +236,7 @@
236236
237 # Check that the forward has been set237 # Check that the forward has been set
238 self.assertThat(238 self.assertThat(
239 call_fwd_page.get_forward_on_busy,239 call_fwd_page.get_forward_on_busy(),
240 Eventually(Equals('41444424')))240 Eventually(Equals('41444424')))
241241
242 # Check that dbus properties have been updated242 # Check that dbus properties have been updated
@@ -249,7 +249,7 @@
249249
250 # Check that the forward has been unset250 # Check that the forward has been unset
251 self.assertThat(251 self.assertThat(
252 call_fwd_page.get_forward_on_busy,252 call_fwd_page.get_forward_on_busy(),
253 Eventually(Equals('')))253 Eventually(Equals('')))
254254
255 # Check that dbus properties have been updated255 # Check that dbus properties have been updated
@@ -264,7 +264,7 @@
264264
265 # Check that the forward has been set265 # Check that the forward has been set
266 self.assertThat(266 self.assertThat(
267 call_fwd_page.get_forward_when_no_answer,267 call_fwd_page.get_forward_when_no_answer(),
268 Eventually(Equals('41444424')))268 Eventually(Equals('41444424')))
269269
270 # Check that dbus properties have been updated270 # Check that dbus properties have been updated
@@ -277,7 +277,7 @@
277277
278 # Check that the forward has been unset278 # Check that the forward has been unset
279 self.assertThat(279 self.assertThat(
280 call_fwd_page.get_forward_when_no_answer,280 call_fwd_page.get_forward_when_no_answer(),
281 Eventually(Equals('')))281 Eventually(Equals('')))
282282
283 # Check that dbus properties have been updated283 # Check that dbus properties have been updated
@@ -293,7 +293,7 @@
293293
294 # Check that the forward has been set294 # Check that the forward has been set
295 self.assertThat(295 self.assertThat(
296 call_fwd_page.get_forward_when_unreachable,296 call_fwd_page.get_forward_when_unreachable(),
297 Eventually(Equals('41444424')))297 Eventually(Equals('41444424')))
298298
299 # Check that dbus properties have been updated299 # Check that dbus properties have been updated
@@ -306,7 +306,7 @@
306306
307 # Check that the forward has been unset307 # Check that the forward has been unset
308 self.assertThat(308 self.assertThat(
309 call_fwd_page.get_forward_when_unreachable,309 call_fwd_page.get_forward_when_unreachable(),
310 Eventually(Equals('')))310 Eventually(Equals('')))
311311
312 # Check that dbus properties have been updated312 # Check that dbus properties have been updated
@@ -324,7 +324,7 @@
324324
325 # Check that the forward has been set325 # Check that the forward has been set
326 self.assertThat(326 self.assertThat(
327 call_fwd_page.get_forward_unconditionally,327 call_fwd_page.get_forward_unconditionally(),
328 Eventually(Equals('41444424')))328 Eventually(Equals('41444424')))
329329
330 # Check that dbus properties have been updated330 # Check that dbus properties have been updated
@@ -346,7 +346,7 @@
346346
347 # Check that the forward has been unset347 # Check that the forward has been unset
348 self.assertThat(348 self.assertThat(
349 call_fwd_page.get_forward_unconditionally,349 call_fwd_page.get_forward_unconditionally(),
350 Eventually(Equals('')))350 Eventually(Equals('')))
351351
352 # Check that dbus properties have been updated352 # Check that dbus properties have been updated
@@ -361,7 +361,7 @@
361361
362 # Check that the forward has been set362 # Check that the forward has been set
363 self.assertThat(363 self.assertThat(
364 call_fwd_page.get_forward_on_busy,364 call_fwd_page.get_forward_on_busy(),
365 Eventually(Equals('41444424')))365 Eventually(Equals('41444424')))
366366
367 # Check that dbus properties have been updated367 # Check that dbus properties have been updated
@@ -374,7 +374,7 @@
374374
375 # Check that the forward has been unset375 # Check that the forward has been unset
376 self.assertThat(376 self.assertThat(
377 call_fwd_page.get_forward_on_busy,377 call_fwd_page.get_forward_on_busy(),
378 Eventually(Equals('')))378 Eventually(Equals('')))
379379
380 # Check that dbus properties have been updated380 # Check that dbus properties have been updated
@@ -389,7 +389,7 @@
389389
390 # Check that the forward has been set390 # Check that the forward has been set
391 self.assertThat(391 self.assertThat(
392 call_fwd_page.get_forward_when_no_answer,392 call_fwd_page.get_forward_when_no_answer(),
393 Eventually(Equals('41444424')))393 Eventually(Equals('41444424')))
394394
395 # Check that dbus properties have been updated395 # Check that dbus properties have been updated
@@ -402,7 +402,7 @@
402402
403 # Check that the forward has been unset403 # Check that the forward has been unset
404 self.assertThat(404 self.assertThat(
405 call_fwd_page.get_forward_when_no_answer,405 call_fwd_page.get_forward_when_no_answer(),
406 Eventually(Equals('')))406 Eventually(Equals('')))
407407
408 # Check that dbus properties have been updated408 # Check that dbus properties have been updated
@@ -418,7 +418,7 @@
418418
419 # Check that the forward has been set419 # Check that the forward has been set
420 self.assertThat(420 self.assertThat(
421 call_fwd_page.get_forward_when_unreachable,421 call_fwd_page.get_forward_when_unreachable(),
422 Eventually(Equals('41444424')))422 Eventually(Equals('41444424')))
423423
424 # Check that dbus properties have been updated424 # Check that dbus properties have been updated
@@ -431,7 +431,7 @@
431431
432 # Check that the forward has been unset432 # Check that the forward has been unset
433 self.assertThat(433 self.assertThat(
434 call_fwd_page.get_forward_when_unreachable,434 call_fwd_page.get_forward_when_unreachable(),
435 Eventually(Equals('')))435 Eventually(Equals('')))
436436
437 # Check that dbus properties have been updated437 # Check that dbus properties have been updated
@@ -495,7 +495,7 @@
495 # TODO: Test the Services page itself.495 # TODO: Test the Services page itself.
496 def test_sim_services_sim_1(self):496 def test_sim_services_sim_1(self):
497 self.assertThat(497 self.assertThat(
498 lambda: self.phone_page.get_sim_services_enabled(sim=0),498 self.phone_page.get_sim_services_enabled(sim=0),
499 Eventually(Equals(True)))499 Eventually(Equals(True)))
500 self.phone_page.go_to_sim_services(sim=0)500 self.phone_page.go_to_sim_services(sim=0)
501 self.main_view.go_back()501 self.main_view.go_back()
@@ -503,13 +503,13 @@
503 SIM_IFACE, 'PropertyChanged', 'sv',503 SIM_IFACE, 'PropertyChanged', 'sv',
504 ['ServiceNumbers', ''])504 ['ServiceNumbers', ''])
505 self.assertThat(505 self.assertThat(
506 lambda: self.phone_page.get_sim_services_enabled(sim=0),506 self.phone_page.get_sim_services_enabled(sim=0),
507 Eventually(Equals(False)))507 Eventually(Equals(False)))
508508
509 # TODO: Test the Services page itself.509 # TODO: Test the Services page itself.
510 def test_sim_services_sim_2(self):510 def test_sim_services_sim_2(self):
511 self.assertThat(511 self.assertThat(
512 lambda: self.phone_page.get_sim_services_enabled(sim=1),512 self.phone_page.get_sim_services_enabled(sim=1),
513 Eventually(Equals(True)))513 Eventually(Equals(True)))
514 self.phone_page.go_to_sim_services(sim=1)514 self.phone_page.go_to_sim_services(sim=1)
515 self.main_view.go_back()515 self.main_view.go_back()
@@ -517,5 +517,5 @@
517 SIM_IFACE, 'PropertyChanged', 'sv',517 SIM_IFACE, 'PropertyChanged', 'sv',
518 ['ServiceNumbers', ''])518 ['ServiceNumbers', ''])
519 self.assertThat(519 self.assertThat(
520 lambda: self.phone_page.get_sim_services_enabled(sim=1),520 self.phone_page.get_sim_services_enabled(sim=1),
521 Eventually(Equals(False)))521 Eventually(Equals(False)))
522522
=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_plugins.py'
--- tests/autopilot/ubuntu_system_settings/tests/test_plugins.py 2014-12-02 06:40:54 +0000
+++ tests/autopilot/ubuntu_system_settings/tests/test_plugins.py 2015-08-14 11:52:44 +0000
@@ -87,6 +87,13 @@
87 )87 )
88 self.assertThat(plugin, NotEquals(None))88 self.assertThat(plugin, NotEquals(None))
8989
90 def test_hotspot_plugin(self):
91 """ Checks whether the Hotspot plugin is available """
92 plugin = self.main_view.select_single(
93 objectName='entryComponent-hotspot'
94 )
95 self.assertThat(plugin, NotEquals(None))
96
90 def test_background_plugin(self):97 def test_background_plugin(self):
91 """ Checks whether the Background plugin is available """98 """ Checks whether the Background plugin is available """
92 plugin = self.main_view.select_single(99 plugin = self.main_view.select_single(

Subscribers

People subscribed via source and target branches

to all changes: