Merge lp:~jonas-drange/ubuntu-system-settings/hotspots-new-design into lp:~jonas-drange/ubuntu-system-settings/hotspots
- hotspots-new-design
- Merge into hotspots
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 |
Related bugs: |
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
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
- 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
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1508
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1509. By Jonas G. Drange
-
fix json error in cellular.settings
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1509
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1510. By Jonas G. Drange
-
add hotspot test plugin
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1510
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1510
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1510
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 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
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1510
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 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
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2015-08-10 13:20:25 +0000 | |||
3 | +++ debian/changelog 2015-08-14 11:52:44 +0000 | |||
4 | @@ -1,3 +1,11 @@ | |||
5 | 1 | ubuntu-system-settings (0.3+15.10.20150812-0ubuntu1) wily; urgency=medium | ||
6 | 2 | |||
7 | 3 | [ jonas-drange ] | ||
8 | 4 | * [cellular] add hotspot support by use of the Connectivity API (LP: | ||
9 | 5 | #1477300, #1421583) | ||
10 | 6 | |||
11 | 7 | -- CI Train Bot <ci-train-bot@canonical.com> Wed, 12 Aug 2015 12:20:19 +0000 | ||
12 | 8 | |||
13 | 1 | ubuntu-system-settings (0.3+15.10.20150810-0ubuntu1) wily; urgency=medium | 9 | ubuntu-system-settings (0.3+15.10.20150810-0ubuntu1) wily; urgency=medium |
14 | 2 | 10 | ||
15 | 3 | [ Ken VanDine ] | 11 | [ Ken VanDine ] |
16 | 4 | 12 | ||
17 | === modified file 'debian/control' | |||
18 | --- debian/control 2015-07-16 09:22:42 +0000 | |||
19 | +++ debian/control 2015-08-14 11:52:44 +0000 | |||
20 | @@ -23,7 +23,7 @@ | |||
21 | 23 | libunity-api-dev, | 23 | libunity-api-dev, |
22 | 24 | libupower-glib-dev, | 24 | libupower-glib-dev, |
23 | 25 | pkg-config, | 25 | pkg-config, |
25 | 26 | qml-module-ubuntu-connectivity (>= 0.5.2), | 26 | qml-module-ubuntu-connectivity (>= 0.5.3), |
26 | 27 | qt5-default, | 27 | qt5-default, |
27 | 28 | qtbase5-dev, | 28 | qtbase5-dev, |
28 | 29 | qtdeclarative5-dev, | 29 | qtdeclarative5-dev, |
29 | 30 | 30 | ||
30 | === modified file 'plugins/CMakeLists.txt' | |||
31 | --- plugins/CMakeLists.txt 2014-07-09 01:05:29 +0000 | |||
32 | +++ plugins/CMakeLists.txt 2015-08-14 11:52:44 +0000 | |||
33 | @@ -9,6 +9,7 @@ | |||
34 | 9 | add_subdirectory(cellular) | 9 | add_subdirectory(cellular) |
35 | 10 | add_subdirectory(example) | 10 | add_subdirectory(example) |
36 | 11 | add_subdirectory(flight-mode) | 11 | add_subdirectory(flight-mode) |
37 | 12 | add_subdirectory(hotspot) | ||
38 | 12 | add_subdirectory(language) | 13 | add_subdirectory(language) |
39 | 13 | add_subdirectory(notifications) | 14 | add_subdirectory(notifications) |
40 | 14 | add_subdirectory(orientation-lock) | 15 | add_subdirectory(orientation-lock) |
41 | 15 | 16 | ||
42 | === modified file 'plugins/cellular/CMakeLists.txt' | |||
43 | --- plugins/cellular/CMakeLists.txt 2015-08-06 10:33:16 +0000 | |||
44 | +++ plugins/cellular/CMakeLists.txt 2015-08-14 11:52:44 +0000 | |||
45 | @@ -7,15 +7,12 @@ | |||
46 | 7 | apn_manager.js | 7 | apn_manager.js |
47 | 8 | apn_editor.js | 8 | apn_editor.js |
48 | 9 | carriers.js | 9 | carriers.js |
49 | 10 | Common.qml | ||
50 | 11 | PageApnEditor.qml | 10 | PageApnEditor.qml |
51 | 12 | PageChooseApn.qml | 11 | PageChooseApn.qml |
52 | 13 | PageChooseCarrier.qml | 12 | PageChooseCarrier.qml |
53 | 14 | PageCarrierAndApn.qml | 13 | PageCarrierAndApn.qml |
54 | 15 | PageCarriersAndApns.qml | 14 | PageCarriersAndApns.qml |
55 | 16 | PageComponent.qml | 15 | PageComponent.qml |
56 | 17 | Hotspot.qml | ||
57 | 18 | HotspotSetup.qml | ||
58 | 19 | sims.js | 16 | sims.js |
59 | 20 | ) | 17 | ) |
60 | 21 | 18 | ||
61 | 22 | 19 | ||
62 | === modified file 'plugins/cellular/Components/MultiSim.qml' | |||
63 | --- plugins/cellular/Components/MultiSim.qml 2015-07-24 20:00:06 +0000 | |||
64 | +++ plugins/cellular/Components/MultiSim.qml 2015-08-14 11:52:44 +0000 | |||
65 | @@ -53,25 +53,6 @@ | |||
66 | 53 | anchors { left: parent.left; right: parent.right } | 53 | anchors { left: parent.left; right: parent.right } |
67 | 54 | } | 54 | } |
68 | 55 | 55 | ||
69 | 56 | ListItem.SingleValue { | ||
70 | 57 | text : i18n.tr("Hotspot disabled because Wi-Fi is off.") | ||
71 | 58 | visible: !hotspotItem.visible && | ||
72 | 59 | UpdateManager.deviceName !== "mako" | ||
73 | 60 | } | ||
74 | 61 | |||
75 | 62 | ListItem.SingleValue { | ||
76 | 63 | id: hotspotItem | ||
77 | 64 | text: i18n.tr("Wi-Fi hotspot") | ||
78 | 65 | progression: true | ||
79 | 66 | onClicked: { | ||
80 | 67 | pageStack.push(Qt.resolvedUrl("../Hotspot.qml")) | ||
81 | 68 | } | ||
82 | 69 | visible: (actionGroup.actionObject.valid ? | ||
83 | 70 | actionGroup.actionObject.state : false) && | ||
84 | 71 | UpdateManager.deviceName !== "mako" | ||
85 | 72 | |||
86 | 73 | } | ||
87 | 74 | |||
88 | 75 | ListItem.Standard { | 56 | ListItem.Standard { |
89 | 76 | id: dataUsage | 57 | id: dataUsage |
90 | 77 | text: i18n.tr("Data usage statistics") | 58 | text: i18n.tr("Data usage statistics") |
91 | 78 | 59 | ||
92 | === modified file 'plugins/cellular/Components/SingleSim.qml' | |||
93 | --- plugins/cellular/Components/SingleSim.qml 2015-07-24 20:00:06 +0000 | |||
94 | +++ plugins/cellular/Components/SingleSim.qml 2015-08-14 11:52:44 +0000 | |||
95 | @@ -22,11 +22,6 @@ | |||
96 | 22 | import Ubuntu.Components 0.1 | 22 | import Ubuntu.Components 0.1 |
97 | 23 | import Ubuntu.Components.ListItems 0.1 as ListItem | 23 | import Ubuntu.Components.ListItems 0.1 as ListItem |
98 | 24 | 24 | ||
99 | 25 | /* This is a temporary solution to the issue of Hotspots failing on mako. If | ||
100 | 26 | the device is mako, we hide the hotspot entry. Will be removed once lp:1434591 | ||
101 | 27 | has been resolved. */ | ||
102 | 28 | import Ubuntu.SystemSettings.Update 1.0 | ||
103 | 29 | |||
104 | 30 | Column { | 25 | Column { |
105 | 31 | 26 | ||
106 | 32 | objectName: "singleSim" | 27 | objectName: "singleSim" |
107 | @@ -64,25 +59,6 @@ | |||
108 | 64 | } | 59 | } |
109 | 65 | } | 60 | } |
110 | 66 | 61 | ||
111 | 67 | ListItem.SingleValue { | ||
112 | 68 | text : i18n.tr("Hotspot disabled because Wi-Fi is off.") | ||
113 | 69 | visible: !hotspotItem.visible && | ||
114 | 70 | UpdateManager.deviceName !== "mako" | ||
115 | 71 | } | ||
116 | 72 | |||
117 | 73 | ListItem.SingleValue { | ||
118 | 74 | id: hotspotItem | ||
119 | 75 | objectName: "hotspotEntry" | ||
120 | 76 | text: i18n.tr("Wi-Fi hotspot") | ||
121 | 77 | progression: true | ||
122 | 78 | onClicked: { | ||
123 | 79 | pageStack.push(Qt.resolvedUrl("../Hotspot.qml")) | ||
124 | 80 | } | ||
125 | 81 | visible: (actionGroup.actionObject.valid ? | ||
126 | 82 | actionGroup.actionObject.state : false) && | ||
127 | 83 | UpdateManager.deviceName !== "mako" | ||
128 | 84 | } | ||
129 | 85 | |||
130 | 86 | ListItem.Standard { | 62 | ListItem.Standard { |
131 | 87 | text: i18n.tr("Data usage statistics") | 63 | text: i18n.tr("Data usage statistics") |
132 | 88 | progression: true | 64 | progression: true |
133 | 89 | 65 | ||
134 | === modified file 'plugins/cellular/cellular.settings' | |||
135 | --- plugins/cellular/cellular.settings 2015-08-10 09:27:01 +0000 | |||
136 | +++ plugins/cellular/cellular.settings 2015-08-14 11:52:44 +0000 | |||
137 | @@ -20,9 +20,7 @@ | |||
138 | 20 | "lte", | 20 | "lte", |
139 | 21 | "apn", | 21 | "apn", |
140 | 22 | "roam", | 22 | "roam", |
144 | 23 | "sim", | 23 | "sim" |
142 | 24 | "hotspot", | ||
143 | 25 | "tethering" | ||
145 | 26 | ], | 24 | ], |
146 | 27 | "has-dynamic-keywords": false, | 25 | "has-dynamic-keywords": false, |
147 | 28 | "has-dynamic-visibility": false, | 26 | "has-dynamic-visibility": false, |
148 | 29 | 27 | ||
149 | === added directory 'plugins/hotspot' | |||
150 | === added file 'plugins/hotspot/CMakeLists.txt' | |||
151 | --- plugins/hotspot/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
152 | +++ plugins/hotspot/CMakeLists.txt 2015-08-14 11:52:44 +0000 | |||
153 | @@ -0,0 +1,12 @@ | |||
154 | 1 | set(QML_SOURCES | ||
155 | 2 | Common.qml | ||
156 | 3 | HotspotSetup.qml | ||
157 | 4 | PageComponent.qml | ||
158 | 5 | ) | ||
159 | 6 | |||
160 | 7 | set(PLUG_DIR ${PLUGIN_PRIVATE_MODULE_DIR}/Ubuntu/SystemSettings/Hotspot) | ||
161 | 8 | |||
162 | 9 | install(FILES qmldir DESTINATION ${PLUG_DIR}) | ||
163 | 10 | install(FILES hotspot.settings DESTINATION ${PLUGIN_MANIFEST_DIR}) | ||
164 | 11 | install(FILES settings-hotspot.svg DESTINATION ${PLUGIN_MANIFEST_DIR}/icons) | ||
165 | 12 | install(FILES ${QML_SOURCES} DESTINATION ${PLUGIN_QML_DIR}/hotspot) | ||
166 | 0 | 13 | ||
167 | === renamed file 'plugins/cellular/Common.qml' => 'plugins/hotspot/Common.qml' | |||
168 | === renamed file 'plugins/cellular/HotspotSetup.qml' => 'plugins/hotspot/HotspotSetup.qml' | |||
169 | --- plugins/cellular/HotspotSetup.qml 2015-08-10 20:04:29 +0000 | |||
170 | +++ plugins/hotspot/HotspotSetup.qml 2015-08-14 11:52:44 +0000 | |||
171 | @@ -208,6 +208,17 @@ | |||
172 | 208 | } | 208 | } |
173 | 209 | } | 209 | } |
174 | 210 | 210 | ||
175 | 211 | ListItem.Caption { | ||
176 | 212 | anchors { | ||
177 | 213 | left: parent.left | ||
178 | 214 | right: parent.right | ||
179 | 215 | leftMargin: units.gu(1) | ||
180 | 216 | rightMargin: units.gu(1) | ||
181 | 217 | } | ||
182 | 218 | text: i18n.tr("In order to create a hotspot, you need to turn Wi-Fi on.") | ||
183 | 219 | visible: !Connectivity.WifiEnabled | ||
184 | 220 | } | ||
185 | 221 | |||
186 | 211 | Row { | 222 | Row { |
187 | 212 | 223 | ||
188 | 213 | anchors { | 224 | anchors { |
189 | @@ -230,11 +241,14 @@ | |||
190 | 230 | objectName: "confirmButton" | 241 | objectName: "confirmButton" |
191 | 231 | width: (parent.width / 2) - units.gu(1) | 242 | width: (parent.width / 2) - units.gu(1) |
192 | 232 | text: hotspotSetupDialog.stored ? i18n.tr("Change") : | 243 | text: hotspotSetupDialog.stored ? i18n.tr("Change") : |
194 | 233 | i18n.tr("Enable") | 244 | i18n.tr("Start") |
195 | 234 | enabled: settingsValid() | 245 | enabled: settingsValid() |
196 | 235 | activeFocusOnPress: false | 246 | activeFocusOnPress: false |
197 | 236 | onClicked: { | 247 | onClicked: { |
199 | 237 | if (hotspotSetupDialog.stored) { | 248 | if (!Connectivity.WifiEnabled && |
200 | 249 | !hotspotSetupDialog.stored) { | ||
201 | 250 | enableWifiAction.trigger(); | ||
202 | 251 | } else if (hotspotSetupDialog.stored) { | ||
203 | 238 | changeAction.trigger() | 252 | changeAction.trigger() |
204 | 239 | } else { | 253 | } else { |
205 | 240 | enableAction.trigger(); | 254 | enableAction.trigger(); |
206 | @@ -259,12 +273,22 @@ | |||
207 | 259 | height: parent.height - units.gu(1.5) | 273 | height: parent.height - units.gu(1.5) |
208 | 260 | } | 274 | } |
209 | 261 | } | 275 | } |
215 | 262 | 276 | } | |
216 | 263 | Button { | 277 | } |
217 | 264 | visible: showAllUI | 278 | |
218 | 265 | // TRANSLATORS: This string is hidden. | 279 | Action { |
219 | 266 | text: i18n.tr("Start") | 280 | id: enableWifiAction |
220 | 281 | onTriggered: { | ||
221 | 282 | hotspotSetupDialog.state = "STARTING"; | ||
222 | 283 | |||
223 | 284 | // As soon as Wi-Fi has been turned on, trigger enableAction. | ||
224 | 285 | function wifiUpdated (updated) { | ||
225 | 286 | Connectivity.wifiEnabledUpdated.disconnect(wifiUpdated); | ||
226 | 287 | enableAction.trigger(); | ||
227 | 267 | } | 288 | } |
228 | 289 | |||
229 | 290 | Connectivity.wifiEnabledUpdated.connect(wifiUpdated); | ||
230 | 291 | Connectivity.setwifiEnabled(true); | ||
231 | 268 | } | 292 | } |
232 | 269 | } | 293 | } |
233 | 270 | 294 | ||
234 | 271 | 295 | ||
235 | === renamed file 'plugins/cellular/Hotspot.qml' => 'plugins/hotspot/PageComponent.qml' | |||
236 | --- plugins/cellular/Hotspot.qml 2015-08-10 20:04:29 +0000 | |||
237 | +++ plugins/hotspot/PageComponent.qml 2015-08-14 11:52:44 +0000 | |||
238 | @@ -1,7 +1,9 @@ | |||
239 | 1 | /* | 1 | /* |
240 | 2 | * This file is part of system-settings | 2 | * This file is part of system-settings |
241 | 3 | * | 3 | * |
243 | 4 | * Copyright (C) 2014 Canonical Ltd. | 4 | * Copyright (C) 2015 Canonical Ltd. |
244 | 5 | * | ||
245 | 6 | * Contact: Jonas G. Drange <jonas.drange@canonical.com> | ||
246 | 5 | * | 7 | * |
247 | 6 | * This program is free software: you can redistribute it and/or modify it | 8 | * This program is free software: you can redistribute it and/or modify it |
248 | 7 | * under the terms of the GNU General Public License version 3, as published | 9 | * under the terms of the GNU General Public License version 3, as published |
249 | @@ -17,99 +19,167 @@ | |||
250 | 17 | */ | 19 | */ |
251 | 18 | 20 | ||
252 | 19 | import QtQuick 2.0 | 21 | import QtQuick 2.0 |
253 | 22 | import QMenuModel 0.1 | ||
254 | 20 | import SystemSettings 1.0 | 23 | import SystemSettings 1.0 |
257 | 21 | import Ubuntu.Components 0.1 | 24 | import Ubuntu.Components 1.3 |
258 | 22 | import Ubuntu.Components.ListItems 0.1 as ListItem | 25 | import Ubuntu.Components.ListItems 1.3 as ListItem |
259 | 23 | import Ubuntu.Components.Popups 0.1 | 26 | import Ubuntu.Components.Popups 0.1 |
260 | 24 | import Ubuntu.Connectivity 1.0 | 27 | import Ubuntu.Connectivity 1.0 |
261 | 25 | import Ubuntu.Settings.Components 0.1 as USC | 28 | import Ubuntu.Settings.Components 0.1 as USC |
263 | 26 | import Ubuntu.SystemSettings.Cellular 1.0 | 29 | |
264 | 30 | /* This is a temporary solution to the issue of Hotspots failing on mako. If | ||
265 | 31 | the device is mako, we hide the hotspot entry. Will be removed once lp:1434591 | ||
266 | 32 | has been resolved. */ | ||
267 | 33 | import Ubuntu.SystemSettings.Update 1.0 | ||
268 | 27 | 34 | ||
269 | 28 | ItemPage { | 35 | ItemPage { |
270 | 29 | 36 | ||
272 | 30 | id: hotspot | 37 | id: root |
273 | 31 | objectName: "hotspotPage" | 38 | objectName: "hotspotPage" |
285 | 32 | 39 | title: i18n.tr("Hotspot") | |
286 | 33 | // TRANSLATORS: “Hotspot” is hidden. | 40 | |
287 | 34 | title: showAllUI ? i18n.tr("Hotspot") : i18n.tr("Wi-Fi hotspot") | 41 | states: [ |
288 | 35 | 42 | State { | |
289 | 36 | // We disable the back action while a hotspot is in the process of either | 43 | name: "disabled" |
290 | 37 | // being enabled or disabled. | 44 | // Undefined WifiEnabled means Connectivity is unavailable. |
291 | 38 | head.backAction: Action { | 45 | when: (typeof Connectivity.WifiEnabled === "undefined" && |
292 | 39 | iconName: "back" | 46 | UpdateManager.deviceName !== "mako") |
293 | 40 | enabled: !Connectivity.unstoppableOperationHappening | 47 | PropertyChanges { |
294 | 41 | onTriggered: { | 48 | target: hotspotItem |
295 | 42 | pageStack.pop(); | 49 | enabled: false |
296 | 50 | } | ||
297 | 51 | PropertyChanges { | ||
298 | 52 | target: hotspotSetupButton | ||
299 | 53 | enabled: false | ||
300 | 54 | } | ||
301 | 55 | }, | ||
302 | 56 | State { | ||
303 | 57 | name: "nowifi" | ||
304 | 58 | when: (typeof Connectivity.WifiEnabled === "boolean" && | ||
305 | 59 | !Connectivity.WifiEnabled) | ||
306 | 60 | PropertyChanges { | ||
307 | 61 | target: hotspotSwitchWhenWifiDisabled | ||
308 | 62 | visible: true | ||
309 | 63 | } | ||
310 | 43 | } | 64 | } |
312 | 44 | } | 65 | ] |
313 | 45 | 66 | ||
314 | 46 | Loader { | 67 | Loader { |
315 | 47 | id: setup | 68 | id: setup |
316 | 48 | asynchronous: false | 69 | asynchronous: false |
317 | 49 | } | 70 | } |
318 | 50 | 71 | ||
320 | 51 | Column { | 72 | Flickable { |
321 | 73 | id: flick | ||
322 | 52 | 74 | ||
323 | 53 | anchors.fill: parent | 75 | anchors.fill: parent |
361 | 54 | spacing: units.gu(2) | 76 | contentWidth: parent.width |
362 | 55 | 77 | contentHeight: contentItem.childrenRect.height | |
363 | 56 | ListItem.Standard { | 78 | boundsBehavior: (contentHeight > root.height) ? |
364 | 57 | text: i18n.tr("Hotspot") | 79 | Flickable.DragAndOvershootBounds : Flickable.StopAtBounds |
365 | 58 | enabled: Connectivity.hotspotStored | 80 | |
366 | 59 | control: Switch { | 81 | Column { |
330 | 60 | id: hotspotSwitch | ||
331 | 61 | objectName: "hotspotSwitch" | ||
332 | 62 | enabled: !switchSync.syncWaiting | ||
333 | 63 | |||
334 | 64 | USC.ServerPropertySynchroniser { | ||
335 | 65 | id: switchSync | ||
336 | 66 | userTarget: hotspotSwitch | ||
337 | 67 | userProperty: "checked" | ||
338 | 68 | serverTarget: Connectivity | ||
339 | 69 | serverProperty: "hotspotEnabled" | ||
340 | 70 | useWaitBuffer: true | ||
341 | 71 | |||
342 | 72 | // Since this blocks the UI thread, we wait until | ||
343 | 73 | // the UI has completed the checkbox animation before we | ||
344 | 74 | // ask the server to uipdate. | ||
345 | 75 | onSyncTriggered: { | ||
346 | 76 | triggerTimer.value = value; | ||
347 | 77 | triggerTimer.start(); | ||
348 | 78 | } | ||
349 | 79 | } | ||
350 | 80 | |||
351 | 81 | Timer { | ||
352 | 82 | id: triggerTimer | ||
353 | 83 | property bool value | ||
354 | 84 | interval: 250; repeat: false | ||
355 | 85 | onTriggered: Connectivity.hotspotEnabled = value | ||
356 | 86 | } | ||
357 | 87 | } | ||
358 | 88 | } | ||
359 | 89 | |||
360 | 90 | ListItem.Caption { | ||
367 | 91 | anchors { | 82 | anchors { |
368 | 92 | left: parent.left | 83 | left: parent.left |
369 | 93 | right: parent.right | 84 | right: parent.right |
376 | 94 | leftMargin: units.gu(2) | 85 | } |
377 | 95 | rightMargin: units.gu(2) | 86 | spacing: units.gu(2) |
378 | 96 | } | 87 | |
379 | 97 | text : hotspotSwitch.stored ? | 88 | ListItem.Standard { |
380 | 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") |
381 | 99 | : i18n.tr("Other devices can use your cellular data connection over the Wi-Fi network. Normal data charges apply.") | 90 | enabled: (Connectivity.hotspotStored && |
382 | 91 | Connectivity.HotspotSwitchEnabled) | ||
383 | 92 | control: Switch { | ||
384 | 93 | id: hotspotSwitch | ||
385 | 94 | objectName: "hotspotSwitch" | ||
386 | 95 | enabled: Connectivity.HotspotSwitchEnabled | ||
387 | 96 | |||
388 | 97 | USC.ServerPropertySynchroniser { | ||
389 | 98 | id: switchSync | ||
390 | 99 | userTarget: hotspotSwitch | ||
391 | 100 | userProperty: "checked" | ||
392 | 101 | serverTarget: Connectivity | ||
393 | 102 | serverProperty: "hotspotEnabled" | ||
394 | 103 | useWaitBuffer: true | ||
395 | 104 | |||
396 | 105 | // Since this blocks the UI thread, we wait until | ||
397 | 106 | // the UI has completed the checkbox animation before we | ||
398 | 107 | // ask the server to uipdate. | ||
399 | 108 | onSyncTriggered: { | ||
400 | 109 | triggerTimer.value = value; | ||
401 | 110 | triggerTimer.start(); | ||
402 | 111 | } | ||
403 | 112 | } | ||
404 | 113 | |||
405 | 114 | // Catch taps if Wi-Fi is disable and prompt user. | ||
406 | 115 | MouseArea { | ||
407 | 116 | id: hotspotSwitchWhenWifiDisabled | ||
408 | 117 | anchors.fill: parent | ||
409 | 118 | visible: false | ||
410 | 119 | onClicked: enableWifiAction.diag = PopupUtils.open( | ||
411 | 120 | enableWifiDialog | ||
412 | 121 | ); | ||
413 | 122 | } | ||
414 | 123 | |||
415 | 124 | Timer { | ||
416 | 125 | id: triggerTimer | ||
417 | 126 | property bool value | ||
418 | 127 | interval: 250; repeat: false | ||
419 | 128 | onTriggered: Connectivity.hotspotEnabled = value | ||
420 | 129 | } | ||
421 | 130 | } | ||
422 | 131 | } | ||
423 | 132 | |||
424 | 133 | ListItem.Caption { | ||
425 | 134 | anchors { | ||
426 | 135 | left: parent.left | ||
427 | 136 | right: parent.right | ||
428 | 137 | leftMargin: units.gu(2) | ||
429 | 138 | rightMargin: units.gu(2) | ||
430 | 139 | } | ||
431 | 140 | text : Connectivity.hotspotStored ? | ||
432 | 141 | i18n.tr("When hotspot is on, other devices can use your cellular data connection over Wi-Fi. Normal data charges apply.") | ||
433 | 142 | : i18n.tr("Other devices can use your cellular data connection over the Wi-Fi network. Normal data charges apply.") | ||
434 | 143 | } | ||
435 | 144 | |||
436 | 145 | Button { | ||
437 | 146 | id: hotspotSetupButton | ||
438 | 147 | objectName: "hotspotSetupButton" | ||
439 | 148 | anchors.horizontalCenter: parent.horizontalCenter | ||
440 | 149 | width: parent.width - units.gu(4) | ||
441 | 150 | |||
442 | 151 | // If the hotspot is stored, we allow it to be changed. If it's | ||
443 | 152 | // non-existent, we only allow setup if it can be turned on. | ||
444 | 153 | // This is a by product of the current design. | ||
445 | 154 | enabled: (Connectivity.hotspotStored || | ||
446 | 155 | Connectivity.HotspotSwitchEnabled) | ||
447 | 156 | text: Connectivity.hotspotStored ? | ||
448 | 157 | i18n.tr("Change password/setup…") : i18n.tr("Set up hotspot…") | ||
449 | 158 | |||
450 | 159 | onClicked: { | ||
451 | 160 | setup.setSource(Qt.resolvedUrl("HotspotSetup.qml")); | ||
452 | 161 | PopupUtils.open(setup.item, root, {}); | ||
453 | 162 | } | ||
454 | 163 | } | ||
455 | 100 | } | 164 | } |
468 | 101 | 165 | } | |
469 | 102 | Button { | 166 | |
470 | 103 | objectName: "hotspotSetupEntry" | 167 | Action { |
471 | 104 | anchors.horizontalCenter: parent.horizontalCenter | 168 | id: enableWifiAction |
472 | 105 | width: parent.width - units.gu(4) | 169 | property var diag |
473 | 106 | text: Connectivity.hotspotStored ? | 170 | onTriggered: { |
474 | 107 | i18n.tr("Change password/setup…") : i18n.tr("Set up hotspot…") | 171 | // As soon as Wi-Fi has been turned on, activate the USC |
475 | 108 | 172 | // synchroniser. | |
476 | 109 | onClicked: { | 173 | function wifiUpdated (updated) { |
477 | 110 | setup.setSource(Qt.resolvedUrl("HotspotSetup.qml")); | 174 | Connectivity.wifiEnabledUpdated.disconnect(wifiUpdated); |
478 | 111 | PopupUtils.open(setup.item, hotspot, { | 175 | switchSync.activate(); |
479 | 112 | }); | 176 | PopupUtils.close(diag); |
480 | 177 | } | ||
481 | 178 | |||
482 | 179 | if (!Connectivity.wifiEnabled) { | ||
483 | 180 | Connectivity.wifiEnabledUpdated.connect(wifiUpdated); | ||
484 | 181 | hotspotSwitch.checked = true; | ||
485 | 182 | Connectivity.setwifiEnabled(true); | ||
486 | 113 | } | 183 | } |
487 | 114 | } | 184 | } |
488 | 115 | } | 185 | } |
489 | @@ -117,23 +187,20 @@ | |||
490 | 117 | Component { | 187 | Component { |
491 | 118 | id: enableWifiDialog | 188 | id: enableWifiDialog |
492 | 119 | Dialog { | 189 | Dialog { |
494 | 120 | id: dialogue | 190 | id: dialog |
495 | 121 | objectName: "enableWifiDialog" | 191 | objectName: "enableWifiDialog" |
496 | 122 | // TRANSLATORS: This string is hidden. | ||
497 | 123 | title: i18n.tr("Wi-Fi is off") | 192 | title: i18n.tr("Wi-Fi is off") |
498 | 124 | // TRANSLATORS: This string is hidden. | ||
499 | 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.") |
500 | 126 | visible: showAllUI | ||
501 | 127 | 194 | ||
502 | 128 | Button { | 195 | Button { |
503 | 129 | text: i18n.tr("Cancel") | 196 | text: i18n.tr("Cancel") |
505 | 130 | onClicked: PopupUtils.close(dialogue) | 197 | onClicked: PopupUtils.close(dialog) |
506 | 131 | } | 198 | } |
507 | 132 | 199 | ||
508 | 133 | Button { | 200 | Button { |
509 | 134 | objectName: "confirmEnable" | 201 | objectName: "confirmEnable" |
510 | 135 | // TRANSLATORS: This string is hidden. | ||
511 | 136 | text: i18n.tr("Turn on Wi-Fi") | 202 | text: i18n.tr("Turn on Wi-Fi") |
512 | 203 | onClicked: enableWifiAction.trigger() | ||
513 | 137 | } | 204 | } |
514 | 138 | } | 205 | } |
515 | 139 | } | 206 | } |
516 | 140 | 207 | ||
517 | === added file 'plugins/hotspot/hotspot.settings' | |||
518 | --- plugins/hotspot/hotspot.settings 1970-01-01 00:00:00 +0000 | |||
519 | +++ plugins/hotspot/hotspot.settings 2015-08-14 11:52:44 +0000 | |||
520 | @@ -0,0 +1,18 @@ | |||
521 | 1 | { | ||
522 | 2 | "icon": "preferences-network-hotspot-symbolic", | ||
523 | 3 | "name": "Hotspot", | ||
524 | 4 | "translations": "ubuntu-system-settings", | ||
525 | 5 | "category": "network", | ||
526 | 6 | "priority": 2, | ||
527 | 7 | "form-factors": [ | ||
528 | 8 | "phone" | ||
529 | 9 | ], | ||
530 | 10 | "keywords": [ | ||
531 | 11 | "network", | ||
532 | 12 | "hotspot", | ||
533 | 13 | "tethering" | ||
534 | 14 | ], | ||
535 | 15 | "has-dynamic-keywords": false, | ||
536 | 16 | "has-dynamic-visibility": false, | ||
537 | 17 | "page-component": "PageComponent.qml" | ||
538 | 18 | } | ||
539 | 0 | 19 | ||
540 | === added file 'plugins/hotspot/qmldir' | |||
541 | --- plugins/hotspot/qmldir 1970-01-01 00:00:00 +0000 | |||
542 | +++ plugins/hotspot/qmldir 2015-08-14 11:52:44 +0000 | |||
543 | @@ -0,0 +1,2 @@ | |||
544 | 1 | module Ubuntu.SystemSettings.Hotspot | ||
545 | 2 | plugin UbuntuHotspotPanel | ||
546 | 0 | 3 | ||
547 | === added file 'plugins/hotspot/settings-hotspot.svg' | |||
548 | --- plugins/hotspot/settings-hotspot.svg 1970-01-01 00:00:00 +0000 | |||
549 | +++ plugins/hotspot/settings-hotspot.svg 2015-08-14 11:52:44 +0000 | |||
550 | @@ -0,0 +1,182 @@ | |||
551 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
552 | 2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
553 | 3 | |||
554 | 4 | <svg | ||
555 | 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
556 | 6 | xmlns:cc="http://creativecommons.org/ns#" | ||
557 | 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
558 | 8 | xmlns:svg="http://www.w3.org/2000/svg" | ||
559 | 9 | xmlns="http://www.w3.org/2000/svg" | ||
560 | 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
561 | 11 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
562 | 12 | width="96" | ||
563 | 13 | height="96" | ||
564 | 14 | id="svg4874" | ||
565 | 15 | version="1.1" | ||
566 | 16 | inkscape:version="0.91+devel r" | ||
567 | 17 | viewBox="0 0 96 96.000001" | ||
568 | 18 | sodipodi:docname="preferences-network-hotspot-symbolic.svg"> | ||
569 | 19 | <defs | ||
570 | 20 | id="defs4876" /> | ||
571 | 21 | <sodipodi:namedview | ||
572 | 22 | id="base" | ||
573 | 23 | pagecolor="#ffffff" | ||
574 | 24 | bordercolor="#666666" | ||
575 | 25 | borderopacity="1.0" | ||
576 | 26 | inkscape:pageopacity="0.0" | ||
577 | 27 | inkscape:pageshadow="2" | ||
578 | 28 | inkscape:zoom="5.6199991" | ||
579 | 29 | inkscape:cx="-39.092542" | ||
580 | 30 | inkscape:cy="39.181476" | ||
581 | 31 | inkscape:document-units="px" | ||
582 | 32 | inkscape:current-layer="g4780" | ||
583 | 33 | showgrid="true" | ||
584 | 34 | showborder="true" | ||
585 | 35 | fit-margin-top="0" | ||
586 | 36 | fit-margin-left="0" | ||
587 | 37 | fit-margin-right="0" | ||
588 | 38 | fit-margin-bottom="0" | ||
589 | 39 | inkscape:snap-bbox="true" | ||
590 | 40 | inkscape:bbox-paths="true" | ||
591 | 41 | inkscape:bbox-nodes="true" | ||
592 | 42 | inkscape:snap-bbox-edge-midpoints="true" | ||
593 | 43 | inkscape:snap-bbox-midpoints="true" | ||
594 | 44 | inkscape:object-paths="true" | ||
595 | 45 | inkscape:snap-intersection-paths="true" | ||
596 | 46 | inkscape:object-nodes="true" | ||
597 | 47 | inkscape:snap-smooth-nodes="true" | ||
598 | 48 | inkscape:snap-midpoints="true" | ||
599 | 49 | inkscape:snap-object-midpoints="true" | ||
600 | 50 | inkscape:snap-center="true" | ||
601 | 51 | showguides="true" | ||
602 | 52 | inkscape:guide-bbox="true" | ||
603 | 53 | inkscape:snap-global="true"> | ||
604 | 54 | <inkscape:grid | ||
605 | 55 | type="xygrid" | ||
606 | 56 | id="grid5451" | ||
607 | 57 | empspacing="8" /> | ||
608 | 58 | <sodipodi:guide | ||
609 | 59 | orientation="1,0" | ||
610 | 60 | position="8,-8.0000001" | ||
611 | 61 | id="guide4063" /> | ||
612 | 62 | <sodipodi:guide | ||
613 | 63 | orientation="1,0" | ||
614 | 64 | position="4,-8.0000001" | ||
615 | 65 | id="guide4065" /> | ||
616 | 66 | <sodipodi:guide | ||
617 | 67 | orientation="0,1" | ||
618 | 68 | position="-8,88.000001" | ||
619 | 69 | id="guide4067" /> | ||
620 | 70 | <sodipodi:guide | ||
621 | 71 | orientation="0,1" | ||
622 | 72 | position="-8,92.000001" | ||
623 | 73 | id="guide4069" /> | ||
624 | 74 | <sodipodi:guide | ||
625 | 75 | orientation="0,1" | ||
626 | 76 | position="104,4" | ||
627 | 77 | id="guide4071" /> | ||
628 | 78 | <sodipodi:guide | ||
629 | 79 | orientation="0,1" | ||
630 | 80 | position="-5,8.0000001" | ||
631 | 81 | id="guide4073" /> | ||
632 | 82 | <sodipodi:guide | ||
633 | 83 | orientation="1,0" | ||
634 | 84 | position="88,-8.0000001" | ||
635 | 85 | id="guide4077" /> | ||
636 | 86 | <sodipodi:guide | ||
637 | 87 | orientation="0,1" | ||
638 | 88 | position="-8,84.000001" | ||
639 | 89 | id="guide4074" /> | ||
640 | 90 | <sodipodi:guide | ||
641 | 91 | orientation="1,0" | ||
642 | 92 | position="12,-8.0000001" | ||
643 | 93 | id="guide4076" /> | ||
644 | 94 | <sodipodi:guide | ||
645 | 95 | orientation="1,0" | ||
646 | 96 | position="84,-8.0000001" | ||
647 | 97 | id="guide4080" /> | ||
648 | 98 | <sodipodi:guide | ||
649 | 99 | position="48,-8.0000001" | ||
650 | 100 | orientation="1,0" | ||
651 | 101 | id="guide4170" /> | ||
652 | 102 | <sodipodi:guide | ||
653 | 103 | position="-8,48" | ||
654 | 104 | orientation="0,1" | ||
655 | 105 | id="guide4172" /> | ||
656 | 106 | <sodipodi:guide | ||
657 | 107 | position="92,-8.0000001" | ||
658 | 108 | orientation="1,0" | ||
659 | 109 | id="guide4760" /> | ||
660 | 110 | <sodipodi:guide | ||
661 | 111 | position="106,12" | ||
662 | 112 | orientation="0,1" | ||
663 | 113 | id="guide4211" /> | ||
664 | 114 | </sodipodi:namedview> | ||
665 | 115 | <metadata | ||
666 | 116 | id="metadata4879"> | ||
667 | 117 | <rdf:RDF> | ||
668 | 118 | <cc:Work | ||
669 | 119 | rdf:about=""> | ||
670 | 120 | <dc:format>image/svg+xml</dc:format> | ||
671 | 121 | <dc:type | ||
672 | 122 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
673 | 123 | <dc:title></dc:title> | ||
674 | 124 | </cc:Work> | ||
675 | 125 | </rdf:RDF> | ||
676 | 126 | </metadata> | ||
677 | 127 | <g | ||
678 | 128 | inkscape:label="Layer 1" | ||
679 | 129 | inkscape:groupmode="layer" | ||
680 | 130 | id="layer1" | ||
681 | 131 | transform="translate(67.857146,-78.50504)"> | ||
682 | 132 | <g | ||
683 | 133 | transform="matrix(0,-1,-1,0,373.50506,516.50504)" | ||
684 | 134 | id="g4845" | ||
685 | 135 | style="display:inline"> | ||
686 | 136 | <g | ||
687 | 137 | inkscape:export-ydpi="90" | ||
688 | 138 | inkscape:export-xdpi="90" | ||
689 | 139 | inkscape:export-filename="next01.png" | ||
690 | 140 | transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)" | ||
691 | 141 | id="g4778" | ||
692 | 142 | inkscape:label="Layer 1"> | ||
693 | 143 | <g | ||
694 | 144 | transform="matrix(-1,0,0,1,575.99999,611)" | ||
695 | 145 | id="g4780" | ||
696 | 146 | style="display:inline"> | ||
697 | 147 | <rect | ||
698 | 148 | style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate" | ||
699 | 149 | id="rect4782" | ||
700 | 150 | width="96.037987" | ||
701 | 151 | height="96" | ||
702 | 152 | x="-438.00244" | ||
703 | 153 | y="345.36221" | ||
704 | 154 | transform="scale(-1,1)" /> | ||
705 | 155 | <ellipse | ||
706 | 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" | ||
707 | 157 | id="path4213" | ||
708 | 158 | cx="-393.36221" | ||
709 | 159 | cy="-389.98346" | ||
710 | 160 | transform="matrix(0,-1,-1,0,0,0)" | ||
711 | 161 | rx="7.9999995" | ||
712 | 162 | ry="8.0031652" /> | ||
713 | 163 | <path | ||
714 | 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" | ||
715 | 165 | d="m 349.9668,391.36133 v 4.00195 h 40.01758 v -4.00195 z" | ||
716 | 166 | id="path4215" | ||
717 | 167 | inkscape:connector-curvature="0" /> | ||
718 | 168 | <path | ||
719 | 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" | ||
720 | 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" | ||
721 | 171 | id="ellipse4202" | ||
722 | 172 | inkscape:connector-curvature="0" /> | ||
723 | 173 | <path | ||
724 | 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" | ||
725 | 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" | ||
726 | 176 | id="ellipse4204" | ||
727 | 177 | inkscape:connector-curvature="0" /> | ||
728 | 178 | </g> | ||
729 | 179 | </g> | ||
730 | 180 | </g> | ||
731 | 181 | </g> | ||
732 | 182 | </svg> | ||
733 | 0 | 183 | ||
734 | === modified file 'tests/autopilot/ubuntu_system_settings/__init__.py' | |||
735 | --- tests/autopilot/ubuntu_system_settings/__init__.py 2015-08-10 20:05:22 +0000 | |||
736 | +++ tests/autopilot/ubuntu_system_settings/__init__.py 2015-08-14 11:52:44 +0000 | |||
737 | @@ -87,6 +87,10 @@ | |||
738 | 87 | return self._go_to_page('entryComponent-cellular', 'cellularPage') | 87 | return self._go_to_page('entryComponent-cellular', 'cellularPage') |
739 | 88 | 88 | ||
740 | 89 | @autopilot.logging.log_action(logger.debug) | 89 | @autopilot.logging.log_action(logger.debug) |
741 | 90 | def go_to_hotspot_page(self): | ||
742 | 91 | return self._go_to_page('entryComponent-hotspot', 'hotspotPage') | ||
743 | 92 | |||
744 | 93 | @autopilot.logging.log_action(logger.debug) | ||
745 | 90 | def go_to_bluetooth_page(self): | 94 | def go_to_bluetooth_page(self): |
746 | 91 | return self._go_to_page('entryComponent-bluetooth', 'bluetoothPage') | 95 | return self._go_to_page('entryComponent-bluetooth', 'bluetoothPage') |
747 | 92 | 96 | ||
748 | @@ -333,52 +337,8 @@ | |||
749 | 333 | field.write(name) | 337 | field.write(name) |
750 | 334 | self.pointing_device.click_object(ok) | 338 | self.pointing_device.click_object(ok) |
751 | 335 | 339 | ||
798 | 336 | """ | 340 | |
799 | 337 | :returns: Whether or not hotspot can be used. | 341 | class HotspotPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
754 | 338 | """ | ||
755 | 339 | @autopilot.logging.log_action(logger.debug) | ||
756 | 340 | def have_hotspot(self): | ||
757 | 341 | return self.wait_select_single(objectName='hotspotEntry').visible | ||
758 | 342 | |||
759 | 343 | """ | ||
760 | 344 | :param: Configuration with keys ssid and password. | ||
761 | 345 | :returns: Hotspot page. | ||
762 | 346 | """ | ||
763 | 347 | @autopilot.logging.log_action(logger.debug) | ||
764 | 348 | def setup_hotspot(self, config=None): | ||
765 | 349 | hotspot_page = self._enter_hotspot() | ||
766 | 350 | hotspot_page.setup_hotspot(config) | ||
767 | 351 | return hotspot_page | ||
768 | 352 | |||
769 | 353 | """ | ||
770 | 354 | Enables hotspot. | ||
771 | 355 | :returns: Hotspot page. | ||
772 | 356 | """ | ||
773 | 357 | @autopilot.logging.log_action(logger.debug) | ||
774 | 358 | def enable_hotspot(self): | ||
775 | 359 | hotspot_page = self._enter_hotspot() | ||
776 | 360 | hotspot_page.enable_hotspot() | ||
777 | 361 | return hotspot_page | ||
778 | 362 | |||
779 | 363 | """ | ||
780 | 364 | Disables hotspot. | ||
781 | 365 | :returns: Hotspot page. | ||
782 | 366 | """ | ||
783 | 367 | @autopilot.logging.log_action(logger.debug) | ||
784 | 368 | def disable_hotspot(self): | ||
785 | 369 | hotspot_page = self._enter_hotspot() | ||
786 | 370 | hotspot_page.disable_hotspot() | ||
787 | 371 | return hotspot_page | ||
788 | 372 | |||
789 | 373 | @autopilot.logging.log_action(logger.debug) | ||
790 | 374 | def _enter_hotspot(self): | ||
791 | 375 | obj = self.wait_select_single(objectName="hotspotEntry") | ||
792 | 376 | self.pointing_device.click_object(obj) | ||
793 | 377 | return self.get_root_instance().wait_select_single( | ||
794 | 378 | objectName='hotspotPage') | ||
795 | 379 | |||
796 | 380 | |||
797 | 381 | class Hotspot(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
800 | 382 | 342 | ||
801 | 383 | """Autopilot helper for Hotspot page.""" | 343 | """Autopilot helper for Hotspot page.""" |
802 | 384 | 344 | ||
803 | @@ -398,7 +358,23 @@ | |||
804 | 398 | 358 | ||
805 | 399 | @autopilot.logging.log_action(logger.debug) | 359 | @autopilot.logging.log_action(logger.debug) |
806 | 400 | def enable_hotspot(self): | 360 | def enable_hotspot(self): |
808 | 401 | self._switch.check() | 361 | # We assume that the following AssertionError is due to the panel |
809 | 362 | # instantly setting checked to False, prompting the user to turn on | ||
810 | 363 | # Wi-Fi instead. | ||
811 | 364 | try: | ||
812 | 365 | self._switch.check(timeout=2) | ||
813 | 366 | except AssertionError: | ||
814 | 367 | pass | ||
815 | 368 | |||
816 | 369 | try: | ||
817 | 370 | prompt = self.get_root_instance().wait_select_single( | ||
818 | 371 | objectName='enableWifiDialog') | ||
819 | 372 | except StateNotFoundError: | ||
820 | 373 | prompt = None | ||
821 | 374 | |||
822 | 375 | if prompt: | ||
823 | 376 | prompt.confirm_enable() | ||
824 | 377 | prompt.wait_until_destroyed(timeout=5) | ||
825 | 402 | 378 | ||
826 | 403 | @autopilot.logging.log_action(logger.debug) | 379 | @autopilot.logging.log_action(logger.debug) |
827 | 404 | def disable_hotspot(self): | 380 | def disable_hotspot(self): |
828 | @@ -406,7 +382,7 @@ | |||
829 | 406 | 382 | ||
830 | 407 | @autopilot.logging.log_action(logger.debug) | 383 | @autopilot.logging.log_action(logger.debug) |
831 | 408 | def setup_hotspot(self, config): | 384 | def setup_hotspot(self, config): |
833 | 409 | obj = self.select_single(objectName='hotspotSetupEntry') | 385 | obj = self.select_single(objectName='hotspotSetupButton') |
834 | 410 | self.pointing_device.click_object(obj) | 386 | self.pointing_device.click_object(obj) |
835 | 411 | setup = self.get_root_instance().wait_select_single( | 387 | setup = self.get_root_instance().wait_select_single( |
836 | 412 | objectName='hotspotSetup') | 388 | objectName='hotspotSetup') |
837 | @@ -423,6 +399,28 @@ | |||
838 | 423 | def get_hotspot_status(self): | 399 | def get_hotspot_status(self): |
839 | 424 | return self._switch.checked | 400 | return self._switch.checked |
840 | 425 | 401 | ||
841 | 402 | @autopilot.logging.log_action(logger.debug) | ||
842 | 403 | def get_hotspot_possible(self): | ||
843 | 404 | return self._switch.enabled | ||
844 | 405 | |||
845 | 406 | |||
846 | 407 | class HotspotEnableWifiDialog( | ||
847 | 408 | ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | ||
848 | 409 | """Autopilot helper for the 'Turn on Wi-Fi' dialog in hotspot panel.""" | ||
849 | 410 | |||
850 | 411 | @classmethod | ||
851 | 412 | def validate_dbus_object(cls, path, state): | ||
852 | 413 | name = introspection.get_classname_from_path(path) | ||
853 | 414 | if name == b'Dialog': | ||
854 | 415 | if state['objectName'][1] == 'enableWifiDialog': | ||
855 | 416 | return True | ||
856 | 417 | return False | ||
857 | 418 | |||
858 | 419 | @autopilot.logging.log_action(logger.debug) | ||
859 | 420 | def confirm_enable(self): | ||
860 | 421 | button = self.select_single('Button', objectName='confirmEnable') | ||
861 | 422 | self.pointing_device.click_object(button) | ||
862 | 423 | |||
863 | 426 | 424 | ||
864 | 427 | class HotspotSetup(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): | 425 | class HotspotSetup(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
865 | 428 | 426 | ||
866 | 429 | 427 | ||
867 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py' | |||
868 | --- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2015-08-06 17:15:50 +0000 | |||
869 | +++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2015-08-14 11:52:44 +0000 | |||
870 | @@ -395,7 +395,8 @@ | |||
871 | 395 | context.SetProperty(key, value) | 395 | context.SetProperty(key, value) |
872 | 396 | 396 | ||
873 | 397 | 397 | ||
875 | 398 | class HotspotBaseTestCase(CellularBaseTestCase): | 398 | class HotspotBaseTestCase(UbuntuSystemSettingsTestCase, |
876 | 399 | dbusmock.DBusTestCase): | ||
877 | 399 | 400 | ||
878 | 400 | connectivity_parameters = {} | 401 | connectivity_parameters = {} |
879 | 401 | indicatornetwork_parameters = {} | 402 | indicatornetwork_parameters = {} |
880 | @@ -431,6 +432,7 @@ | |||
881 | 431 | stdout=subprocess.PIPE) | 432 | stdout=subprocess.PIPE) |
882 | 432 | 433 | ||
883 | 433 | super(HotspotBaseTestCase, self).setUp() | 434 | super(HotspotBaseTestCase, self).setUp() |
884 | 435 | self.hotspot_page = self.main_view.go_to_hotspot_page() | ||
885 | 434 | 436 | ||
886 | 435 | def tearDown(self): | 437 | def tearDown(self): |
887 | 436 | self.ctv_mock.terminate() | 438 | self.ctv_mock.terminate() |
888 | 437 | 439 | ||
889 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/connectivity.py' | |||
890 | --- tests/autopilot/ubuntu_system_settings/tests/connectivity.py 2015-08-10 11:01:34 +0000 | |||
891 | +++ tests/autopilot/ubuntu_system_settings/tests/connectivity.py 2015-08-14 11:52:44 +0000 | |||
892 | @@ -47,6 +47,10 @@ | |||
893 | 47 | self.SetProperty(PRIV_OBJ, PRIV_IFACE, 'HotspotPassword', value) | 47 | self.SetProperty(PRIV_OBJ, PRIV_IFACE, 'HotspotPassword', value) |
894 | 48 | 48 | ||
895 | 49 | 49 | ||
896 | 50 | def set_wifi_enabled(self, value): | ||
897 | 51 | self.SetProperty(NETS_OBJ, NETS_IFACE, 'WifiEnabled', value) | ||
898 | 52 | |||
899 | 53 | |||
900 | 50 | def load(mock, parameters): | 54 | def load(mock, parameters): |
901 | 51 | global _parameters | 55 | global _parameters |
902 | 52 | _parameters = parameters | 56 | _parameters = parameters |
903 | @@ -54,6 +58,7 @@ | |||
904 | 54 | mock.set_hotspot_enabled = set_hotspot_enabled | 58 | mock.set_hotspot_enabled = set_hotspot_enabled |
905 | 55 | mock.set_hotspot_ssid = set_hotspot_ssid | 59 | mock.set_hotspot_ssid = set_hotspot_ssid |
906 | 56 | mock.set_hotspot_password = set_hotspot_password | 60 | mock.set_hotspot_password = set_hotspot_password |
907 | 61 | mock.set_wifi_enabled = set_wifi_enabled | ||
908 | 57 | 62 | ||
909 | 58 | mock.AddObject( | 63 | mock.AddObject( |
910 | 59 | NETS_OBJ, | 64 | NETS_OBJ, |
911 | @@ -67,7 +72,15 @@ | |||
912 | 67 | 'HotspotStored': _parameters.get( | 72 | 'HotspotStored': _parameters.get( |
913 | 68 | 'HotspotStored', dbus.Boolean(False) | 73 | 'HotspotStored', dbus.Boolean(False) |
914 | 69 | ), | 74 | ), |
916 | 70 | 'UnstoppableOperationHappening': dbus.Boolean(False), | 75 | 'FlightModeSwitchEnabled': _parameters.get( |
917 | 76 | 'FlightModeSwitchEnabled', dbus.Boolean(False) | ||
918 | 77 | ), | ||
919 | 78 | 'WifiSwitchEnabled': _parameters.get( | ||
920 | 79 | 'WifiSwitchEnabled', dbus.Boolean(False) | ||
921 | 80 | ), | ||
922 | 81 | 'HotspotSwitchEnabled': _parameters.get( | ||
923 | 82 | 'HotspotSwitchEnabled', dbus.Boolean(False) | ||
924 | 83 | ), | ||
925 | 71 | 'WifiEnabled': _parameters.get('WifiEnabled', dbus.Boolean(False)), | 84 | 'WifiEnabled': _parameters.get('WifiEnabled', dbus.Boolean(False)), |
926 | 72 | # One of online, offline and connecting. | 85 | # One of online, offline and connecting. |
927 | 73 | 'Status': _parameters.get('Status', 'offline') | 86 | 'Status': _parameters.get('Status', 'offline') |
928 | @@ -98,7 +111,7 @@ | |||
929 | 98 | ), | 111 | ), |
930 | 99 | ( | 112 | ( |
931 | 100 | 'SetWifiEnabled', 'b', '', | 113 | 'SetWifiEnabled', 'b', '', |
933 | 101 | '' | 114 | 'objects["/"].set_wifi_enabled(self, args[0])' |
934 | 102 | ), | 115 | ), |
935 | 103 | ( | 116 | ( |
936 | 104 | 'SetHotspotSsid', 'ay', '', | 117 | 'SetHotspotSsid', 'ay', '', |
937 | 105 | 118 | ||
938 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py' | |||
939 | --- tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py 2015-08-10 11:01:34 +0000 | |||
940 | +++ tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py 2015-08-14 11:52:44 +0000 | |||
941 | @@ -26,7 +26,16 @@ | |||
942 | 26 | 26 | ||
943 | 27 | 27 | ||
944 | 28 | def activate(self, action_name, parameters, platform_data): | 28 | def activate(self, action_name, parameters, platform_data): |
946 | 29 | pass | 29 | |
947 | 30 | if action_name == 'wifi.enable': | ||
948 | 31 | enabled, sig, states = self.actions[action_name] | ||
949 | 32 | state = dbus.Boolean(not states[0], variant_level=1) | ||
950 | 33 | new_struct = (enabled, sig, [state]) | ||
951 | 34 | self.actions[action_name] = new_struct | ||
952 | 35 | self.Changes(dbus.Array([], signature='s'), | ||
953 | 36 | dbus.Dictionary({}, signature='sb'), | ||
954 | 37 | dbus.Dictionary({action_name: state}, signature='sv'), | ||
955 | 38 | dbus.Dictionary({}, signature='s(bgav)')) | ||
956 | 30 | 39 | ||
957 | 31 | 40 | ||
958 | 32 | def describe(self, action_name): | 41 | def describe(self, action_name): |
959 | @@ -52,19 +61,19 @@ | |||
960 | 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)}', [ |
961 | 53 | removals, enable_changes, state_changes, additions | 62 | removals, enable_changes, state_changes, additions |
962 | 54 | ]) | 63 | ]) |
963 | 55 | pass | ||
964 | 56 | 64 | ||
965 | 57 | 65 | ||
966 | 58 | def load(mock, parameters): | 66 | def load(mock, parameters): |
967 | 59 | global _parameters | 67 | global _parameters |
968 | 60 | _parameters = parameters | 68 | _parameters = parameters |
969 | 61 | 69 | ||
970 | 70 | mock.activate = activate | ||
971 | 62 | mock.describe = describe | 71 | mock.describe = describe |
972 | 63 | mock.describe_all = describe_all | 72 | mock.describe_all = describe_all |
973 | 64 | mock.list_actions = list_actions | 73 | mock.list_actions = list_actions |
974 | 65 | mock.set_state = set_state | 74 | mock.set_state = set_state |
975 | 66 | 75 | ||
977 | 67 | mock.actions = parameters.get('actions', { | 76 | mock.actions = _parameters.get('actions', { |
978 | 68 | 'wifi.enable': (True, '', [True]), | 77 | 'wifi.enable': (True, '', [True]), |
979 | 69 | }) | 78 | }) |
980 | 70 | 79 | ||
981 | @@ -72,7 +81,8 @@ | |||
982 | 72 | MAIN_IFACE, | 81 | MAIN_IFACE, |
983 | 73 | [ | 82 | [ |
984 | 74 | ( | 83 | ( |
986 | 75 | 'Activate', 'sava{sv}', '', '' | 84 | 'Activate', 'sava{sv}', '', |
987 | 85 | 'self.activate(self, args[0], args[1], args[2])' | ||
988 | 76 | ), | 86 | ), |
989 | 77 | ( | 87 | ( |
990 | 78 | 'Describe', 's', '(bgav)', | 88 | 'Describe', 's', '(bgav)', |
991 | 79 | 89 | ||
992 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_cellular.py' | |||
993 | --- tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2015-08-10 20:05:22 +0000 | |||
994 | +++ tests/autopilot/ubuntu_system_settings/tests/test_cellular.py 2015-08-14 11:52:44 +0000 | |||
995 | @@ -13,14 +13,10 @@ | |||
996 | 13 | from testtools.matchers import Equals, raises, StartsWith | 13 | from testtools.matchers import Equals, raises, StartsWith |
997 | 14 | 14 | ||
998 | 15 | from ubuntu_system_settings.tests import ( | 15 | from ubuntu_system_settings.tests import ( |
1000 | 16 | CellularBaseTestCase, HotspotBaseTestCase, CONNMAN_IFACE, RDO_IFACE, | 16 | CellularBaseTestCase, CONNMAN_IFACE, RDO_IFACE, |
1001 | 17 | NETREG_IFACE) | 17 | NETREG_IFACE) |
1002 | 18 | 18 | ||
1003 | 19 | 19 | ||
1004 | 20 | from ubuntu_system_settings.tests.connectivity import ( | ||
1005 | 21 | PRIV_IFACE as CTV_PRIV_IFACE, NETS_IFACE as CTV_NETS_IFACE | ||
1006 | 22 | ) | ||
1007 | 23 | |||
1008 | 24 | DEV_IFACE = 'org.freedesktop.NetworkManager.Device' | 20 | DEV_IFACE = 'org.freedesktop.NetworkManager.Device' |
1009 | 25 | 21 | ||
1010 | 26 | 22 | ||
1011 | @@ -307,106 +303,6 @@ | |||
1012 | 307 | Eventually(Equals('/ril_1'))) | 303 | Eventually(Equals('/ril_1'))) |
1013 | 308 | 304 | ||
1014 | 309 | 305 | ||
1015 | 310 | class HotspotNonExistantTestCase(HotspotBaseTestCase): | ||
1016 | 311 | |||
1017 | 312 | connectivity_parameters = { | ||
1018 | 313 | 'HotspotEnabled': False, | ||
1019 | 314 | 'HotspotStored': False | ||
1020 | 315 | } | ||
1021 | 316 | |||
1022 | 317 | def test_setup(self): | ||
1023 | 318 | ssid = 'bar' | ||
1024 | 319 | password = 'zomgzomg' | ||
1025 | 320 | config = {'ssid': ssid, 'password': password} | ||
1026 | 321 | |||
1027 | 322 | hotspot_page = self.cellular_page.setup_hotspot(config) | ||
1028 | 323 | |||
1029 | 324 | # Assert that the switch is on. | ||
1030 | 325 | self.assertTrue(hotspot_page.get_hotspot_status()) | ||
1031 | 326 | |||
1032 | 327 | self.assertThat( | ||
1033 | 328 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1034 | 329 | Eventually(Equals(True)) | ||
1035 | 330 | ) | ||
1036 | 331 | |||
1037 | 332 | self.assertThat( | ||
1038 | 333 | lambda: bytearray( | ||
1039 | 334 | self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotSsid') | ||
1040 | 335 | ).decode('UTF-8'), | ||
1041 | 336 | Eventually(Equals(ssid)) | ||
1042 | 337 | ) | ||
1043 | 338 | |||
1044 | 339 | self.assertThat( | ||
1045 | 340 | lambda: self.ctv_private.Get(CTV_PRIV_IFACE, 'HotspotPassword'), | ||
1046 | 341 | Eventually(Equals(password)) | ||
1047 | 342 | ) | ||
1048 | 343 | |||
1049 | 344 | self.assertThat( | ||
1050 | 345 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotStored'), | ||
1051 | 346 | Eventually(Equals(True)) | ||
1052 | 347 | ) | ||
1053 | 348 | |||
1054 | 349 | |||
1055 | 350 | class HotspotExistsTestCase(HotspotBaseTestCase): | ||
1056 | 351 | |||
1057 | 352 | connectivity_parameters = { | ||
1058 | 353 | 'HotspotStored': True | ||
1059 | 354 | } | ||
1060 | 355 | |||
1061 | 356 | def test_enabling(self): | ||
1062 | 357 | self.assertThat( | ||
1063 | 358 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1064 | 359 | Eventually(Equals(False)) | ||
1065 | 360 | ) | ||
1066 | 361 | |||
1067 | 362 | self.cellular_page.enable_hotspot() | ||
1068 | 363 | |||
1069 | 364 | self.assertThat( | ||
1070 | 365 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1071 | 366 | Eventually(Equals(True)) | ||
1072 | 367 | ) | ||
1073 | 368 | |||
1074 | 369 | def test_changing(self): | ||
1075 | 370 | ssid = 'bar' | ||
1076 | 371 | password = 'zomgzomg' | ||
1077 | 372 | config = {'ssid': ssid, 'password': password} | ||
1078 | 373 | self.cellular_page.setup_hotspot(config) | ||
1079 | 374 | |||
1080 | 375 | self.assertThat( | ||
1081 | 376 | lambda: bytearray( | ||
1082 | 377 | self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotSsid') | ||
1083 | 378 | ).decode('UTF-8'), | ||
1084 | 379 | Eventually(Equals(ssid)) | ||
1085 | 380 | ) | ||
1086 | 381 | |||
1087 | 382 | self.assertThat( | ||
1088 | 383 | lambda: self.ctv_private.Get(CTV_PRIV_IFACE, 'HotspotPassword'), | ||
1089 | 384 | Eventually(Equals(password)) | ||
1090 | 385 | ) | ||
1091 | 386 | |||
1092 | 387 | |||
1093 | 388 | class HotspotEnabledTestCase(HotspotBaseTestCase): | ||
1094 | 389 | |||
1095 | 390 | connectivity_parameters = { | ||
1096 | 391 | 'HotspotStored': True, | ||
1097 | 392 | 'HotspotEnabled': True | ||
1098 | 393 | } | ||
1099 | 394 | |||
1100 | 395 | def test_disabling(self): | ||
1101 | 396 | |||
1102 | 397 | self.assertThat( | ||
1103 | 398 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1104 | 399 | Eventually(Equals(True)) | ||
1105 | 400 | ) | ||
1106 | 401 | |||
1107 | 402 | self.cellular_page.disable_hotspot() | ||
1108 | 403 | |||
1109 | 404 | self.assertThat( | ||
1110 | 405 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1111 | 406 | Eventually(Equals(False)) | ||
1112 | 407 | ) | ||
1113 | 408 | |||
1114 | 409 | |||
1115 | 410 | class ApnTestCase(CellularBaseTestCase): | 306 | class ApnTestCase(CellularBaseTestCase): |
1116 | 411 | 307 | ||
1117 | 412 | def test_remove_apn(self): | 308 | def test_remove_apn(self): |
1118 | 413 | 309 | ||
1119 | === added file 'tests/autopilot/ubuntu_system_settings/tests/test_hotspot.py' | |||
1120 | --- tests/autopilot/ubuntu_system_settings/tests/test_hotspot.py 1970-01-01 00:00:00 +0000 | |||
1121 | +++ tests/autopilot/ubuntu_system_settings/tests/test_hotspot.py 2015-08-14 11:52:44 +0000 | |||
1122 | @@ -0,0 +1,228 @@ | |||
1123 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
1124 | 2 | # Copyright 2014 Canonical | ||
1125 | 3 | # | ||
1126 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
1127 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
1128 | 6 | # by the Free Software Foundation. | ||
1129 | 7 | |||
1130 | 8 | from autopilot.matchers import Eventually | ||
1131 | 9 | from testtools.matchers import Equals | ||
1132 | 10 | |||
1133 | 11 | from ubuntu_system_settings.tests import HotspotBaseTestCase | ||
1134 | 12 | |||
1135 | 13 | from ubuntu_system_settings.tests.connectivity import ( | ||
1136 | 14 | PRIV_IFACE as CTV_PRIV_IFACE, NETS_IFACE as CTV_NETS_IFACE | ||
1137 | 15 | ) | ||
1138 | 16 | |||
1139 | 17 | |||
1140 | 18 | class HotspotSetupTestCase(HotspotBaseTestCase): | ||
1141 | 19 | |||
1142 | 20 | connectivity_parameters = { | ||
1143 | 21 | 'HotspotEnabled': False, | ||
1144 | 22 | 'HotspotStored': False, | ||
1145 | 23 | 'WifiEnabled': True, | ||
1146 | 24 | 'HotspotSwitchEnabled': True | ||
1147 | 25 | } | ||
1148 | 26 | |||
1149 | 27 | def test_setup(self): | ||
1150 | 28 | ssid = 'bar' | ||
1151 | 29 | password = 'zomgzomg' | ||
1152 | 30 | config = {'ssid': ssid, 'password': password} | ||
1153 | 31 | |||
1154 | 32 | self.hotspot_page.setup_hotspot(config) | ||
1155 | 33 | |||
1156 | 34 | # Assert that the switch is on. | ||
1157 | 35 | self.assertTrue(self.hotspot_page.get_hotspot_status()) | ||
1158 | 36 | |||
1159 | 37 | self.assertThat( | ||
1160 | 38 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1161 | 39 | Eventually(Equals(True)) | ||
1162 | 40 | ) | ||
1163 | 41 | |||
1164 | 42 | self.assertThat( | ||
1165 | 43 | lambda: bytearray( | ||
1166 | 44 | self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotSsid') | ||
1167 | 45 | ).decode('UTF-8'), | ||
1168 | 46 | Eventually(Equals(ssid)) | ||
1169 | 47 | ) | ||
1170 | 48 | |||
1171 | 49 | self.assertThat( | ||
1172 | 50 | lambda: self.ctv_private.Get(CTV_PRIV_IFACE, 'HotspotPassword'), | ||
1173 | 51 | Eventually(Equals(password)) | ||
1174 | 52 | ) | ||
1175 | 53 | |||
1176 | 54 | self.assertThat( | ||
1177 | 55 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotStored'), | ||
1178 | 56 | Eventually(Equals(True)) | ||
1179 | 57 | ) | ||
1180 | 58 | |||
1181 | 59 | |||
1182 | 60 | class HotspotExistsTestCase(HotspotBaseTestCase): | ||
1183 | 61 | |||
1184 | 62 | connectivity_parameters = { | ||
1185 | 63 | 'HotspotStored': True, | ||
1186 | 64 | 'WifiEnabled': True, | ||
1187 | 65 | 'HotspotSwitchEnabled': True | ||
1188 | 66 | } | ||
1189 | 67 | |||
1190 | 68 | def test_enabling(self): | ||
1191 | 69 | self.assertThat( | ||
1192 | 70 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1193 | 71 | Eventually(Equals(False)) | ||
1194 | 72 | ) | ||
1195 | 73 | |||
1196 | 74 | self.hotspot_page.enable_hotspot() | ||
1197 | 75 | |||
1198 | 76 | self.assertThat( | ||
1199 | 77 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1200 | 78 | Eventually(Equals(True)) | ||
1201 | 79 | ) | ||
1202 | 80 | |||
1203 | 81 | def test_changing(self): | ||
1204 | 82 | ssid = 'bar' | ||
1205 | 83 | password = 'zomgzomg' | ||
1206 | 84 | config = {'ssid': ssid, 'password': password} | ||
1207 | 85 | self.hotspot_page.setup_hotspot(config) | ||
1208 | 86 | |||
1209 | 87 | self.assertThat( | ||
1210 | 88 | lambda: bytearray( | ||
1211 | 89 | self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotSsid') | ||
1212 | 90 | ).decode('UTF-8'), | ||
1213 | 91 | Eventually(Equals(ssid)) | ||
1214 | 92 | ) | ||
1215 | 93 | |||
1216 | 94 | self.assertThat( | ||
1217 | 95 | lambda: self.ctv_private.Get(CTV_PRIV_IFACE, 'HotspotPassword'), | ||
1218 | 96 | Eventually(Equals(password)) | ||
1219 | 97 | ) | ||
1220 | 98 | |||
1221 | 99 | |||
1222 | 100 | class HotspotRunningTestCase(HotspotBaseTestCase): | ||
1223 | 101 | |||
1224 | 102 | connectivity_parameters = { | ||
1225 | 103 | 'HotspotStored': True, | ||
1226 | 104 | 'HotspotEnabled': True, | ||
1227 | 105 | 'WifiEnabled': True, | ||
1228 | 106 | 'HotspotSwitchEnabled': True | ||
1229 | 107 | } | ||
1230 | 108 | |||
1231 | 109 | def test_disabling(self): | ||
1232 | 110 | |||
1233 | 111 | self.assertThat( | ||
1234 | 112 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1235 | 113 | Eventually(Equals(True)) | ||
1236 | 114 | ) | ||
1237 | 115 | |||
1238 | 116 | self.hotspot_page.disable_hotspot() | ||
1239 | 117 | |||
1240 | 118 | self.assertThat( | ||
1241 | 119 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1242 | 120 | Eventually(Equals(False)) | ||
1243 | 121 | ) | ||
1244 | 122 | |||
1245 | 123 | |||
1246 | 124 | class HotspotChangeNoWiFiTestCase(HotspotBaseTestCase): | ||
1247 | 125 | |||
1248 | 126 | connectivity_parameters = { | ||
1249 | 127 | 'HotspotStored': True, | ||
1250 | 128 | 'HotspotEnabled': False, | ||
1251 | 129 | 'WifiEnabled': False, | ||
1252 | 130 | 'HotspotSwitchEnabled': True | ||
1253 | 131 | } | ||
1254 | 132 | |||
1255 | 133 | def test_enabling(self): | ||
1256 | 134 | |||
1257 | 135 | self.assertThat( | ||
1258 | 136 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1259 | 137 | Eventually(Equals(False)) | ||
1260 | 138 | ) | ||
1261 | 139 | |||
1262 | 140 | self.assertThat( | ||
1263 | 141 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'WifiEnabled'), | ||
1264 | 142 | Eventually(Equals(False)) | ||
1265 | 143 | ) | ||
1266 | 144 | |||
1267 | 145 | self.hotspot_page.enable_hotspot() | ||
1268 | 146 | |||
1269 | 147 | self.assertThat( | ||
1270 | 148 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1271 | 149 | Eventually(Equals(True)) | ||
1272 | 150 | ) | ||
1273 | 151 | |||
1274 | 152 | self.assertThat( | ||
1275 | 153 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'WifiEnabled'), | ||
1276 | 154 | Eventually(Equals(True)) | ||
1277 | 155 | ) | ||
1278 | 156 | |||
1279 | 157 | |||
1280 | 158 | class HotspotSetupNoWiFiTestCase(HotspotBaseTestCase): | ||
1281 | 159 | |||
1282 | 160 | connectivity_parameters = { | ||
1283 | 161 | 'HotspotStored': False, | ||
1284 | 162 | 'HotspotEnabled': False, | ||
1285 | 163 | 'WifiEnabled': False, | ||
1286 | 164 | 'HotspotSwitchEnabled': True | ||
1287 | 165 | } | ||
1288 | 166 | |||
1289 | 167 | def test_setup(self): | ||
1290 | 168 | ssid = 'bar' | ||
1291 | 169 | password = 'zomgzomg' | ||
1292 | 170 | config = {'ssid': ssid, 'password': password} | ||
1293 | 171 | |||
1294 | 172 | self.assertThat( | ||
1295 | 173 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotStored'), | ||
1296 | 174 | Eventually(Equals(False)) | ||
1297 | 175 | ) | ||
1298 | 176 | |||
1299 | 177 | self.assertThat( | ||
1300 | 178 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'WifiEnabled'), | ||
1301 | 179 | Eventually(Equals(False)) | ||
1302 | 180 | ) | ||
1303 | 181 | |||
1304 | 182 | self.hotspot_page.setup_hotspot(config) | ||
1305 | 183 | |||
1306 | 184 | self.assertThat( | ||
1307 | 185 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotStored'), | ||
1308 | 186 | Eventually(Equals(True)) | ||
1309 | 187 | ) | ||
1310 | 188 | |||
1311 | 189 | self.assertThat( | ||
1312 | 190 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'HotspotEnabled'), | ||
1313 | 191 | Eventually(Equals(True)) | ||
1314 | 192 | ) | ||
1315 | 193 | |||
1316 | 194 | self.assertThat( | ||
1317 | 195 | lambda: self.ctv_nets.Get(CTV_NETS_IFACE, 'WifiEnabled'), | ||
1318 | 196 | Eventually(Equals(True)) | ||
1319 | 197 | ) | ||
1320 | 198 | |||
1321 | 199 | |||
1322 | 200 | class HotspotChangeInFlightModeTestCase(HotspotBaseTestCase): | ||
1323 | 201 | |||
1324 | 202 | connectivity_parameters = { | ||
1325 | 203 | 'HotspotStored': True, | ||
1326 | 204 | 'HotspotEnabled': False, | ||
1327 | 205 | 'WifiEnabled': True, | ||
1328 | 206 | 'HotspotSwitchEnabled': False | ||
1329 | 207 | } | ||
1330 | 208 | |||
1331 | 209 | def test_switch_disabled(self): | ||
1332 | 210 | self.assertFalse(self.hotspot_page.get_hotspot_possible()) | ||
1333 | 211 | |||
1334 | 212 | |||
1335 | 213 | class HotspotSetupInFlightModeTestCase( | ||
1336 | 214 | HotspotBaseTestCase): | ||
1337 | 215 | |||
1338 | 216 | connectivity_parameters = { | ||
1339 | 217 | 'HotspotStored': False, | ||
1340 | 218 | 'HotspotEnabled': False, | ||
1341 | 219 | 'WifiEnabled': True, | ||
1342 | 220 | 'HotspotSwitchEnabled': False | ||
1343 | 221 | } | ||
1344 | 222 | |||
1345 | 223 | def test_setup_disabled(self): | ||
1346 | 224 | setup = self.hotspot_page.select_single( | ||
1347 | 225 | objectName='hotspotSetupButton' | ||
1348 | 226 | ) | ||
1349 | 227 | self.assertFalse(setup.enabled) | ||
1350 | 228 | self.assertFalse(self.hotspot_page.get_hotspot_possible()) | ||
1351 | 0 | 229 | ||
1352 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_phone.py' | |||
1353 | --- tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2015-08-05 13:19:19 +0000 | |||
1354 | +++ tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2015-08-14 11:52:44 +0000 | |||
1355 | @@ -31,7 +31,7 @@ | |||
1356 | 31 | 31 | ||
1357 | 32 | # Check that the forward has been set | 32 | # Check that the forward has been set |
1358 | 33 | self.assertThat( | 33 | self.assertThat( |
1360 | 34 | call_fwd_page.get_forward_unconditionally, | 34 | call_fwd_page.get_forward_unconditionally(), |
1361 | 35 | Eventually(Equals('41444424'))) | 35 | Eventually(Equals('41444424'))) |
1362 | 36 | 36 | ||
1363 | 37 | # Check that dbus properties have been updated | 37 | # Check that dbus properties have been updated |
1364 | @@ -53,7 +53,7 @@ | |||
1365 | 53 | 53 | ||
1366 | 54 | # Check that the forward has been unset | 54 | # Check that the forward has been unset |
1367 | 55 | self.assertThat( | 55 | self.assertThat( |
1369 | 56 | call_fwd_page.get_forward_unconditionally, | 56 | call_fwd_page.get_forward_unconditionally(), |
1370 | 57 | Eventually(Equals(''))) | 57 | Eventually(Equals(''))) |
1371 | 58 | 58 | ||
1372 | 59 | # Check that dbus properties have been updated | 59 | # Check that dbus properties have been updated |
1373 | @@ -67,7 +67,7 @@ | |||
1374 | 67 | 67 | ||
1375 | 68 | # Check that the forward has been set | 68 | # Check that the forward has been set |
1376 | 69 | self.assertThat( | 69 | self.assertThat( |
1378 | 70 | call_fwd_page.get_forward_on_busy, | 70 | call_fwd_page.get_forward_on_busy(), |
1379 | 71 | Eventually(Equals('41444424'))) | 71 | Eventually(Equals('41444424'))) |
1380 | 72 | 72 | ||
1381 | 73 | # Check that dbus properties have been updated | 73 | # Check that dbus properties have been updated |
1382 | @@ -80,7 +80,7 @@ | |||
1383 | 80 | 80 | ||
1384 | 81 | # Check that the forward has been unset | 81 | # Check that the forward has been unset |
1385 | 82 | self.assertThat( | 82 | self.assertThat( |
1387 | 83 | call_fwd_page.get_forward_on_busy, | 83 | call_fwd_page.get_forward_on_busy(), |
1388 | 84 | Eventually(Equals(''))) | 84 | Eventually(Equals(''))) |
1389 | 85 | 85 | ||
1390 | 86 | # Check that dbus properties have been updated | 86 | # Check that dbus properties have been updated |
1391 | @@ -94,7 +94,7 @@ | |||
1392 | 94 | 94 | ||
1393 | 95 | # Check that the forward has been set | 95 | # Check that the forward has been set |
1394 | 96 | self.assertThat( | 96 | self.assertThat( |
1396 | 97 | call_fwd_page.get_forward_when_no_answer, | 97 | call_fwd_page.get_forward_when_no_answer(), |
1397 | 98 | Eventually(Equals('41444424'))) | 98 | Eventually(Equals('41444424'))) |
1398 | 99 | 99 | ||
1399 | 100 | # Check that dbus properties have been updated | 100 | # Check that dbus properties have been updated |
1400 | @@ -107,7 +107,7 @@ | |||
1401 | 107 | 107 | ||
1402 | 108 | # Check that the forward has been unset | 108 | # Check that the forward has been unset |
1403 | 109 | self.assertThat( | 109 | self.assertThat( |
1405 | 110 | call_fwd_page.get_forward_when_no_answer, | 110 | call_fwd_page.get_forward_when_no_answer(), |
1406 | 111 | Eventually(Equals(''))) | 111 | Eventually(Equals(''))) |
1407 | 112 | 112 | ||
1408 | 113 | # Check that dbus properties have been updated | 113 | # Check that dbus properties have been updated |
1409 | @@ -123,7 +123,7 @@ | |||
1410 | 123 | 123 | ||
1411 | 124 | # Check that the forward has been set | 124 | # Check that the forward has been set |
1412 | 125 | self.assertThat( | 125 | self.assertThat( |
1414 | 126 | call_fwd_page.get_forward_when_unreachable, | 126 | call_fwd_page.get_forward_when_unreachable(), |
1415 | 127 | Eventually(Equals('41444424'))) | 127 | Eventually(Equals('41444424'))) |
1416 | 128 | 128 | ||
1417 | 129 | # Check that dbus properties have been updated | 129 | # Check that dbus properties have been updated |
1418 | @@ -136,7 +136,7 @@ | |||
1419 | 136 | 136 | ||
1420 | 137 | # Check that the forward has been unset | 137 | # Check that the forward has been unset |
1421 | 138 | self.assertThat( | 138 | self.assertThat( |
1423 | 139 | call_fwd_page.get_forward_when_unreachable, | 139 | call_fwd_page.get_forward_when_unreachable(), |
1424 | 140 | Eventually(Equals(''))) | 140 | Eventually(Equals(''))) |
1425 | 141 | 141 | ||
1426 | 142 | # Check that dbus properties have been updated | 142 | # Check that dbus properties have been updated |
1427 | @@ -174,7 +174,7 @@ | |||
1428 | 174 | # TODO: Test the Services page itself. | 174 | # TODO: Test the Services page itself. |
1429 | 175 | def test_sim_services(self): | 175 | def test_sim_services(self): |
1430 | 176 | self.assertThat( | 176 | self.assertThat( |
1432 | 177 | self.phone_page.get_sim_services_enabled, | 177 | self.phone_page.get_sim_services_enabled(), |
1433 | 178 | Eventually(Equals(True))) | 178 | Eventually(Equals(True))) |
1434 | 179 | self.phone_page.go_to_sim_services() | 179 | self.phone_page.go_to_sim_services() |
1435 | 180 | self.main_view.go_back() | 180 | self.main_view.go_back() |
1436 | @@ -182,7 +182,7 @@ | |||
1437 | 182 | SIM_IFACE, 'PropertyChanged', 'sv', | 182 | SIM_IFACE, 'PropertyChanged', 'sv', |
1438 | 183 | ['ServiceNumbers', '']) | 183 | ['ServiceNumbers', '']) |
1439 | 184 | self.assertThat( | 184 | self.assertThat( |
1441 | 185 | self.phone_page.get_sim_services_enabled, | 185 | self.phone_page.get_sim_services_enabled(), |
1442 | 186 | Eventually(Equals(False))) | 186 | Eventually(Equals(False))) |
1443 | 187 | 187 | ||
1444 | 188 | 188 | ||
1445 | @@ -199,7 +199,7 @@ | |||
1446 | 199 | 199 | ||
1447 | 200 | # Check that the forward has been set | 200 | # Check that the forward has been set |
1448 | 201 | self.assertThat( | 201 | self.assertThat( |
1450 | 202 | call_fwd_page.get_forward_unconditionally, | 202 | call_fwd_page.get_forward_unconditionally(), |
1451 | 203 | Eventually(Equals('41444424'))) | 203 | Eventually(Equals('41444424'))) |
1452 | 204 | 204 | ||
1453 | 205 | # Check that dbus properties have been updated | 205 | # Check that dbus properties have been updated |
1454 | @@ -221,7 +221,7 @@ | |||
1455 | 221 | 221 | ||
1456 | 222 | # Check that the forward has been unset | 222 | # Check that the forward has been unset |
1457 | 223 | self.assertThat( | 223 | self.assertThat( |
1459 | 224 | call_fwd_page.get_forward_unconditionally, | 224 | call_fwd_page.get_forward_unconditionally(), |
1460 | 225 | Eventually(Equals(''))) | 225 | Eventually(Equals(''))) |
1461 | 226 | 226 | ||
1462 | 227 | # Check that dbus properties have been updated | 227 | # Check that dbus properties have been updated |
1463 | @@ -236,7 +236,7 @@ | |||
1464 | 236 | 236 | ||
1465 | 237 | # Check that the forward has been set | 237 | # Check that the forward has been set |
1466 | 238 | self.assertThat( | 238 | self.assertThat( |
1468 | 239 | call_fwd_page.get_forward_on_busy, | 239 | call_fwd_page.get_forward_on_busy(), |
1469 | 240 | Eventually(Equals('41444424'))) | 240 | Eventually(Equals('41444424'))) |
1470 | 241 | 241 | ||
1471 | 242 | # Check that dbus properties have been updated | 242 | # Check that dbus properties have been updated |
1472 | @@ -249,7 +249,7 @@ | |||
1473 | 249 | 249 | ||
1474 | 250 | # Check that the forward has been unset | 250 | # Check that the forward has been unset |
1475 | 251 | self.assertThat( | 251 | self.assertThat( |
1477 | 252 | call_fwd_page.get_forward_on_busy, | 252 | call_fwd_page.get_forward_on_busy(), |
1478 | 253 | Eventually(Equals(''))) | 253 | Eventually(Equals(''))) |
1479 | 254 | 254 | ||
1480 | 255 | # Check that dbus properties have been updated | 255 | # Check that dbus properties have been updated |
1481 | @@ -264,7 +264,7 @@ | |||
1482 | 264 | 264 | ||
1483 | 265 | # Check that the forward has been set | 265 | # Check that the forward has been set |
1484 | 266 | self.assertThat( | 266 | self.assertThat( |
1486 | 267 | call_fwd_page.get_forward_when_no_answer, | 267 | call_fwd_page.get_forward_when_no_answer(), |
1487 | 268 | Eventually(Equals('41444424'))) | 268 | Eventually(Equals('41444424'))) |
1488 | 269 | 269 | ||
1489 | 270 | # Check that dbus properties have been updated | 270 | # Check that dbus properties have been updated |
1490 | @@ -277,7 +277,7 @@ | |||
1491 | 277 | 277 | ||
1492 | 278 | # Check that the forward has been unset | 278 | # Check that the forward has been unset |
1493 | 279 | self.assertThat( | 279 | self.assertThat( |
1495 | 280 | call_fwd_page.get_forward_when_no_answer, | 280 | call_fwd_page.get_forward_when_no_answer(), |
1496 | 281 | Eventually(Equals(''))) | 281 | Eventually(Equals(''))) |
1497 | 282 | 282 | ||
1498 | 283 | # Check that dbus properties have been updated | 283 | # Check that dbus properties have been updated |
1499 | @@ -293,7 +293,7 @@ | |||
1500 | 293 | 293 | ||
1501 | 294 | # Check that the forward has been set | 294 | # Check that the forward has been set |
1502 | 295 | self.assertThat( | 295 | self.assertThat( |
1504 | 296 | call_fwd_page.get_forward_when_unreachable, | 296 | call_fwd_page.get_forward_when_unreachable(), |
1505 | 297 | Eventually(Equals('41444424'))) | 297 | Eventually(Equals('41444424'))) |
1506 | 298 | 298 | ||
1507 | 299 | # Check that dbus properties have been updated | 299 | # Check that dbus properties have been updated |
1508 | @@ -306,7 +306,7 @@ | |||
1509 | 306 | 306 | ||
1510 | 307 | # Check that the forward has been unset | 307 | # Check that the forward has been unset |
1511 | 308 | self.assertThat( | 308 | self.assertThat( |
1513 | 309 | call_fwd_page.get_forward_when_unreachable, | 309 | call_fwd_page.get_forward_when_unreachable(), |
1514 | 310 | Eventually(Equals(''))) | 310 | Eventually(Equals(''))) |
1515 | 311 | 311 | ||
1516 | 312 | # Check that dbus properties have been updated | 312 | # Check that dbus properties have been updated |
1517 | @@ -324,7 +324,7 @@ | |||
1518 | 324 | 324 | ||
1519 | 325 | # Check that the forward has been set | 325 | # Check that the forward has been set |
1520 | 326 | self.assertThat( | 326 | self.assertThat( |
1522 | 327 | call_fwd_page.get_forward_unconditionally, | 327 | call_fwd_page.get_forward_unconditionally(), |
1523 | 328 | Eventually(Equals('41444424'))) | 328 | Eventually(Equals('41444424'))) |
1524 | 329 | 329 | ||
1525 | 330 | # Check that dbus properties have been updated | 330 | # Check that dbus properties have been updated |
1526 | @@ -346,7 +346,7 @@ | |||
1527 | 346 | 346 | ||
1528 | 347 | # Check that the forward has been unset | 347 | # Check that the forward has been unset |
1529 | 348 | self.assertThat( | 348 | self.assertThat( |
1531 | 349 | call_fwd_page.get_forward_unconditionally, | 349 | call_fwd_page.get_forward_unconditionally(), |
1532 | 350 | Eventually(Equals(''))) | 350 | Eventually(Equals(''))) |
1533 | 351 | 351 | ||
1534 | 352 | # Check that dbus properties have been updated | 352 | # Check that dbus properties have been updated |
1535 | @@ -361,7 +361,7 @@ | |||
1536 | 361 | 361 | ||
1537 | 362 | # Check that the forward has been set | 362 | # Check that the forward has been set |
1538 | 363 | self.assertThat( | 363 | self.assertThat( |
1540 | 364 | call_fwd_page.get_forward_on_busy, | 364 | call_fwd_page.get_forward_on_busy(), |
1541 | 365 | Eventually(Equals('41444424'))) | 365 | Eventually(Equals('41444424'))) |
1542 | 366 | 366 | ||
1543 | 367 | # Check that dbus properties have been updated | 367 | # Check that dbus properties have been updated |
1544 | @@ -374,7 +374,7 @@ | |||
1545 | 374 | 374 | ||
1546 | 375 | # Check that the forward has been unset | 375 | # Check that the forward has been unset |
1547 | 376 | self.assertThat( | 376 | self.assertThat( |
1549 | 377 | call_fwd_page.get_forward_on_busy, | 377 | call_fwd_page.get_forward_on_busy(), |
1550 | 378 | Eventually(Equals(''))) | 378 | Eventually(Equals(''))) |
1551 | 379 | 379 | ||
1552 | 380 | # Check that dbus properties have been updated | 380 | # Check that dbus properties have been updated |
1553 | @@ -389,7 +389,7 @@ | |||
1554 | 389 | 389 | ||
1555 | 390 | # Check that the forward has been set | 390 | # Check that the forward has been set |
1556 | 391 | self.assertThat( | 391 | self.assertThat( |
1558 | 392 | call_fwd_page.get_forward_when_no_answer, | 392 | call_fwd_page.get_forward_when_no_answer(), |
1559 | 393 | Eventually(Equals('41444424'))) | 393 | Eventually(Equals('41444424'))) |
1560 | 394 | 394 | ||
1561 | 395 | # Check that dbus properties have been updated | 395 | # Check that dbus properties have been updated |
1562 | @@ -402,7 +402,7 @@ | |||
1563 | 402 | 402 | ||
1564 | 403 | # Check that the forward has been unset | 403 | # Check that the forward has been unset |
1565 | 404 | self.assertThat( | 404 | self.assertThat( |
1567 | 405 | call_fwd_page.get_forward_when_no_answer, | 405 | call_fwd_page.get_forward_when_no_answer(), |
1568 | 406 | Eventually(Equals(''))) | 406 | Eventually(Equals(''))) |
1569 | 407 | 407 | ||
1570 | 408 | # Check that dbus properties have been updated | 408 | # Check that dbus properties have been updated |
1571 | @@ -418,7 +418,7 @@ | |||
1572 | 418 | 418 | ||
1573 | 419 | # Check that the forward has been set | 419 | # Check that the forward has been set |
1574 | 420 | self.assertThat( | 420 | self.assertThat( |
1576 | 421 | call_fwd_page.get_forward_when_unreachable, | 421 | call_fwd_page.get_forward_when_unreachable(), |
1577 | 422 | Eventually(Equals('41444424'))) | 422 | Eventually(Equals('41444424'))) |
1578 | 423 | 423 | ||
1579 | 424 | # Check that dbus properties have been updated | 424 | # Check that dbus properties have been updated |
1580 | @@ -431,7 +431,7 @@ | |||
1581 | 431 | 431 | ||
1582 | 432 | # Check that the forward has been unset | 432 | # Check that the forward has been unset |
1583 | 433 | self.assertThat( | 433 | self.assertThat( |
1585 | 434 | call_fwd_page.get_forward_when_unreachable, | 434 | call_fwd_page.get_forward_when_unreachable(), |
1586 | 435 | Eventually(Equals(''))) | 435 | Eventually(Equals(''))) |
1587 | 436 | 436 | ||
1588 | 437 | # Check that dbus properties have been updated | 437 | # Check that dbus properties have been updated |
1589 | @@ -495,7 +495,7 @@ | |||
1590 | 495 | # TODO: Test the Services page itself. | 495 | # TODO: Test the Services page itself. |
1591 | 496 | def test_sim_services_sim_1(self): | 496 | def test_sim_services_sim_1(self): |
1592 | 497 | self.assertThat( | 497 | self.assertThat( |
1594 | 498 | lambda: self.phone_page.get_sim_services_enabled(sim=0), | 498 | self.phone_page.get_sim_services_enabled(sim=0), |
1595 | 499 | Eventually(Equals(True))) | 499 | Eventually(Equals(True))) |
1596 | 500 | self.phone_page.go_to_sim_services(sim=0) | 500 | self.phone_page.go_to_sim_services(sim=0) |
1597 | 501 | self.main_view.go_back() | 501 | self.main_view.go_back() |
1598 | @@ -503,13 +503,13 @@ | |||
1599 | 503 | SIM_IFACE, 'PropertyChanged', 'sv', | 503 | SIM_IFACE, 'PropertyChanged', 'sv', |
1600 | 504 | ['ServiceNumbers', '']) | 504 | ['ServiceNumbers', '']) |
1601 | 505 | self.assertThat( | 505 | self.assertThat( |
1603 | 506 | lambda: self.phone_page.get_sim_services_enabled(sim=0), | 506 | self.phone_page.get_sim_services_enabled(sim=0), |
1604 | 507 | Eventually(Equals(False))) | 507 | Eventually(Equals(False))) |
1605 | 508 | 508 | ||
1606 | 509 | # TODO: Test the Services page itself. | 509 | # TODO: Test the Services page itself. |
1607 | 510 | def test_sim_services_sim_2(self): | 510 | def test_sim_services_sim_2(self): |
1608 | 511 | self.assertThat( | 511 | self.assertThat( |
1610 | 512 | lambda: self.phone_page.get_sim_services_enabled(sim=1), | 512 | self.phone_page.get_sim_services_enabled(sim=1), |
1611 | 513 | Eventually(Equals(True))) | 513 | Eventually(Equals(True))) |
1612 | 514 | self.phone_page.go_to_sim_services(sim=1) | 514 | self.phone_page.go_to_sim_services(sim=1) |
1613 | 515 | self.main_view.go_back() | 515 | self.main_view.go_back() |
1614 | @@ -517,5 +517,5 @@ | |||
1615 | 517 | SIM_IFACE, 'PropertyChanged', 'sv', | 517 | SIM_IFACE, 'PropertyChanged', 'sv', |
1616 | 518 | ['ServiceNumbers', '']) | 518 | ['ServiceNumbers', '']) |
1617 | 519 | self.assertThat( | 519 | self.assertThat( |
1619 | 520 | lambda: self.phone_page.get_sim_services_enabled(sim=1), | 520 | self.phone_page.get_sim_services_enabled(sim=1), |
1620 | 521 | Eventually(Equals(False))) | 521 | Eventually(Equals(False))) |
1621 | 522 | 522 | ||
1622 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/test_plugins.py' | |||
1623 | --- tests/autopilot/ubuntu_system_settings/tests/test_plugins.py 2014-12-02 06:40:54 +0000 | |||
1624 | +++ tests/autopilot/ubuntu_system_settings/tests/test_plugins.py 2015-08-14 11:52:44 +0000 | |||
1625 | @@ -87,6 +87,13 @@ | |||
1626 | 87 | ) | 87 | ) |
1627 | 88 | self.assertThat(plugin, NotEquals(None)) | 88 | self.assertThat(plugin, NotEquals(None)) |
1628 | 89 | 89 | ||
1629 | 90 | def test_hotspot_plugin(self): | ||
1630 | 91 | """ Checks whether the Hotspot plugin is available """ | ||
1631 | 92 | plugin = self.main_view.select_single( | ||
1632 | 93 | objectName='entryComponent-hotspot' | ||
1633 | 94 | ) | ||
1634 | 95 | self.assertThat(plugin, NotEquals(None)) | ||
1635 | 96 | |||
1636 | 90 | def test_background_plugin(self): | 97 | def test_background_plugin(self): |
1637 | 91 | """ Checks whether the Background plugin is available """ | 98 | """ Checks whether the Background plugin is available """ |
1638 | 92 | plugin = self.main_view.select_single( | 99 | plugin = self.main_view.select_single( |
FAILED: Continuous integration, rev:1498 jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- ci/2273/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 3612/console jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- vivid-amd64- ci/48/console jenkins. qa.ubuntu. com/job/ ubuntu- system- settings- vivid-i386- ci/457/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 3609/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- system- settings- ci/2273/ rebuild
http://