~ci-train-bot/ubuntu-system-settings-online-accounts/ubuntu-system-settings-online-accounts-ubuntu-zesty-2407

« back to all changes in this revision

Viewing changes to tests/client/tst_client.cpp

  • Committer: Tarmac
  • Author(s): Alberto Mardegan
  • Date: 2014-01-31 17:24:40 UTC
  • mfrom: (94.1.1 client-app-access)
  • Revision ID: tarmac-20140131172440-9emykfmek41c6cc0
Define access request API for applications.

Approved by Alexandre Abreu, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
{
37
37
    Q_OBJECT
38
38
    Q_CLASSINFO("D-Bus Interface",
39
 
                "com.canonical.OnlineAccountsUi")
 
39
                "com.ubuntu.OnlineAccountsUi")
40
40
 
41
41
public:
42
42
    Service(): QObject() {}
66
66
    void testExec();
67
67
    void testExecWithProvider();
68
68
    void testExecWithServiceType();
 
69
    void testExecWithApplication();
69
70
    void testWindowId();
70
71
 
71
72
private:
89
90
{
90
91
    Setup setup;
91
92
 
 
93
    QCOMPARE(setup.applicationId(), QString());
92
94
    QCOMPARE(setup.providerId(), QString());
93
95
    QCOMPARE(setup.serviceTypeId(), QString());
94
96
 
 
97
    setup.setApplicationId("hi!");
 
98
    QCOMPARE(setup.applicationId(), QString("hi!"));
 
99
 
95
100
    setup.setProviderId("ciao");
96
101
    QCOMPARE(setup.providerId(), QString("ciao"));
97
102
 
107
112
    setup.exec();
108
113
 
109
114
    QVERIFY(finished.wait(10000));
 
115
    QCOMPARE(options().contains(OAU_KEY_APPLICATION), false);
110
116
    QCOMPARE(options().contains(OAU_KEY_PROVIDER), false);
111
117
    QCOMPARE(options().contains(OAU_KEY_SERVICE_TYPE), false);
112
118
    QCOMPARE(options().contains(OAU_KEY_WINDOW_ID), false);
138
144
             QStringLiteral("e-mail"));
139
145
}
140
146
 
 
147
void SetupTest::testExecWithApplication()
 
148
{
 
149
    Setup setup;
 
150
    setup.setApplicationId("MyApp");
 
151
 
 
152
    QSignalSpy finished(&setup, SIGNAL(finished()));
 
153
    setup.exec();
 
154
 
 
155
    QVERIFY(finished.wait(10000));
 
156
    QCOMPARE(options().value(OAU_KEY_APPLICATION).toString(),
 
157
             QStringLiteral("MyApp"));
 
158
}
 
159
 
141
160
void SetupTest::testWindowId()
142
161
{
143
162
    Setup setup;