author | hgs |
Mon, 04 Oct 2010 16:06:10 +0300 | |
changeset 76 | cfea66083b62 |
parent 65 | 2a5d4ab426d3 |
child 78 | baacf668fe89 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
50 | 18 |
#include <xqsettingsmanager.h> |
19 |
#include <xqsysinfo.h> |
|
37 | 20 |
#include <gsmerror.h> |
21 |
#include <exterror.h> |
|
22 |
#include <etelmm.h> |
|
23 |
#include <btsapdomainpskeys.h> |
|
50 | 24 |
#include "ut_cpplugincommon.h" |
37 | 25 |
#include "cpplugincommon.h" |
50 | 26 |
#include "qtestmains60.h" |
37 | 27 |
|
28 |
/*! |
|
29 |
UT_CpPluginCommon::UT_CpPluginCommon |
|
30 |
*/ |
|
31 |
UT_CpPluginCommon::UT_CpPluginCommon() |
|
32 |
: mWrapper(NULL) |
|
33 |
{ |
|
34 |
} |
|
35 |
||
36 |
/*! |
|
37 |
UT_CpPluginCommon::~UT_CpPluginCommon |
|
38 |
*/ |
|
39 |
UT_CpPluginCommon::~UT_CpPluginCommon() |
|
40 |
{ |
|
41 |
delete mWrapper; |
|
42 |
} |
|
43 |
||
44 |
/*! |
|
45 |
UT_CpPluginCommon::init |
|
46 |
*/ |
|
47 |
void UT_CpPluginCommon::init() |
|
48 |
{ |
|
49 |
initialize(); |
|
50 |
||
76 | 51 |
mWrapper = new SettingsWrapper(); |
37 | 52 |
} |
53 |
||
54 |
/*! |
|
55 |
UT_CpPluginCommon::cleanup |
|
56 |
*/ |
|
57 |
void UT_CpPluginCommon::cleanup() |
|
58 |
{ |
|
59 |
reset(); |
|
60 |
||
61 |
delete mWrapper; |
|
62 |
mWrapper = NULL; |
|
63 |
} |
|
64 |
||
65 |
/*! |
|
66 |
UT_CpPluginCommon::t_memleak |
|
67 |
*/ |
|
68 |
void UT_CpPluginCommon::t_memleak() |
|
69 |
{ |
|
70 |
||
71 |
} |
|
72 |
||
73 |
/*! |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
74 |
UT_CpPluginCommon::t_showCallDuration |
37 | 75 |
*/ |
76 |
void UT_CpPluginCommon::t_showCallDuration() |
|
77 |
{ |
|
60 | 78 |
EXPECT(XQSettingsManager, readItemValue). |
37 | 79 |
returns(QVariant(23324)); |
80 |
||
81 |
mWrapper->showCallDuration(); |
|
82 |
QVERIFY(verify()); |
|
83 |
} |
|
84 |
||
85 |
/*! |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
86 |
UT_CpPluginCommon::t_setShowCallDuration |
37 | 87 |
*/ |
88 |
void UT_CpPluginCommon::t_setShowCallDuration() |
|
89 |
{ |
|
90 |
mWrapper->setShowCallDuration(true); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
91 |
mWrapper->setShowCallDuration(false); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
92 |
QVERIFY(verify()); |
37 | 93 |
} |
94 |
||
95 |
/*! |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
96 |
UT_CpPluginCommon::t_readSoftRejectText |
37 | 97 |
*/ |
98 |
void UT_CpPluginCommon::t_readSoftRejectText() |
|
99 |
{ |
|
100 |
QString text=""; |
|
101 |
bool userDefined=true; |
|
60 | 102 |
EXPECT(XQSettingsManager, readItemValue). |
37 | 103 |
returns(QVariant(true)); |
104 |
||
60 | 105 |
EXPECT(XQSettingsManager, readItemValue). |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
106 |
returns(QVariant("text")); |
37 | 107 |
|
108 |
mWrapper->readSoftRejectText(text, userDefined); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
109 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
110 |
userDefined=false; |
60 | 111 |
EXPECT(XQSettingsManager, readItemValue). |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
112 |
returns(QVariant(false)); |
60 | 113 |
EXPECT(XQSettingsManager, readItemValue). |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
114 |
returns(QVariant("text")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
115 |
mWrapper->readSoftRejectText(text, userDefined); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
116 |
|
37 | 117 |
QVERIFY(verify()); |
118 |
} |
|
119 |
||
120 |
/*! |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
121 |
UT_CpPluginCommon::t_writeSoftRejectText |
37 | 122 |
*/ |
123 |
void UT_CpPluginCommon::t_writeSoftRejectText() |
|
124 |
{ |
|
125 |
QString text=""; |
|
126 |
bool userDefined=true; |
|
127 |
mWrapper->writeSoftRejectText(text, userDefined); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
128 |
userDefined=false; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
129 |
mWrapper->writeSoftRejectText(text, userDefined); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
130 |
QVERIFY(verify()); |
37 | 131 |
} |
132 |
||
133 |
/*! |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
134 |
UT_CpPluginCommon::t_numberGroupingSupported |
37 | 135 |
*/ |
136 |
void UT_CpPluginCommon::t_numberGroupingSupported() |
|
137 |
{ |
|
60 | 138 |
EXPECT(XQSettingsManager, readItemValue). |
37 | 139 |
returns(QVariant(true)); |
140 |
||
141 |
mWrapper->numberGroupingSupported(); |
|
142 |
QVERIFY(verify()); |
|
143 |
} |
|
144 |
||
145 |
/*! |
|
146 |
UT_CpPluginCommon::t_voipSupported |
|
147 |
*/ |
|
148 |
||
149 |
void UT_CpPluginCommon::t_voipSupported() |
|
150 |
{ |
|
60 | 151 |
EXPECT(XQSysInfo, isSupported).with( |
37 | 152 |
KFeatureIdCommonVoip).returns(false); |
153 |
QCOMPARE( Tools::voipSupported(), false ); |
|
60 | 154 |
EXPECT(XQSysInfo, isSupported).with( |
37 | 155 |
KFeatureIdCommonVoip).returns(true); |
156 |
QCOMPARE( Tools::voipSupported(), true ); |
|
157 |
||
158 |
QVERIFY( verify() ); |
|
159 |
} |
|
160 |
||
161 |
/*! |
|
162 |
UT_CpPluginCommon::t_videoSupported |
|
163 |
*/ |
|
164 |
void UT_CpPluginCommon::t_videoSupported() |
|
165 |
{ |
|
60 | 166 |
EXPECT(XQSysInfo, isSupported).with( |
37 | 167 |
KFeatureIdCsVideoTelephony).returns(true); |
168 |
QCOMPARE( Tools::videoSupported(), true ); |
|
60 | 169 |
EXPECT(XQSysInfo, isSupported).with( |
37 | 170 |
KFeatureIdCsVideoTelephony).returns(false); |
171 |
QCOMPARE( Tools::videoSupported(), false ); |
|
172 |
||
173 |
QVERIFY( verify() ); |
|
174 |
} |
|
175 |
||
176 |
/*! |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
177 |
UT_CpPluginCommon::t_readVtVideoSending |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
178 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
179 |
void UT_CpPluginCommon::t_readVtVideoSending() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
180 |
{ |
60 | 181 |
EXPECT(XQSettingsManager, readItemValue). |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
182 |
returns(QVariant(1)); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
183 |
mWrapper->readVtVideoSending(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
184 |
QVERIFY( verify() ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
185 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
186 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
187 |
/*! |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
188 |
UT_CpPluginCommon::t_writeVtVideoSending |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
189 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
190 |
void UT_CpPluginCommon::t_writeVtVideoSending() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
191 |
{ |
60 | 192 |
EXPECT(XQSettingsManager, writeItemValue);//. |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
193 |
//times(2); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
194 |
int i=0; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
195 |
mWrapper->writeVtVideoSending(i); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
196 |
QVERIFY( verify() ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
197 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
198 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
199 |
/*! |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
200 |
UT_CpPluginCommon::t_isFeatureCallWaitingDistiquishNotProvisionedEnabled |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
201 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
202 |
void UT_CpPluginCommon::t_isFeatureCallWaitingDistiquishNotProvisionedEnabled() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
203 |
{ |
60 | 204 |
EXPECT(XQSettingsManager, readItemValue). |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
205 |
returns(QVariant(1)); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
206 |
mWrapper->isFeatureCallWaitingDistiquishNotProvisionedEnabled(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
207 |
QVERIFY( verify() ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
208 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
209 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
210 |
/*! |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
211 |
UT_CpPluginCommon::t_isPhoneOffline |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
212 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
213 |
void UT_CpPluginCommon::t_isPhoneOffline() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
214 |
{ |
60 | 215 |
EXPECT(XQSettingsManager, readItemValue). |
216 |
returns(QVariant(1)); |
|
217 |
mWrapper->isPhoneOffline(); |
|
218 |
||
50 | 219 |
QVERIFY(verify()); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
220 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
221 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
222 |
/*! |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
223 |
UT_CpPluginCommon::t_isOngoingCall |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
224 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
225 |
void UT_CpPluginCommon::t_isOngoingCall() |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
226 |
{ |
60 | 227 |
EXPECT(XQSettingsManager, readItemValue). |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
228 |
returns(QVariant(1)); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
229 |
mWrapper->isOngoingCall(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
230 |
QVERIFY( verify() ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
231 |
} |
37 | 232 |
|
233 |
QTEST_MAIN_S60(UT_CpPluginCommon) |