Merge lp:~diegosarmentero/ubuntu-system-settings/duplicate-and-credentials into lp:ubuntu-system-settings
- duplicate-and-credentials
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Sebastien Bacher |
Approved revision: | 690 |
Merged at revision: | 692 |
Proposed branch: | lp:~diegosarmentero/ubuntu-system-settings/duplicate-and-credentials |
Merge into: | lp:ubuntu-system-settings |
Diff against target: |
277 lines (+53/-15) 9 files modified
plugins/system-update/PageComponent.qml (+1/-2) plugins/system-update/system_update.cpp (+1/-1) plugins/system-update/system_update.h (+2/-0) plugins/system-update/update_manager.cpp (+25/-7) plugins/system-update/update_manager.h (+4/-0) tests/plugins/system-update/fakessoservice.cpp (+8/-3) tests/plugins/system-update/fakessoservice.h (+4/-0) tests/plugins/system-update/fakesystemupdate.h (+2/-0) tests/plugins/system-update/tst_updatemanager.cpp (+6/-2) |
To merge this branch: | bzr merge lp:~diegosarmentero/ubuntu-system-settings/duplicate-and-credentials |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Sebastien Bacher (community) | Approve | ||
Review via email: mp+218414@code.launchpad.net |
Commit message
- Avoid duplicate result of Image upadte
- Don't ask for credentials on Image update
Description of the change
Some tests has also been updated according the new code.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:689
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Diego Sarmentero (diegosarmentero) wrote : | # |
> Thanks for the work, the package fails to build with those changes for me
> though
>
> "FAIL! : UpdateManagerTe
> not the same
> Actual (manager.
> Expected (4) : 4
> Loc: [/tmp/build/
> /system-
> FAIL! : UpdateManagerTe
> not the same
> Actual (manager.
> Expected (4) : 4
> Loc: [/tmp/build/
> /system-
>
> Totals: 6 passed, 2 failed, 0 skipped
>
> (that's building on an i386 configuration)
Weird, it's building for me in the phone, i'll check what's going on
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:690
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 691. By Diego Sarmentero
-
initialize m_validCredentials
Sebastien Bacher (seb128) wrote : | # |
Looks good now, thanks
Sebastien Bacher (seb128) wrote : | # |
(the autopilot tests fail here, but that's fixed by https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:691
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'plugins/system-update/PageComponent.qml' | |||
2 | --- plugins/system-update/PageComponent.qml 2014-04-11 16:34:57 +0000 | |||
3 | +++ plugins/system-update/PageComponent.qml 2014-05-07 15:38:11 +0000 | |||
4 | @@ -101,20 +101,19 @@ | |||
5 | 101 | }, | 101 | }, |
6 | 102 | State { | 102 | State { |
7 | 103 | name: "UPDATE" | 103 | name: "UPDATE" |
8 | 104 | PropertyChanges { target: notification; visible: false} | ||
9 | 105 | PropertyChanges { target: updateList; visible: true} | 104 | PropertyChanges { target: updateList; visible: true} |
10 | 106 | PropertyChanges { target: installAllButton; visible: true} | 105 | PropertyChanges { target: installAllButton; visible: true} |
11 | 107 | PropertyChanges { target: updateNotification; visible: false} | 106 | PropertyChanges { target: updateNotification; visible: false} |
12 | 108 | }, | 107 | }, |
13 | 109 | State { | 108 | State { |
14 | 110 | name: "NOCREDENTIALS" | 109 | name: "NOCREDENTIALS" |
15 | 110 | PropertyChanges { target: updateList; visible: true} | ||
16 | 111 | PropertyChanges { target: notification; text: i18n.tr("Please log into your Ubuntu One account.")} | 111 | PropertyChanges { target: notification; text: i18n.tr("Please log into your Ubuntu One account.")} |
17 | 112 | PropertyChanges { target: notification; onClicked: root.open_online_accounts() } | 112 | PropertyChanges { target: notification; onClicked: root.open_online_accounts() } |
18 | 113 | PropertyChanges { target: notification; progression: true} | 113 | PropertyChanges { target: notification; progression: true} |
19 | 114 | PropertyChanges { target: notification; visible: true} | 114 | PropertyChanges { target: notification; visible: true} |
20 | 115 | PropertyChanges { target: updateNotification; text: i18n.tr("Credentials not found")} | 115 | PropertyChanges { target: updateNotification; text: i18n.tr("Credentials not found")} |
21 | 116 | PropertyChanges { target: updateNotification; visible: true} | 116 | PropertyChanges { target: updateNotification; visible: true} |
22 | 117 | PropertyChanges { target: installAllButton; visible: false} | ||
23 | 118 | } | 117 | } |
24 | 119 | ] | 118 | ] |
25 | 120 | 119 | ||
26 | 121 | 120 | ||
27 | === modified file 'plugins/system-update/system_update.cpp' | |||
28 | --- plugins/system-update/system_update.cpp 2014-02-25 20:27:51 +0000 | |||
29 | +++ plugins/system-update/system_update.cpp 2014-05-07 15:38:11 +0000 | |||
30 | @@ -151,7 +151,7 @@ | |||
31 | 151 | QString errorReason) | 151 | QString errorReason) |
32 | 152 | { | 152 | { |
33 | 153 | update = new Update(this); | 153 | update = new Update(this); |
35 | 154 | QString packageName("UbuntuImage"); | 154 | QString packageName(UBUNTU_PACKAGE_NAME); |
36 | 155 | update->initializeApplication(packageName, "Ubuntu", | 155 | update->initializeApplication(packageName, "Ubuntu", |
37 | 156 | QString::number(this->currentBuildNumber())); | 156 | QString::number(this->currentBuildNumber())); |
38 | 157 | 157 | ||
39 | 158 | 158 | ||
40 | === modified file 'plugins/system-update/system_update.h' | |||
41 | --- plugins/system-update/system_update.h 2014-02-25 20:27:51 +0000 | |||
42 | +++ plugins/system-update/system_update.h 2014-05-07 15:38:11 +0000 | |||
43 | @@ -30,6 +30,8 @@ | |||
44 | 30 | 30 | ||
45 | 31 | #include "update.h" | 31 | #include "update.h" |
46 | 32 | 32 | ||
47 | 33 | #define UBUNTU_PACKAGE_NAME "UbuntuImage" | ||
48 | 34 | |||
49 | 33 | namespace UpdatePlugin { | 35 | namespace UpdatePlugin { |
50 | 34 | 36 | ||
51 | 35 | class SystemUpdate : public QObject | 37 | class SystemUpdate : public QObject |
52 | 36 | 38 | ||
53 | === modified file 'plugins/system-update/update_manager.cpp' | |||
54 | --- plugins/system-update/update_manager.cpp 2014-04-11 16:27:17 +0000 | |||
55 | +++ plugins/system-update/update_manager.cpp 2014-05-07 15:38:11 +0000 | |||
56 | @@ -28,6 +28,11 @@ | |||
57 | 28 | #include <QProcessEnvironment> | 28 | #include <QProcessEnvironment> |
58 | 29 | 29 | ||
59 | 30 | #define CLICK_COMMAND "click" | 30 | #define CLICK_COMMAND "click" |
60 | 31 | #ifdef TESTS | ||
61 | 32 | #define CHECK_CREDENTIALS "IGNORE_CREDENTIALS" | ||
62 | 33 | #else | ||
63 | 34 | #define CHECK_CREDENTIALS "CHECK_CREDENTIALS" | ||
64 | 35 | #endif | ||
65 | 31 | 36 | ||
66 | 32 | namespace UpdatePlugin { | 37 | namespace UpdatePlugin { |
67 | 33 | 38 | ||
68 | @@ -118,13 +123,17 @@ | |||
69 | 118 | m_model.clear(); | 123 | m_model.clear(); |
70 | 119 | m_apps.clear(); | 124 | m_apps.clear(); |
71 | 120 | Q_EMIT modelChanged(); | 125 | Q_EMIT modelChanged(); |
72 | 126 | bool enabled = enableAutopilotMode(); | ||
73 | 121 | if (getCheckForCredentials()) { | 127 | if (getCheckForCredentials()) { |
74 | 122 | m_systemUpdate.checkForUpdate(); | 128 | m_systemUpdate.checkForUpdate(); |
75 | 123 | m_service.getCredentials(); | 129 | m_service.getCredentials(); |
77 | 124 | } else { | 130 | } else if (enabled) { |
78 | 125 | systemUpdateNotAvailable(); | 131 | systemUpdateNotAvailable(); |
79 | 126 | Token token("", "", "", ""); | 132 | Token token("", "", "", ""); |
80 | 127 | handleCredentialsFound(token); | 133 | handleCredentialsFound(token); |
81 | 134 | } else { | ||
82 | 135 | systemUpdateNotAvailable(); | ||
83 | 136 | clickUpdateNotAvailable(); | ||
84 | 128 | } | 137 | } |
85 | 129 | } | 138 | } |
86 | 130 | 139 | ||
87 | @@ -147,10 +156,17 @@ | |||
88 | 147 | bool UpdateManager::getCheckForCredentials() | 156 | bool UpdateManager::getCheckForCredentials() |
89 | 148 | { | 157 | { |
90 | 149 | QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); | 158 | QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); |
92 | 150 | QString value = environment.value("IGNORE_CREDENTIALS", QString("CHECK_CREDENTIALS")); | 159 | QString value = environment.value("IGNORE_CREDENTIALS", QString(CHECK_CREDENTIALS)); |
93 | 151 | return value == "CHECK_CREDENTIALS"; | 160 | return value == "CHECK_CREDENTIALS"; |
94 | 152 | } | 161 | } |
95 | 153 | 162 | ||
96 | 163 | bool UpdateManager::enableAutopilotMode() | ||
97 | 164 | { | ||
98 | 165 | QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); | ||
99 | 166 | QString value = environment.value("AUTOPILOT_ENABLED", QString("AUTOPILOT_DISABLED")); | ||
100 | 167 | return value == "AUTOPILOT_ENABLED"; | ||
101 | 168 | } | ||
102 | 169 | |||
103 | 154 | void UpdateManager::processOutput() | 170 | void UpdateManager::processOutput() |
104 | 155 | { | 171 | { |
105 | 156 | QString output(m_process.readAllStandardOutput()); | 172 | QString output(m_process.readAllStandardOutput()); |
106 | @@ -179,7 +195,8 @@ | |||
107 | 179 | bool updateAvailable = false; | 195 | bool updateAvailable = false; |
108 | 180 | foreach (QString id, m_apps.keys()) { | 196 | foreach (QString id, m_apps.keys()) { |
109 | 181 | Update *app = m_apps.value(id); | 197 | Update *app = m_apps.value(id); |
111 | 182 | if(app->updateRequired()) { | 198 | QString packagename(UBUNTU_PACKAGE_NAME); |
112 | 199 | if(app->getPackageName() != packagename && app->updateRequired()) { | ||
113 | 183 | updateAvailable = true; | 200 | updateAvailable = true; |
114 | 184 | m_model.append(QVariant::fromValue(app)); | 201 | m_model.append(QVariant::fromValue(app)); |
115 | 185 | } | 202 | } |
116 | @@ -194,20 +211,21 @@ | |||
117 | 194 | 211 | ||
118 | 195 | void UpdateManager::registerSystemUpdate(const QString& packageName, Update *update) | 212 | void UpdateManager::registerSystemUpdate(const QString& packageName, Update *update) |
119 | 196 | { | 213 | { |
122 | 197 | m_systemCheckingUpdate = false; | 214 | QString packagename(UBUNTU_PACKAGE_NAME); |
123 | 198 | if (!m_apps.contains(packageName)) { | 215 | if (!m_apps.contains(packagename)) { |
124 | 199 | m_apps[packageName] = update; | 216 | m_apps[packageName] = update; |
125 | 200 | m_model.insert(0, QVariant::fromValue(update)); | 217 | m_model.insert(0, QVariant::fromValue(update)); |
126 | 201 | Q_EMIT modelChanged(); | 218 | Q_EMIT modelChanged(); |
127 | 219 | Q_EMIT updateAvailableFound(update->updateState()); | ||
128 | 202 | } | 220 | } |
130 | 203 | Q_EMIT updateAvailableFound(update->updateState()); | 221 | m_systemCheckingUpdate = false; |
131 | 204 | 222 | ||
132 | 205 | reportCheckState(); | 223 | reportCheckState(); |
133 | 206 | } | 224 | } |
134 | 207 | 225 | ||
135 | 208 | void UpdateManager::systemUpdatePaused(int value) | 226 | void UpdateManager::systemUpdatePaused(int value) |
136 | 209 | { | 227 | { |
138 | 210 | QString packagename("UbuntuImage"); | 228 | QString packagename(UBUNTU_PACKAGE_NAME); |
139 | 211 | if (m_apps.contains(packagename)) { | 229 | if (m_apps.contains(packagename)) { |
140 | 212 | Update *update = m_apps[packagename]; | 230 | Update *update = m_apps[packagename]; |
141 | 213 | update->setSelected(true); | 231 | update->setSelected(true); |
142 | 214 | 232 | ||
143 | === modified file 'plugins/system-update/update_manager.h' | |||
144 | --- plugins/system-update/update_manager.h 2014-04-11 16:27:17 +0000 | |||
145 | +++ plugins/system-update/update_manager.h 2014-05-07 15:38:11 +0000 | |||
146 | @@ -90,6 +90,9 @@ | |||
147 | 90 | void set_token(Token& t) { m_token = t; } | 90 | void set_token(Token& t) { m_token = t; } |
148 | 91 | Token get_token() { return m_token; } | 91 | Token get_token() { return m_token; } |
149 | 92 | void setCheckintUpdates(int value) { m_checkingUpdates = value; } | 92 | void setCheckintUpdates(int value) { m_checkingUpdates = value; } |
150 | 93 | void setCheckSystemUpdates(int value) { m_systemCheckingUpdate = value; } | ||
151 | 94 | void setCheckClickUpdates(int value) { m_clickCheckingUpdate = value; } | ||
152 | 95 | FakeSsoService& getService() { return m_service; } | ||
153 | 93 | #endif | 96 | #endif |
154 | 94 | 97 | ||
155 | 95 | public Q_SLOTS: | 98 | public Q_SLOTS: |
156 | @@ -129,6 +132,7 @@ | |||
157 | 129 | void checkForUpdates(); | 132 | void checkForUpdates(); |
158 | 130 | QString getClickCommand(); | 133 | QString getClickCommand(); |
159 | 131 | bool getCheckForCredentials(); | 134 | bool getCheckForCredentials(); |
160 | 135 | bool enableAutopilotMode(); | ||
161 | 132 | void reportCheckState(); | 136 | void reportCheckState(); |
162 | 133 | void updateNotAvailable(); | 137 | void updateNotAvailable(); |
163 | 134 | }; | 138 | }; |
164 | 135 | 139 | ||
165 | === modified file 'tests/plugins/system-update/fakessoservice.cpp' | |||
166 | --- tests/plugins/system-update/fakessoservice.cpp 2014-02-26 11:26:01 +0000 | |||
167 | +++ tests/plugins/system-update/fakessoservice.cpp 2014-05-07 15:38:11 +0000 | |||
168 | @@ -3,14 +3,19 @@ | |||
169 | 3 | namespace UpdatePlugin { | 3 | namespace UpdatePlugin { |
170 | 4 | 4 | ||
171 | 5 | FakeSsoService::FakeSsoService(QObject *parent) : | 5 | FakeSsoService::FakeSsoService(QObject *parent) : |
173 | 6 | QObject(parent) | 6 | QObject(parent), |
174 | 7 | m_validCredentials(true) | ||
175 | 7 | { | 8 | { |
176 | 8 | } | 9 | } |
177 | 9 | 10 | ||
178 | 10 | void FakeSsoService::getCredentials() | 11 | void FakeSsoService::getCredentials() |
179 | 11 | { | 12 | { |
182 | 12 | Token token("token_key", "token_secret", "consumer_key", "consumer_secret"); | 13 | if(m_validCredentials) { |
183 | 13 | emit this->credentialsFound(token); | 14 | Token token("token_key", "token_secret", "consumer_key", "consumer_secret"); |
184 | 15 | emit this->credentialsFound(token); | ||
185 | 16 | } else { | ||
186 | 17 | emit this->credentialsNotFound(); | ||
187 | 18 | } | ||
188 | 14 | } | 19 | } |
189 | 15 | 20 | ||
190 | 16 | } | 21 | } |
191 | 17 | 22 | ||
192 | === modified file 'tests/plugins/system-update/fakessoservice.h' | |||
193 | --- tests/plugins/system-update/fakessoservice.h 2014-02-26 11:26:01 +0000 | |||
194 | +++ tests/plugins/system-update/fakessoservice.h 2014-05-07 15:38:11 +0000 | |||
195 | @@ -15,11 +15,15 @@ | |||
196 | 15 | explicit FakeSsoService(QObject *parent = 0); | 15 | explicit FakeSsoService(QObject *parent = 0); |
197 | 16 | 16 | ||
198 | 17 | void getCredentials(); | 17 | void getCredentials(); |
199 | 18 | |||
200 | 19 | void setValidCredentials(bool value) { m_validCredentials = value; } | ||
201 | 18 | 20 | ||
202 | 19 | signals: | 21 | signals: |
203 | 20 | void credentialsFound(const Token&); | 22 | void credentialsFound(const Token&); |
204 | 21 | void credentialsNotFound(); | 23 | void credentialsNotFound(); |
205 | 22 | 24 | ||
206 | 25 | private: | ||
207 | 26 | bool m_validCredentials; | ||
208 | 23 | }; | 27 | }; |
209 | 24 | 28 | ||
210 | 25 | } | 29 | } |
211 | 26 | 30 | ||
212 | === modified file 'tests/plugins/system-update/fakesystemupdate.h' | |||
213 | --- tests/plugins/system-update/fakesystemupdate.h 2014-02-26 11:26:01 +0000 | |||
214 | +++ tests/plugins/system-update/fakesystemupdate.h 2014-05-07 15:38:11 +0000 | |||
215 | @@ -22,6 +22,8 @@ | |||
216 | 22 | #include <QObject> | 22 | #include <QObject> |
217 | 23 | #include "../../../plugins/system-update/update.h" | 23 | #include "../../../plugins/system-update/update.h" |
218 | 24 | 24 | ||
219 | 25 | #define UBUNTU_PACKAGE_NAME "UbuntuImage" | ||
220 | 26 | |||
221 | 25 | namespace UpdatePlugin { | 27 | namespace UpdatePlugin { |
222 | 26 | 28 | ||
223 | 27 | class FakeSystemUpdate: public QObject | 29 | class FakeSystemUpdate: public QObject |
224 | 28 | 30 | ||
225 | === modified file 'tests/plugins/system-update/tst_updatemanager.cpp' | |||
226 | --- tests/plugins/system-update/tst_updatemanager.cpp 2014-04-11 16:27:17 +0000 | |||
227 | +++ tests/plugins/system-update/tst_updatemanager.cpp 2014-05-07 15:38:11 +0000 | |||
228 | @@ -58,6 +58,7 @@ | |||
229 | 58 | void UpdateManagerTest::testRegisterSystemUpdateRequired() | 58 | void UpdateManagerTest::testRegisterSystemUpdateRequired() |
230 | 59 | { | 59 | { |
231 | 60 | UpdateManager manager; | 60 | UpdateManager manager; |
232 | 61 | manager.checkUpdates(); | ||
233 | 61 | QSignalSpy spy(&manager, SIGNAL(modelChanged())); | 62 | QSignalSpy spy(&manager, SIGNAL(modelChanged())); |
234 | 62 | QSignalSpy spy2(&manager, SIGNAL(updateAvailableFound(bool))); | 63 | QSignalSpy spy2(&manager, SIGNAL(updateAvailableFound(bool))); |
235 | 63 | QTRY_COMPARE(spy.count(), 0); | 64 | QTRY_COMPARE(spy.count(), 0); |
236 | @@ -66,6 +67,7 @@ | |||
237 | 66 | 67 | ||
238 | 67 | Update *update = getUpdate(); | 68 | Update *update = getUpdate(); |
239 | 68 | 69 | ||
240 | 70 | manager.setCheckSystemUpdates(true); | ||
241 | 69 | manager.registerSystemUpdate(update->getPackageName(), update); | 71 | manager.registerSystemUpdate(update->getPackageName(), update); |
242 | 70 | QTRY_COMPARE(spy.count(), 1); | 72 | QTRY_COMPARE(spy.count(), 1); |
243 | 71 | QTRY_COMPARE(spy2.count(), 1); | 73 | QTRY_COMPARE(spy2.count(), 1); |
244 | @@ -102,6 +104,7 @@ | |||
245 | 102 | void UpdateManagerTest::testStartDownload() | 104 | void UpdateManagerTest::testStartDownload() |
246 | 103 | { | 105 | { |
247 | 104 | UpdateManager manager; | 106 | UpdateManager manager; |
248 | 107 | manager.setCheckSystemUpdates(true); | ||
249 | 105 | Update *update = getUpdate(); | 108 | Update *update = getUpdate(); |
250 | 106 | manager.registerSystemUpdate(update->getPackageName(), update); | 109 | manager.registerSystemUpdate(update->getPackageName(), update); |
251 | 107 | manager.startDownload(update->getPackageName()); | 110 | manager.startDownload(update->getPackageName()); |
252 | @@ -111,6 +114,7 @@ | |||
253 | 111 | void UpdateManagerTest::testPauseDownload() | 114 | void UpdateManagerTest::testPauseDownload() |
254 | 112 | { | 115 | { |
255 | 113 | UpdateManager manager; | 116 | UpdateManager manager; |
256 | 117 | manager.setCheckSystemUpdates(true); | ||
257 | 114 | Update *update = getUpdate(); | 118 | Update *update = getUpdate(); |
258 | 115 | manager.registerSystemUpdate(update->getPackageName(), update); | 119 | manager.registerSystemUpdate(update->getPackageName(), update); |
259 | 116 | update->setUpdateState(true); | 120 | update->setUpdateState(true); |
260 | @@ -123,7 +127,7 @@ | |||
261 | 123 | UpdateManager manager; | 127 | UpdateManager manager; |
262 | 124 | QSignalSpy spy(&manager, SIGNAL(modelChanged())); | 128 | QSignalSpy spy(&manager, SIGNAL(modelChanged())); |
263 | 125 | QTRY_COMPARE(manager.get_apps().size(), 0); | 129 | QTRY_COMPARE(manager.get_apps().size(), 0); |
265 | 126 | manager.checkUpdates(); | 130 | manager.getService().getCredentials(); |
266 | 127 | QTRY_COMPARE(manager.get_apps().size(), 4); | 131 | QTRY_COMPARE(manager.get_apps().size(), 4); |
267 | 128 | QTRY_COMPARE(manager.get_model().size(), 1); | 132 | QTRY_COMPARE(manager.get_model().size(), 1); |
268 | 129 | Update* app = manager.get_model()[0].value<Update*>(); | 133 | Update* app = manager.get_model()[0].value<Update*>(); |
269 | @@ -137,7 +141,7 @@ | |||
270 | 137 | UpdateManager manager; | 141 | UpdateManager manager; |
271 | 138 | QSignalSpy spy(&manager, SIGNAL(updateAvailableFound(bool))); | 142 | QSignalSpy spy(&manager, SIGNAL(updateAvailableFound(bool))); |
272 | 139 | QTRY_COMPARE(manager.get_apps().size(), 0); | 143 | QTRY_COMPARE(manager.get_apps().size(), 0); |
274 | 140 | manager.checkUpdates(); | 144 | manager.getService().getCredentials(); |
275 | 141 | QTRY_COMPARE(manager.get_apps().size(), 4); | 145 | QTRY_COMPARE(manager.get_apps().size(), 4); |
276 | 142 | QTRY_COMPARE(manager.get_model().size(), 1); | 146 | QTRY_COMPARE(manager.get_model().size(), 1); |
277 | 143 | Update* app = manager.get_model()[0].value<Update*>(); | 147 | Update* app = manager.get_model()[0].value<Update*>(); |
Thanks for the work, the package fails to build with those changes for me though
"FAIL! : UpdateManagerTe st::testCheckUp datesModelSigna l() Compared values are not the same get_apps( ).size( )): 0 ubuntu- system- settings- 0.1+14. 10.20140428/ tests/plugins/ system- update/ tst_updatemanag er.cpp( 131)] st::testCheckUp datesUpdateSign al() Compared values are not the same get_apps( ).size( )): 0 ubuntu- system- settings- 0.1+14. 10.20140428/ tests/plugins/ system- update/ tst_updatemanag er.cpp( 145)]
Actual (manager.
Expected (4) : 4
Loc: [/tmp/build/
FAIL! : UpdateManagerTe
Actual (manager.
Expected (4) : 4
Loc: [/tmp/build/
Totals: 6 passed, 2 failed, 0 skipped
(that's building on an i386 configuration)