~laney/ubuntu-system-settings/click-changelogs

« back to all changes in this revision

Viewing changes to tests/plugins/system-update/tst_updatemanager.cpp

  • Committer: CI bot
  • Author(s): Diego Sarmentero
  • Date: 2014-05-07 16:36:13 UTC
  • mfrom: (686.1.5 ubuntu-system-settings)
  • Revision ID: ps-jenkins@lists.canonical.com-20140507163613-8km7f37e6zzv7ix6
- Avoid duplicate result of Image upadte
- Don't ask for credentials on Image update Fixes: 1301644

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
void UpdateManagerTest::testRegisterSystemUpdateRequired()
59
59
{
60
60
    UpdateManager manager;
 
61
    manager.checkUpdates();
61
62
    QSignalSpy spy(&manager, SIGNAL(modelChanged()));
62
63
    QSignalSpy spy2(&manager, SIGNAL(updateAvailableFound(bool)));
63
64
    QTRY_COMPARE(spy.count(), 0);
66
67
 
67
68
    Update *update = getUpdate();
68
69
 
 
70
    manager.setCheckSystemUpdates(true);
69
71
    manager.registerSystemUpdate(update->getPackageName(), update);
70
72
    QTRY_COMPARE(spy.count(), 1);
71
73
    QTRY_COMPARE(spy2.count(), 1);
102
104
void UpdateManagerTest::testStartDownload()
103
105
{
104
106
    UpdateManager manager;
 
107
    manager.setCheckSystemUpdates(true);
105
108
    Update *update = getUpdate();
106
109
    manager.registerSystemUpdate(update->getPackageName(), update);
107
110
    manager.startDownload(update->getPackageName());
111
114
void UpdateManagerTest::testPauseDownload()
112
115
{
113
116
    UpdateManager manager;
 
117
    manager.setCheckSystemUpdates(true);
114
118
    Update *update = getUpdate();
115
119
    manager.registerSystemUpdate(update->getPackageName(), update);
116
120
    update->setUpdateState(true);
123
127
    UpdateManager manager;
124
128
    QSignalSpy spy(&manager, SIGNAL(modelChanged()));
125
129
    QTRY_COMPARE(manager.get_apps().size(), 0);
126
 
    manager.checkUpdates();
 
130
    manager.getService().getCredentials();
127
131
    QTRY_COMPARE(manager.get_apps().size(), 4);
128
132
    QTRY_COMPARE(manager.get_model().size(), 1);
129
133
    Update* app = manager.get_model()[0].value<Update*>();
137
141
    UpdateManager manager;
138
142
    QSignalSpy spy(&manager, SIGNAL(updateAvailableFound(bool)));
139
143
    QTRY_COMPARE(manager.get_apps().size(), 0);
140
 
    manager.checkUpdates();
 
144
    manager.getService().getCredentials();
141
145
    QTRY_COMPARE(manager.get_apps().size(), 4);
142
146
    QTRY_COMPARE(manager.get_model().size(), 1);
143
147
    Update* app = manager.get_model()[0].value<Update*>();