~canonical-platform-qa/ubuntu-system-settings-online-accounts/launch_fixture

« back to all changes in this revision

Viewing changes to tests/online-accounts-ui/tst_service.cpp

  • Committer: CI bot
  • Author(s): Alberto Mardegan
  • Date: 2014-05-30 13:30:01 UTC
  • mfrom: (107.1.13 master)
  • Revision ID: ps-jenkins@lists.canonical.com-20140530133001-an9lfy1dc1pfkifd
Release development branch

Features landing with this branch:
- Updating the ACL when applications are enabled/disabled in System Settings
- Write profile information in the XML files installed by click hooks
- Run tests with Python 3 autopilot.
- Merge signon-ui into online-accounts-ui 

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "globals.h"
22
22
#include "request.h"
 
23
#include "request-manager.h"
23
24
#include "service.h"
24
25
#include "window-watcher.h"
25
26
 
160
161
    void onNewConnection(const QDBusConnection &connection);
161
162
 
162
163
private:
 
164
    RequestManager m_requestManager;
163
165
    Service m_service;
164
166
    QDBusConnection m_connection;
165
167
};
231
233
 
232
234
void ServiceTest::testIdle()
233
235
{
234
 
    QCOMPARE(m_service.isIdle(), true);
 
236
    QCOMPARE(m_requestManager.isIdle(), true);
235
237
 
236
 
    QSignalSpy isIdleChanged(&m_service, SIGNAL(isIdleChanged()));
 
238
    QSignalSpy isIdleChanged(&m_requestManager, SIGNAL(isIdleChanged()));
237
239
 
238
240
    QVariantMap parameters;
239
241
    parameters.insert(keyTimeout, 10);
241
243
    QSignalSpy callFinished(call, SIGNAL(finished()));
242
244
 
243
245
    QVERIFY(isIdleChanged.wait());
244
 
    QCOMPARE(m_service.isIdle(), false);
 
246
    QCOMPARE(m_requestManager.isIdle(), false);
245
247
 
246
248
    /* the request will terminate after 10 milliseconds, so expect the service
247
249
     * to be idle again */
248
250
    QVERIFY(isIdleChanged.wait());
249
 
    QCOMPARE(m_service.isIdle(), true);
 
251
    QCOMPARE(m_requestManager.isIdle(), true);
250
252
 
251
253
    QVERIFY(callFinished.wait());
252
254
    QCOMPARE(call->isError(), false);