|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Test step definitions for the BroadcastMessaging functional unit. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @internalTechnology |
|
20 */ |
|
21 |
|
22 #include "cctsyintegrationtestbroadcastmessaging.h" |
|
23 #include "listretrievalhelpers.h" |
|
24 |
|
25 |
|
26 |
|
27 CCTSYIntegrationTestBroadcastMessagingBase::CCTSYIntegrationTestBroadcastMessagingBase(CEtelSessionMgr& aEtelSessionMgr) |
|
28 : CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iBroadcastMessagingTestHelper(*this), iNetworkTestHelper(*this) |
|
29 /** |
|
30 * Constructor |
|
31 */ |
|
32 { |
|
33 } |
|
34 |
|
35 CCTSYIntegrationTestBroadcastMessagingBase::~CCTSYIntegrationTestBroadcastMessagingBase() |
|
36 /* |
|
37 * Destructor |
|
38 */ |
|
39 { |
|
40 } |
|
41 |
|
42 |
|
43 CCTSYIntegrationTestBroadcastMessaging0001::CCTSYIntegrationTestBroadcastMessaging0001(CEtelSessionMgr& aEtelSessionMgr) |
|
44 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
45 /** |
|
46 * Constructor. |
|
47 */ |
|
48 { |
|
49 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0001::GetTestStepName()); |
|
50 } |
|
51 |
|
52 CCTSYIntegrationTestBroadcastMessaging0001::~CCTSYIntegrationTestBroadcastMessaging0001() |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 { |
|
57 } |
|
58 |
|
59 TBool CCTSYIntegrationTestBroadcastMessagingBase::AssertValidBroadcastMessage(const RMobileBroadcastMessaging::TMobileBroadcastAttributesV2 &aBraodcastAttributes) |
|
60 /* |
|
61 * This function checks the validity of received Broadcastmessage |
|
62 * |
|
63 * @param aBraodcastAttributes Reference to attributes of received messages. |
|
64 * @return true if the received message is not valid. |
|
65 */ |
|
66 { |
|
67 TBool ret=EFalse; |
|
68 |
|
69 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgAttributes.iFlags in set of KBroadcastDataFormat |
|
70 ASSERT_BITS_SET(aBraodcastAttributes.iFlags, RMobileBroadcastMessaging::KBroadcastDataFormat ,KNoUnwantedBits, _L("RMobileBroadcastMessaging::ReceiveMessage did not return desired Message Flags")); |
|
71 |
|
72 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgAttributes.iFormat of EFormatGsmTpdu |
|
73 ASSERT_EQUALS(aBraodcastAttributes.iFormat, RMobileBroadcastMessaging::EFormatGsmTpdu, _L("RMobileBroadcastMessaging::ReceiveMessage did not return desired Message Format")); |
|
74 |
|
75 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgAttributes.iDCS > 0 |
|
76 ASSERT_TRUE(aBraodcastAttributes.iDCS > 0, _L("RMobileBroadcastMessaging::ReceiveMessage did not return DCS > 0")); |
|
77 |
|
78 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgAttributes.iMessageId > 0 |
|
79 ASSERT_TRUE(aBraodcastAttributes.iMessageId> 0, _L("RMobileBroadcastMessaging::ReceiveMessage did not return MessageId > 0")); |
|
80 |
|
81 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgAttributes.iMessageType of EGsmBroadcastId |
|
82 ASSERT_EQUALS((int)aBraodcastAttributes.iMessageType , (int)RMobileBroadcastMessaging::EGsmBroadcastId, _L("RMobileBroadcastMessaging::ReceiveMessage did not return desired MessageType")); |
|
83 |
|
84 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgAttributes.iNumberOfPages > 0 |
|
85 ASSERT_TRUE(aBraodcastAttributes.iNumberOfPages > 0, _L("RMobileBroadcastMessaging::ReceiveMessage did not return NumberOfPages > 0")); |
|
86 |
|
87 if((aBraodcastAttributes.iFlags && RMobileBroadcastMessaging::KBroadcastDataFormat) |
|
88 && (aBraodcastAttributes.iFormat== RMobileBroadcastMessaging::EFormatGsmTpdu) |
|
89 && (aBraodcastAttributes.iDCS>0) && (aBraodcastAttributes.iMessageId> 0) |
|
90 && ((int)aBraodcastAttributes.iMessageType ==(int)RMobileBroadcastMessaging::EGsmBroadcastId) |
|
91 && (aBraodcastAttributes.iNumberOfPages > 0) ) |
|
92 { |
|
93 ret= ETrue; |
|
94 } |
|
95 |
|
96 return ret; |
|
97 } |
|
98 |
|
99 TVerdict CCTSYIntegrationTestBroadcastMessaging0001::doTestStepL() |
|
100 /** |
|
101 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0001 |
|
102 * @SYMFssID BA/CTSY/BRMSG-0001 |
|
103 * @SYMTestCaseDesc Set the broadcast messaging simple filter. |
|
104 * @SYMTestPriority High |
|
105 * @SYMTestActions RMobileBroadcastMessaging::NotifyFilterSettingChange,RMobileBroadcastMessaging::GetFilterSetting, RMobileBroadcastMessaging::SetFilterSetting |
|
106 * @SYMTestExpectedResults Pass - Simple filter notifications complete and are set correctly. |
|
107 * @SYMTestType CIT |
|
108 * @SYMTestCaseDependencies live/automatic |
|
109 * |
|
110 * Reason for test: Verify filter change notification completes and correct filter has been set. |
|
111 * |
|
112 * @return - TVerdict code |
|
113 */ |
|
114 { |
|
115 |
|
116 // |
|
117 // SET UP |
|
118 // |
|
119 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
120 |
|
121 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging) ; |
|
122 |
|
123 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iFilterCaps in set of KCapsSimpleFilter |
|
124 RMobileBroadcastMessaging::TMobileBroadcastCapsV1 caps; |
|
125 RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg capPkg(caps); |
|
126 TUint32 expectedCaps = RMobileBroadcastMessaging::KCapsSimpleFilter; |
|
127 |
|
128 CHECK_EQUALS_L(broadcastMessaging.GetCaps(capPkg), KErrNone, _L("RMobileBroadcastMessaging::GetCaps returned with an error")); |
|
129 CHECK_BITS_SET_L(caps.iFilterCaps,expectedCaps ,KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Filter caps")); |
|
130 |
|
131 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iModeCaps in set of KCapsGsmTpduFormat |
|
132 CHECK_BITS_SET_L(caps.iModeCaps, RMobileBroadcastMessaging::KCapsGsmTpduFormat, KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Mode caps")); |
|
133 |
|
134 // Registered with the network |
|
135 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
136 CHECK_EQUALS_L(ret, KErrNone, |
|
137 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
138 |
|
139 |
|
140 // |
|
141 // SET UP END |
|
142 // |
|
143 |
|
144 StartTest(); |
|
145 |
|
146 // |
|
147 // TEST START |
|
148 // |
|
149 |
|
150 // === Set the simple filter setting to accept none === |
|
151 |
|
152 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
153 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting; |
|
154 TExtEtelRequestStatus notifyFilterSettingChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyFilterSettingChange); |
|
155 CleanupStack::PushL(notifyFilterSettingChangeStatus); |
|
156 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
157 |
|
158 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptNone |
|
159 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting1 = RMobileBroadcastMessaging::EBroadcastAcceptNone; |
|
160 TExtEtelRequestStatus setFilterSettingStatus(broadcastMessaging, EMobileBroadcastMessagingSetFilterSetting); |
|
161 CleanupStack::PushL(setFilterSettingStatus); |
|
162 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
163 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
164 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
165 |
|
166 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptNone |
|
167 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
168 broadcastMessaging, |
|
169 notifyFilterSettingChangeStatus, |
|
170 filterSetting, |
|
171 filterSetting1, |
|
172 KErrNone ); |
|
173 |
|
174 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptNone |
|
175 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSettingObtained; |
|
176 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
177 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptNone, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
178 |
|
179 // === Set the simple filter setting to accept all === |
|
180 |
|
181 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
182 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
183 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10026); |
|
184 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10027); |
|
185 CHECK_EQUALS_L(1, 2, _L("This test has been made to leave intentially.The purpose of this leave is to avoid the board crashing")); |
|
186 |
|
187 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptAll |
|
188 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting2 = RMobileBroadcastMessaging::EBroadcastAcceptAll; |
|
189 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting2); |
|
190 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
191 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
192 |
|
193 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptAll |
|
194 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
195 broadcastMessaging, |
|
196 notifyFilterSettingChangeStatus, |
|
197 filterSetting, |
|
198 filterSetting2, |
|
199 KErrNone ); |
|
200 |
|
201 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptAll |
|
202 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
203 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptAll, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptAll")) |
|
204 |
|
205 // |
|
206 // TEST END |
|
207 // |
|
208 |
|
209 StartCleanup(); |
|
210 |
|
211 // Pop: |
|
212 // notifyFilterSettingChangeStatus |
|
213 // setFilterSettingStatus |
|
214 CleanupStack::PopAndDestroy(2,¬ifyFilterSettingChangeStatus); |
|
215 |
|
216 return TestStepResult(); |
|
217 } |
|
218 |
|
219 TPtrC CCTSYIntegrationTestBroadcastMessaging0001::GetTestStepName() |
|
220 /** |
|
221 * @return The test step name. |
|
222 */ |
|
223 { |
|
224 return _L("CCTSYIntegrationTestBroadcastMessaging0001"); |
|
225 } |
|
226 |
|
227 |
|
228 |
|
229 CCTSYIntegrationTestBroadcastMessaging0002::CCTSYIntegrationTestBroadcastMessaging0002(CEtelSessionMgr& aEtelSessionMgr) |
|
230 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
231 /** |
|
232 * Constructor. |
|
233 */ |
|
234 { |
|
235 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0002::GetTestStepName()); |
|
236 } |
|
237 |
|
238 CCTSYIntegrationTestBroadcastMessaging0002::~CCTSYIntegrationTestBroadcastMessaging0002() |
|
239 /** |
|
240 * Destructor. |
|
241 */ |
|
242 { |
|
243 } |
|
244 |
|
245 TVerdict CCTSYIntegrationTestBroadcastMessaging0002::doTestStepL() |
|
246 /** |
|
247 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0002 |
|
248 * @SYMFssID BA/CTSY/BRMSG-0002 |
|
249 * @SYMTestCaseDesc Set the broadcast messaging ID filter |
|
250 * @SYMTestPriority High |
|
251 * @SYMTestActions CRetrieveMobilePhoneBroadcastIdList::Start, RMobileBroadcastMessaging::NotifyFilterSettingChange, CRetrieveMobilePhoneBroadcastIdList::RetrieveListL, RMobileBroadcastMessaging::GetFilterSetting, RMobileBroadcastMessaging::SetFilterSetting, CMobilePhoneBroadcastIdList::Enumerate, RMobileBroadcastMessaging::NotifyBroadcastIdListChange, RMobileBroadcastMessaging::StoreBroadcastIdListL, CMobilePhoneBroadcastIdList::AddRangeEntryL |
|
252 * @SYMTestExpectedResults Pass - Filter setting and notification returned KErrNotSuppoerted and no value can be retrieved . |
|
253 * @SYMTestType CIT |
|
254 * @SYMTestCaseDependencies live/automatic |
|
255 * |
|
256 * Reason for test: Verify filter change notification completes with KErrNotSupported and no filter has been set. |
|
257 * |
|
258 * @return - TVerdict code |
|
259 */ |
|
260 { |
|
261 |
|
262 // |
|
263 // SET UP |
|
264 // |
|
265 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
266 |
|
267 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging) ; |
|
268 |
|
269 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iModeCaps in set of KCapsGsmTpduFormat |
|
270 RMobileBroadcastMessaging::TMobileBroadcastCapsV1 caps; |
|
271 RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg capPkg(caps); |
|
272 CHECK_EQUALS_L(broadcastMessaging.GetCaps(capPkg), KErrNone, _L("RMobileBroadcastMessaging::GetCaps returned with an error")); |
|
273 CHECK_BITS_SET_L(caps.iModeCaps, RMobileBroadcastMessaging::KCapsGsmTpduFormat, KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Mode caps")); |
|
274 |
|
275 // Registered with the network |
|
276 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
277 CHECK_EQUALS_L(ret, KErrNone, |
|
278 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
279 |
|
280 // |
|
281 // SET UP END |
|
282 // |
|
283 |
|
284 StartTest(); |
|
285 |
|
286 // |
|
287 // TEST START |
|
288 // |
|
289 |
|
290 // === Set broadcast ID filter === |
|
291 |
|
292 // Create a CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
293 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
294 CleanupStack::PushL(broadcastIdList); |
|
295 |
|
296 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=100 |
|
297 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry; |
|
298 idEntry.iId = 1; |
|
299 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry2; |
|
300 idEntry2.iId = 100; |
|
301 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
302 |
|
303 // Post a notification RMobileBroadcastMessaging::NotifyBroadcastIdListChange |
|
304 TExtEtelRequestStatus notifyBroadcastIdListChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyIdListChange); |
|
305 CleanupStack::PushL(notifyBroadcastIdListChangeStatus); |
|
306 broadcastMessaging.NotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus); |
|
307 |
|
308 // This is deliberate action to open a session because the API in Etelmm allocates memory |
|
309 // The Session Manager should be used in all other places. |
|
310 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
311 RMobileBroadcastMessaging broadcastMessagingStore; |
|
312 broadcastMessagingStore.Open(phone); |
|
313 |
|
314 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with KErrNotSupported having aIdType=EGsmBroadcastId |
|
315 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
316 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
317 CleanupStack::PushL(storeBroadcastIdList); |
|
318 broadcastMessagingStore.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
319 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
320 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
321 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d </font>"), 10028); |
|
322 broadcastMessagingStore.Close(); |
|
323 |
|
324 // Check RMobileBroadcastMessaging::NotifyBroadcastIdListChange completes with KErrNotSupported |
|
325 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus, KErrNotSupported); |
|
326 |
|
327 // === Get the broadcast ID filter === |
|
328 |
|
329 // Use helper class for CRetrieveMobilePhoneBroadcastIdList to retrieve the broadcast ID list. |
|
330 TInt err; |
|
331 CRetrieveMobilePhoneBroadcastIdListExec* broadcastIdListExec = CRetrieveMobilePhoneBroadcastIdListHelper::NewL(broadcastMessaging,idType); |
|
332 CleanupStack::PushL(broadcastIdListExec); |
|
333 |
|
334 // Get the CMobilePhoneBroadcastIdList list using the helper class function which will call CRetrieveMobilePhoneBroadcastIdList::RetrieveListL |
|
335 CMobilePhoneBroadcastIdList* broadcastIdList2 = broadcastIdListExec ->DoGetList(err); |
|
336 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneBroadcastIdList::RetrieveListL is not able to get the list")) |
|
337 |
|
338 // Check CMobilePhoneBroadcastIdList::Enumerate returns 0 |
|
339 ASSERT_EQUALS(broadcastIdList2->Enumerate(),0 , _L("CMobilePhoneBroadcastIdList::Enumerate did not return an 99 as expected")); |
|
340 |
|
341 // |
|
342 // TEST END |
|
343 // |
|
344 |
|
345 StartCleanup(); |
|
346 |
|
347 // Pop: |
|
348 // broadcastIdList |
|
349 // notifyBroadcastIdListChangeStatus |
|
350 // storeBroadcastIdList |
|
351 // broadcastIdListExec |
|
352 CleanupStack::PopAndDestroy(4, broadcastIdList); |
|
353 |
|
354 return TestStepResult(); |
|
355 } |
|
356 |
|
357 TPtrC CCTSYIntegrationTestBroadcastMessaging0002::GetTestStepName() |
|
358 /** |
|
359 * @return The test step name. |
|
360 */ |
|
361 { |
|
362 return _L("CCTSYIntegrationTestBroadcastMessaging0002"); |
|
363 } |
|
364 |
|
365 |
|
366 |
|
367 CCTSYIntegrationTestBroadcastMessaging0003::CCTSYIntegrationTestBroadcastMessaging0003(CEtelSessionMgr& aEtelSessionMgr) |
|
368 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
369 /** |
|
370 * Constructor. |
|
371 */ |
|
372 { |
|
373 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0003::GetTestStepName()); |
|
374 } |
|
375 |
|
376 CCTSYIntegrationTestBroadcastMessaging0003::~CCTSYIntegrationTestBroadcastMessaging0003() |
|
377 /** |
|
378 * Destructor. |
|
379 */ |
|
380 { |
|
381 } |
|
382 |
|
383 TVerdict CCTSYIntegrationTestBroadcastMessaging0003::doTestStepL() |
|
384 /** |
|
385 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0003 |
|
386 * @SYMFssID BA/CTSY/BRMSG-0003 |
|
387 * @SYMTestCaseDesc Receive cell broadcast with different filter settings. |
|
388 * @SYMTestPriority High |
|
389 * @SYMTestActions RMobileBroadcastMessaging::NotifyFilterSettingChange, RMobileBroadcastMessaging::SetLanguageFilter, RMobileBroadcastMessaging::GetFilterSetting, RMobileBroadcastMessaging::SetFilterSetting, RMobileBroadcastMessaging::GetLanguageFilter, RMobileBroadcastMessaging::ReceiveMessage |
|
390 * @SYMTestExpectedResults Pass - Broadcast messages that should not be filtered received. Messages that should be filtered not received. |
|
391 * @SYMTestType CIT |
|
392 * @SYMTestCaseDependencies simulated/manual |
|
393 * |
|
394 * Reason for test: Verify cell broadcast message is received. |
|
395 * |
|
396 * @return - TVerdict code |
|
397 */ |
|
398 { |
|
399 |
|
400 // |
|
401 // SET UP |
|
402 // |
|
403 |
|
404 ERR_PRINTF2(_L("<font color=Orange>$CTSYProblem: defect id = %d</font>"), 10072); |
|
405 User::Leave(KErrNone); |
|
406 |
|
407 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
408 |
|
409 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging) ; |
|
410 |
|
411 |
|
412 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iFilterCaps in set of KCapsSimpleFilter |
|
413 RMobileBroadcastMessaging::TMobileBroadcastCapsV1 caps; |
|
414 RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg capPkg(caps); |
|
415 TUint32 expectedCaps = RMobileBroadcastMessaging::KCapsSimpleFilter; |
|
416 |
|
417 CHECK_EQUALS_L(broadcastMessaging.GetCaps(capPkg), KErrNone, _L("RMobileBroadcastMessaging::GetCaps returned with an error")); |
|
418 CHECK_BITS_SET_L(caps.iFilterCaps,expectedCaps ,KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Filter caps")); |
|
419 |
|
420 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iModeCaps in set of KCapsGsmTpduFormat |
|
421 CHECK_BITS_SET_L(caps.iModeCaps, RMobileBroadcastMessaging::KCapsGsmTpduFormat, KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Mode caps")); |
|
422 |
|
423 // Registered with the network |
|
424 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
425 CHECK_EQUALS_L(ret, KErrNone, |
|
426 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 // |
|
432 // SET UP END |
|
433 // |
|
434 |
|
435 StartTest(); |
|
436 |
|
437 // |
|
438 // TEST START |
|
439 // |
|
440 |
|
441 // === Set the simple filter setting to accept all and receive a message === |
|
442 |
|
443 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
444 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting; |
|
445 TExtEtelRequestStatus notifyFilterSettingChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyFilterSettingChange); |
|
446 CleanupStack::PushL(notifyFilterSettingChangeStatus); |
|
447 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
448 |
|
449 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptAll |
|
450 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting1 = RMobileBroadcastMessaging::EBroadcastAcceptAll; |
|
451 TExtEtelRequestStatus setFilterSettingStatus(broadcastMessaging, EMobileBroadcastMessagingSetFilterSetting); |
|
452 CleanupStack::PushL(setFilterSettingStatus); |
|
453 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
454 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
455 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
456 |
|
457 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptAll |
|
458 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
459 broadcastMessaging, |
|
460 notifyFilterSettingChangeStatus, |
|
461 filterSetting, |
|
462 filterSetting1, |
|
463 KErrNone ); |
|
464 |
|
465 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptAll |
|
466 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSettingObtained; |
|
467 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
468 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptAll, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
469 |
|
470 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
471 RMobileBroadcastMessaging::TGsmBroadcastMessageData rxMsgData; |
|
472 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2 rxMsgAttributes; |
|
473 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg rxMsgAttributePackage(rxMsgAttributes); |
|
474 TExtEtelRequestStatus receiveMessageStatus(broadcastMessaging, EMobileBroadcastMessagingReceiveMessage); |
|
475 CleanupStack::PushL(receiveMessageStatus); |
|
476 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
477 |
|
478 // Simulated network sends a GSM formatted broadcast message. |
|
479 TBuf<120> prompt(_L("Waiting for the CBM, notification of a directly delivered cell broadcast message from the network operator")); |
|
480 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
481 |
|
482 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
483 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
484 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
485 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
486 |
|
487 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
488 |
|
489 // === Set the simple filter setting to accept none and receive a message === |
|
490 |
|
491 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
492 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
493 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10027); |
|
494 CHECK_EQUALS_L(1, 2, _L("This test has been made to leave intentially. The purpose of this leave is to avoid the board crashing")); |
|
495 |
|
496 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptNone |
|
497 filterSetting1 = RMobileBroadcastMessaging::EBroadcastAcceptNone; |
|
498 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
499 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
500 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
501 |
|
502 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptNone |
|
503 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
504 broadcastMessaging, |
|
505 notifyFilterSettingChangeStatus, |
|
506 filterSetting, |
|
507 filterSetting1, |
|
508 KErrNone ); |
|
509 |
|
510 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptNone |
|
511 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
512 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptNone, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
513 |
|
514 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
515 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
516 |
|
517 // Simulated network sends a GSM formatted broadcast message. |
|
518 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
519 |
|
520 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
521 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
522 |
|
523 // |
|
524 // TEST END |
|
525 // |
|
526 |
|
527 StartCleanup(); |
|
528 |
|
529 // Pop: |
|
530 // notifyFilterSettingChangeStatus |
|
531 // setFilterSettingStatus |
|
532 // receiveMessageStatus |
|
533 |
|
534 CleanupStack::PopAndDestroy(3,¬ifyFilterSettingChangeStatus); |
|
535 |
|
536 return TestStepResult(); |
|
537 } |
|
538 |
|
539 TPtrC CCTSYIntegrationTestBroadcastMessaging0003::GetTestStepName() |
|
540 /** |
|
541 * @return The test step name. |
|
542 */ |
|
543 { |
|
544 return _L("CCTSYIntegrationTestBroadcastMessaging0003"); |
|
545 } |
|
546 |
|
547 |
|
548 |
|
549 CCTSYIntegrationTestBroadcastMessaging0004::CCTSYIntegrationTestBroadcastMessaging0004(CEtelSessionMgr& aEtelSessionMgr) |
|
550 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
551 /** |
|
552 * Constructor. |
|
553 */ |
|
554 { |
|
555 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0004::GetTestStepName()); |
|
556 } |
|
557 |
|
558 CCTSYIntegrationTestBroadcastMessaging0004::~CCTSYIntegrationTestBroadcastMessaging0004() |
|
559 /** |
|
560 * Destructor. |
|
561 */ |
|
562 { |
|
563 } |
|
564 |
|
565 TVerdict CCTSYIntegrationTestBroadcastMessaging0004::doTestStepL() |
|
566 /** |
|
567 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0004 |
|
568 * @SYMFssID BA/CTSY/BRMSG-0004 |
|
569 * @SYMTestCaseDesc Receive broadcast messages when ID filter has been defined but filter is set to accept all messages. |
|
570 * @SYMTestPriority High |
|
571 * @SYMTestActions RMobileBroadcastMessaging::GetFilterSetting, RMobileBroadcastMessaging::SetFilterSetting, RMobileBroadcastMessaging::ReceiveMessage, RMobileBroadcastMessaging::NotifyBroadcastIdListChange, RMobileBroadcastMessaging::StoreBroadcastIdListL, CMobilePhoneBroadcastIdList::AddRangeEntryL |
|
572 * @SYMTestExpectedResults Pass - All broadcast messages received when filter is set to accept all. |
|
573 * @SYMTestType CIT |
|
574 * @SYMTestCaseDependencies simulated/manual |
|
575 * |
|
576 * Reason for test: Verify all messages received. |
|
577 * |
|
578 * @return - TVerdict code |
|
579 */ |
|
580 { |
|
581 |
|
582 // |
|
583 // SET UP |
|
584 // |
|
585 |
|
586 |
|
587 ERR_PRINTF2(_L("<font color=Orange>$CTSYProblem: defect id = %d</font>"), 10073); |
|
588 User::Leave(KErrNone); |
|
589 |
|
590 |
|
591 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
592 |
|
593 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging) ; |
|
594 |
|
595 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iFilterCaps in set of KCapsSimpleFilter |
|
596 RMobileBroadcastMessaging::TMobileBroadcastCapsV1 caps; |
|
597 RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg capPkg(caps); |
|
598 TUint32 expectedCaps = RMobileBroadcastMessaging::KCapsSimpleFilter; |
|
599 |
|
600 CHECK_EQUALS_L(broadcastMessaging.GetCaps(capPkg), KErrNone, _L("RMobileBroadcastMessaging::GetCaps returned with an error")); |
|
601 CHECK_BITS_SET_L(caps.iFilterCaps,expectedCaps ,KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Filter caps")); |
|
602 |
|
603 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iModeCaps in set of KCapsGsmTpduFormat |
|
604 CHECK_BITS_SET_L(caps.iModeCaps, RMobileBroadcastMessaging::KCapsGsmTpduFormat, KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Mode caps")); |
|
605 |
|
606 // Registered with the network |
|
607 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
608 CHECK_EQUALS_L(ret, KErrNone, |
|
609 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
610 |
|
611 // |
|
612 // SET UP END |
|
613 // |
|
614 |
|
615 StartTest(); |
|
616 |
|
617 // |
|
618 // TEST START |
|
619 // |
|
620 |
|
621 |
|
622 // === Set broadcast ID filter === |
|
623 |
|
624 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
625 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
626 CleanupStack::PushL(broadcastIdList); |
|
627 |
|
628 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=100 |
|
629 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry; |
|
630 idEntry.iId = 1; |
|
631 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry2; |
|
632 idEntry2.iId = 100; |
|
633 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
634 |
|
635 // Post a notification RMobileBroadcastMessaging::NotifyBroadcastIdListChange |
|
636 TExtEtelRequestStatus notifyBroadcastIdListChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyIdListChange); |
|
637 CleanupStack::PushL(notifyBroadcastIdListChangeStatus); |
|
638 broadcastMessaging.NotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus); |
|
639 |
|
640 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
641 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
642 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
643 CleanupStack::PushL(storeBroadcastIdList); |
|
644 broadcastMessaging.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
645 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
646 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
647 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
648 |
|
649 // Check RMobileBroadcastMessaging::NotifyBroadcastIdListChange completes with KRequestPending |
|
650 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus, KRequestPending ); |
|
651 |
|
652 // === Set filter to accept all messages and receive a message within and out of the ID range === |
|
653 |
|
654 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
655 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting; |
|
656 TExtEtelRequestStatus notifyFilterSettingChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyFilterSettingChange); |
|
657 CleanupStack::PushL(notifyFilterSettingChangeStatus); |
|
658 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
659 |
|
660 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptAll |
|
661 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting1 = RMobileBroadcastMessaging::EBroadcastAcceptAll; |
|
662 TExtEtelRequestStatus setFilterSettingStatus(broadcastMessaging, EMobileBroadcastMessagingSetFilterSetting); |
|
663 CleanupStack::PushL(setFilterSettingStatus); |
|
664 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
665 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
666 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
667 |
|
668 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptAll |
|
669 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
670 broadcastMessaging, |
|
671 notifyFilterSettingChangeStatus, |
|
672 filterSetting, |
|
673 filterSetting1, |
|
674 KErrNone ); |
|
675 |
|
676 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptAll |
|
677 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSettingObtained; |
|
678 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
679 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptAll, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
680 |
|
681 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
682 RMobileBroadcastMessaging::TGsmBroadcastMessageData rxMsgData; |
|
683 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2 rxMsgAttributes; |
|
684 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg rxMsgAttributePackage(rxMsgAttributes); |
|
685 TExtEtelRequestStatus receiveMessageStatus(broadcastMessaging, EMobileBroadcastMessagingReceiveMessage); |
|
686 CleanupStack::PushL(receiveMessageStatus); |
|
687 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
688 |
|
689 // Simulator sends a broadcast message with an ID = 1 |
|
690 TBuf<110> prompt(_L("Waiting for the CBM, notification of a directly delivered cell broadcast message from the network operator")); |
|
691 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
692 |
|
693 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
694 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
695 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
696 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
697 |
|
698 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
699 |
|
700 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
701 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
702 |
|
703 // Simulator sends a broadcast message with an ID = 50 |
|
704 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
705 |
|
706 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
707 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
708 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
709 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
710 |
|
711 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
712 |
|
713 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
714 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
715 |
|
716 // Simulator sends a broadcast message with an ID = 99 |
|
717 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
718 |
|
719 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
720 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
721 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
722 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
723 |
|
724 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
725 // === Should also receive messages outside of the range === |
|
726 |
|
727 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
728 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
729 |
|
730 // Simulator sends a broadcast message with an ID = 100. |
|
731 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
732 |
|
733 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
734 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
735 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
736 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
737 |
|
738 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
739 |
|
740 // |
|
741 // TEST END |
|
742 // |
|
743 |
|
744 StartCleanup(); |
|
745 |
|
746 // Pop: |
|
747 // broadcastIdList |
|
748 // notifyBroadcastIdListChangeStatus |
|
749 // storeBroadcastIdList |
|
750 // notifyFilterSettingChangeStatus |
|
751 // setFilterSettingStatus |
|
752 // receiveMessageStatus |
|
753 CleanupStack::PopAndDestroy(6,broadcastIdList); |
|
754 |
|
755 return TestStepResult(); |
|
756 } |
|
757 |
|
758 TPtrC CCTSYIntegrationTestBroadcastMessaging0004::GetTestStepName() |
|
759 /** |
|
760 * @return The test step name. |
|
761 */ |
|
762 { |
|
763 return _L("CCTSYIntegrationTestBroadcastMessaging0004"); |
|
764 } |
|
765 |
|
766 |
|
767 |
|
768 CCTSYIntegrationTestBroadcastMessaging0005::CCTSYIntegrationTestBroadcastMessaging0005(CEtelSessionMgr& aEtelSessionMgr) |
|
769 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
770 /** |
|
771 * Constructor. |
|
772 */ |
|
773 { |
|
774 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0005::GetTestStepName()); |
|
775 } |
|
776 |
|
777 CCTSYIntegrationTestBroadcastMessaging0005::~CCTSYIntegrationTestBroadcastMessaging0005() |
|
778 /** |
|
779 * Destructor. |
|
780 */ |
|
781 { |
|
782 } |
|
783 |
|
784 TVerdict CCTSYIntegrationTestBroadcastMessaging0005::doTestStepL() |
|
785 /** |
|
786 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0005 |
|
787 * @SYMFssID BA/CTSY/BRMSG-0005 |
|
788 * @SYMTestCaseDesc Receive broadcast messages when ID filter has been defined and filter is set to accept filter. |
|
789 * @SYMTestPriority High |
|
790 * @SYMTestActions RMobileBroadcastMessaging::GetFilterSetting, RMobileBroadcastMessaging::SetFilterSetting, RMobileBroadcastMessaging::ReceiveMessage, RMobileBroadcastMessaging::NotifyBroadcastIdListChange, RMobileBroadcastMessaging::StoreBroadcastIdListL, CMobilePhoneBroadcastIdList::AddRangeEntryL |
|
791 * @SYMTestExpectedResults Pass - Only messages within the filter range are accepted. |
|
792 * @SYMTestType CIT |
|
793 * @SYMTestCaseDependencies simulated/manual |
|
794 * |
|
795 * Reason for test: Verify messages with an ID within the filter range are accepted. |
|
796 * |
|
797 * @return - TVerdict code |
|
798 */ |
|
799 { |
|
800 |
|
801 // |
|
802 // SET UP |
|
803 // |
|
804 ERR_PRINTF2(_L("<font color=Orange>$CTSYProblem: defect id = %d</font>"), 10074); |
|
805 User::Leave(KErrNone); |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
811 |
|
812 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging) ; |
|
813 |
|
814 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iFilterCaps in set of KCapsSimpleFilter |
|
815 RMobileBroadcastMessaging::TMobileBroadcastCapsV1 caps; |
|
816 RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg capPkg(caps); |
|
817 TUint32 expectedCaps = RMobileBroadcastMessaging::KCapsSimpleFilter; |
|
818 |
|
819 CHECK_EQUALS_L(broadcastMessaging.GetCaps(capPkg), KErrNone, _L("RMobileBroadcastMessaging::GetCaps returned with an error")); |
|
820 CHECK_BITS_SET_L(caps.iFilterCaps,expectedCaps ,KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Filter caps")); |
|
821 |
|
822 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iModeCaps in set of KCapsGsmTpduFormat |
|
823 CHECK_BITS_SET_L(caps.iModeCaps, RMobileBroadcastMessaging::KCapsGsmTpduFormat, KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Mode caps")); |
|
824 |
|
825 // Registered with the network |
|
826 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
827 CHECK_EQUALS_L(ret, KErrNone, |
|
828 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
829 |
|
830 // |
|
831 // SET UP END |
|
832 // |
|
833 |
|
834 StartTest(); |
|
835 |
|
836 // |
|
837 // TEST START |
|
838 // |
|
839 |
|
840 |
|
841 // === Set broadcast ID filter === |
|
842 |
|
843 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
844 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
845 CleanupStack::PushL(broadcastIdList); |
|
846 |
|
847 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=100 |
|
848 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry; |
|
849 idEntry.iId = 1; |
|
850 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry2; |
|
851 idEntry2.iId = 100; |
|
852 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
853 |
|
854 // Post a notification RMobileBroadcastMessaging::NotifyBroadcastIdListChange |
|
855 TExtEtelRequestStatus notifyBroadcastIdListChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyIdListChange); |
|
856 CleanupStack::PushL(notifyBroadcastIdListChangeStatus); |
|
857 broadcastMessaging.NotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus); |
|
858 |
|
859 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
860 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
861 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
862 CleanupStack::PushL(storeBroadcastIdList); |
|
863 broadcastMessaging.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
864 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
865 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
866 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
867 |
|
868 // Check RMobileBroadcastMessaging::NotifyBroadcastIdListChange completes with KRequestPending |
|
869 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus, KRequestPending ); |
|
870 |
|
871 // === Set filter to accept filter settings === |
|
872 |
|
873 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
874 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting; |
|
875 TExtEtelRequestStatus notifyFilterSettingChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyFilterSettingChange); |
|
876 CleanupStack::PushL(notifyFilterSettingChangeStatus); |
|
877 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
878 |
|
879 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptFilter |
|
880 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting1 = RMobileBroadcastMessaging::EBroadcastAcceptFilter; |
|
881 TExtEtelRequestStatus setFilterSettingStatus(broadcastMessaging, EMobileBroadcastMessagingSetFilterSetting); |
|
882 CleanupStack::PushL(setFilterSettingStatus); |
|
883 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
884 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
885 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
886 |
|
887 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptFilter |
|
888 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
889 broadcastMessaging, |
|
890 notifyFilterSettingChangeStatus, |
|
891 filterSetting, |
|
892 filterSetting1, |
|
893 KErrNone ); |
|
894 |
|
895 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptFilter |
|
896 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSettingObtained; |
|
897 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
898 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptFilter, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
899 |
|
900 // === Check messages with IDs in range are received === |
|
901 |
|
902 //Call RMobileBroadcastMessaging::ReceiveMessage |
|
903 RMobileBroadcastMessaging::TGsmBroadcastMessageData rxMsgData; |
|
904 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2 rxMsgAttributes; |
|
905 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg rxMsgAttributePackage(rxMsgAttributes); |
|
906 TExtEtelRequestStatus receiveMessageStatus(broadcastMessaging, EMobileBroadcastMessagingReceiveMessage); |
|
907 CleanupStack::PushL(receiveMessageStatus); |
|
908 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
909 |
|
910 // Simulator sends a broadcast message with an ID = 1 |
|
911 TBuf<110> prompt(_L("Waiting for the CBM, notification of a directly delivered cell broadcast message from the network operator")); |
|
912 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
913 |
|
914 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
915 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
916 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
917 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
918 |
|
919 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
920 |
|
921 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
922 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
923 |
|
924 // Simulator sends a broadcast message with an ID = 50 |
|
925 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
926 |
|
927 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
928 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
929 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
930 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
931 |
|
932 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
933 |
|
934 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
935 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
936 |
|
937 // Simulator sends a broadcast message with an ID = 99 |
|
938 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
939 |
|
940 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
941 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
942 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
943 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
944 |
|
945 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
946 |
|
947 // === Check messages not in range are not received === |
|
948 |
|
949 //Call RMobileBroadcastMessaging::ReceiveMessage |
|
950 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
951 |
|
952 // Simulator sends a broadcast message with an ID = 100. |
|
953 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
954 |
|
955 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
956 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
957 |
|
958 // |
|
959 // TEST END |
|
960 // |
|
961 |
|
962 StartCleanup(); |
|
963 |
|
964 // Pop: |
|
965 // broadcastIdList |
|
966 // notifyBroadcastIdListChangeStatus |
|
967 // storeBroadcastIdList |
|
968 // notifyFilterSettingChangeStatus |
|
969 // setFilterSettingStatus |
|
970 // receiveMessageStatus |
|
971 |
|
972 CleanupStack::PopAndDestroy(6, broadcastIdList); |
|
973 |
|
974 |
|
975 return TestStepResult(); |
|
976 } |
|
977 |
|
978 TPtrC CCTSYIntegrationTestBroadcastMessaging0005::GetTestStepName() |
|
979 /** |
|
980 * @return The test step name. |
|
981 */ |
|
982 { |
|
983 return _L("CCTSYIntegrationTestBroadcastMessaging0005"); |
|
984 } |
|
985 |
|
986 |
|
987 |
|
988 CCTSYIntegrationTestBroadcastMessaging0006::CCTSYIntegrationTestBroadcastMessaging0006(CEtelSessionMgr& aEtelSessionMgr) |
|
989 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
990 /** |
|
991 * Constructor. |
|
992 */ |
|
993 { |
|
994 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0006::GetTestStepName()); |
|
995 } |
|
996 |
|
997 CCTSYIntegrationTestBroadcastMessaging0006::~CCTSYIntegrationTestBroadcastMessaging0006() |
|
998 /** |
|
999 * Destructor. |
|
1000 */ |
|
1001 { |
|
1002 } |
|
1003 |
|
1004 TVerdict CCTSYIntegrationTestBroadcastMessaging0006::doTestStepL() |
|
1005 /** |
|
1006 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0006 |
|
1007 * @SYMFssID BA/CTSY/BRMSG-0006 |
|
1008 * @SYMTestCaseDesc Receive broadcast messages when ID filter has been defined and filter is set to reject filter. |
|
1009 * @SYMTestPriority High |
|
1010 * @SYMTestActions RMobileBroadcastMessaging::GetFilterSetting, RMobileBroadcastMessaging::SetFilterSetting, RMobileBroadcastMessaging::ReceiveMessage, RMobileBroadcastMessaging::NotifyBroadcastIdListChange, RMobileBroadcastMessaging::StoreBroadcastIdListL, CMobilePhoneBroadcastIdList::AddRangeEntryL |
|
1011 * @SYMTestExpectedResults Pass - Messages within ID range are not received, messages outside of the range are received. |
|
1012 * @SYMTestType CIT |
|
1013 * @SYMTestCaseDependencies simulated/manual |
|
1014 * |
|
1015 * Reason for test: Verify messages within the ID range are not received and messages outside the range are. |
|
1016 * |
|
1017 * @return - TVerdict code |
|
1018 */ |
|
1019 { |
|
1020 |
|
1021 // |
|
1022 // SET UP |
|
1023 // |
|
1024 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1025 |
|
1026 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging) ; |
|
1027 |
|
1028 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iFilterCaps in set of KCapsSimpleFilter |
|
1029 RMobileBroadcastMessaging::TMobileBroadcastCapsV1 caps; |
|
1030 RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg capPkg(caps); |
|
1031 TUint32 expectedCaps = RMobileBroadcastMessaging::KCapsSimpleFilter; |
|
1032 |
|
1033 CHECK_EQUALS_L(broadcastMessaging.GetCaps(capPkg), KErrNone, _L("RMobileBroadcastMessaging::GetCaps returned with an error")); |
|
1034 CHECK_BITS_SET_L(caps.iFilterCaps,expectedCaps ,KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Filter caps")); |
|
1035 |
|
1036 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iModeCaps in set of KCapsGsmTpduFormat |
|
1037 CHECK_BITS_SET_L(caps.iModeCaps, RMobileBroadcastMessaging::KCapsGsmTpduFormat, KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Mode caps")); |
|
1038 |
|
1039 // Registered with the network |
|
1040 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
1041 CHECK_EQUALS_L(ret, KErrNone, |
|
1042 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
1043 |
|
1044 // |
|
1045 // SET UP END |
|
1046 // |
|
1047 |
|
1048 StartTest(); |
|
1049 |
|
1050 // |
|
1051 // TEST START |
|
1052 // |
|
1053 |
|
1054 |
|
1055 // === Set broadcast ID filter === |
|
1056 |
|
1057 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
1058 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
1059 CleanupStack::PushL(broadcastIdList); |
|
1060 |
|
1061 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=100 |
|
1062 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry; |
|
1063 idEntry.iId = 1; |
|
1064 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry2; |
|
1065 idEntry2.iId = 100; |
|
1066 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
1067 |
|
1068 // Post a notification RMobileBroadcastMessaging::NotifyBroadcastIdListChange |
|
1069 TExtEtelRequestStatus notifyBroadcastIdListChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyIdListChange); |
|
1070 CleanupStack::PushL(notifyBroadcastIdListChangeStatus); |
|
1071 broadcastMessaging.NotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus); |
|
1072 |
|
1073 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
1074 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
1075 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
1076 CleanupStack::PushL(storeBroadcastIdList); |
|
1077 broadcastMessaging.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
1078 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
1079 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
1080 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
1081 |
|
1082 // Check RMobileBroadcastMessaging::NotifyBroadcastIdListChange completes with KRequestPending |
|
1083 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus, KRequestPending ); |
|
1084 |
|
1085 // === Set filter to reject filter settings === |
|
1086 |
|
1087 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
1088 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting; |
|
1089 TExtEtelRequestStatus notifyFilterSettingChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyFilterSettingChange); |
|
1090 CleanupStack::PushL(notifyFilterSettingChangeStatus); |
|
1091 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
1092 |
|
1093 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastRejectFilter |
|
1094 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting1 = RMobileBroadcastMessaging::EBroadcastRejectFilter; |
|
1095 TExtEtelRequestStatus setFilterSettingStatus(broadcastMessaging, EMobileBroadcastMessagingSetFilterSetting); |
|
1096 CleanupStack::PushL(setFilterSettingStatus); |
|
1097 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
1098 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
1099 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
1100 |
|
1101 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastRejectFilter |
|
1102 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
1103 broadcastMessaging, |
|
1104 notifyFilterSettingChangeStatus, |
|
1105 filterSetting, |
|
1106 filterSetting1, |
|
1107 KErrNone ); |
|
1108 |
|
1109 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastRejectFilter |
|
1110 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSettingObtained; |
|
1111 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
1112 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastRejectFilter, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
1113 |
|
1114 // === Check messages with IDs in range are not received === |
|
1115 |
|
1116 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1117 RMobileBroadcastMessaging::TGsmBroadcastMessageData rxMsgData; |
|
1118 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2 rxMsgAttributes; |
|
1119 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg rxMsgAttributePackage(rxMsgAttributes); |
|
1120 TExtEtelRequestStatus receiveMessageStatus(broadcastMessaging, EMobileBroadcastMessagingReceiveMessage); |
|
1121 CleanupStack::PushL(receiveMessageStatus); |
|
1122 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1123 |
|
1124 // Simulator sends a broadcast message with an ID = 1 |
|
1125 TBuf<110> prompt(_L("Waiting for the CBM, notification of a directly delivered cell broadcast message from the network operator")); |
|
1126 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1127 |
|
1128 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
1129 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
1130 |
|
1131 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1132 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1133 |
|
1134 // Simulator sends a broadcast message with an ID = 50 |
|
1135 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1136 |
|
1137 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
1138 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
1139 |
|
1140 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1141 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1142 |
|
1143 // Simulator sends a broadcast message with an ID = 99 |
|
1144 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1145 |
|
1146 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
1147 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
1148 |
|
1149 // === Check messages not in range are received === |
|
1150 |
|
1151 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1152 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1153 |
|
1154 // Simulator sends a broadcast message with an ID = 100. |
|
1155 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1156 |
|
1157 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
1158 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
1159 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
1160 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
1161 |
|
1162 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
1163 |
|
1164 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1165 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1166 |
|
1167 // Simulator sends a broadcast message with an ID = 0. |
|
1168 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1169 |
|
1170 // Check RMobileBroadcastMessaging::ReceiveMessage completes with aMsgData with length > 0 characters |
|
1171 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage timed out")); |
|
1172 ASSERT_EQUALS(receiveMessageStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::ReceiveMessage returned with an error")); |
|
1173 ASSERT_TRUE(rxMsgData.Length()>0, _L("RMobileBroadcastMessaging::ReceiveMessage did not complete with aMsgData with length > 0 characters")); |
|
1174 |
|
1175 ASSERT_TRUE(AssertValidBroadcastMessage(rxMsgAttributes), _L("AssertValidBroadcastMessage returned with failure")); |
|
1176 |
|
1177 // |
|
1178 // TEST END |
|
1179 // |
|
1180 |
|
1181 StartCleanup(); |
|
1182 |
|
1183 // Pop: |
|
1184 // broadcastIdList |
|
1185 // notifyBroadcastIdListChangeStatus |
|
1186 // storeBroadcastIdList |
|
1187 // notifyFilterSettingChangeStatus |
|
1188 // setFilterSettingStatus |
|
1189 // receiveMessageStatus |
|
1190 CleanupStack::PopAndDestroy(6,broadcastIdList); |
|
1191 |
|
1192 return TestStepResult(); |
|
1193 } |
|
1194 |
|
1195 TPtrC CCTSYIntegrationTestBroadcastMessaging0006::GetTestStepName() |
|
1196 /** |
|
1197 * @return The test step name. |
|
1198 */ |
|
1199 { |
|
1200 return _L("CCTSYIntegrationTestBroadcastMessaging0006"); |
|
1201 } |
|
1202 |
|
1203 |
|
1204 |
|
1205 CCTSYIntegrationTestBroadcastMessaging0007::CCTSYIntegrationTestBroadcastMessaging0007(CEtelSessionMgr& aEtelSessionMgr) |
|
1206 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
1207 /** |
|
1208 * Constructor. |
|
1209 */ |
|
1210 { |
|
1211 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0007::GetTestStepName()); |
|
1212 } |
|
1213 |
|
1214 CCTSYIntegrationTestBroadcastMessaging0007::~CCTSYIntegrationTestBroadcastMessaging0007() |
|
1215 /** |
|
1216 * Destructor. |
|
1217 */ |
|
1218 { |
|
1219 } |
|
1220 |
|
1221 TVerdict CCTSYIntegrationTestBroadcastMessaging0007::doTestStepL() |
|
1222 /** |
|
1223 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0007 |
|
1224 * @SYMFssID BA/CTSY/BRMSG-0007 |
|
1225 * @SYMTestCaseDesc Receive broadcast messages when ID filter has been defined and fliter is set to reject all messages. |
|
1226 * @SYMTestPriority High |
|
1227 * @SYMTestActions RMobileBroadcastMessaging::GetFilterSetting, RMobileBroadcastMessaging::SetFilterSetting, RMobileBroadcastMessaging::ReceiveMessage, RMobileBroadcastMessaging::NotifyBroadcastIdListChange, RMobileBroadcastMessaging::StoreBroadcastIdListL, CMobilePhoneBroadcastIdList::AddRangeEntryL |
|
1228 * @SYMTestExpectedResults Pass - No messages received. |
|
1229 * @SYMTestType CIT |
|
1230 * @SYMTestCaseDependencies simulated/manual |
|
1231 * |
|
1232 * Reason for test: Verify no messages are received. |
|
1233 * |
|
1234 * @return - TVerdict code |
|
1235 */ |
|
1236 { |
|
1237 |
|
1238 // |
|
1239 // SET UP |
|
1240 // |
|
1241 |
|
1242 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1243 |
|
1244 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging) ; |
|
1245 |
|
1246 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iFilterCaps in set of KCapsSimpleFilter |
|
1247 RMobileBroadcastMessaging::TMobileBroadcastCapsV1 caps; |
|
1248 RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg capPkg(caps); |
|
1249 TUint32 expectedCaps = RMobileBroadcastMessaging::KCapsSimpleFilter; |
|
1250 |
|
1251 CHECK_EQUALS_L(broadcastMessaging.GetCaps(capPkg), KErrNone, _L("RMobileBroadcastMessaging::GetCaps returned with an error")); |
|
1252 CHECK_BITS_SET_L(caps.iFilterCaps,expectedCaps ,KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Filter caps")); |
|
1253 |
|
1254 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iModeCaps in set of KCapsGsmTpduFormat |
|
1255 CHECK_BITS_SET_L(caps.iModeCaps, RMobileBroadcastMessaging::KCapsGsmTpduFormat, KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Mode caps")); |
|
1256 |
|
1257 // Registered with the network |
|
1258 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
1259 CHECK_EQUALS_L(ret, KErrNone, |
|
1260 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
1261 |
|
1262 // |
|
1263 // SET UP END |
|
1264 // |
|
1265 |
|
1266 StartTest(); |
|
1267 |
|
1268 // |
|
1269 // TEST START |
|
1270 // |
|
1271 |
|
1272 // === Set broadcast ID filter === |
|
1273 |
|
1274 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
1275 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
1276 CleanupStack::PushL(broadcastIdList); |
|
1277 |
|
1278 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=100 |
|
1279 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry; |
|
1280 idEntry.iId = 1; |
|
1281 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry2; |
|
1282 idEntry2.iId = 100; |
|
1283 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
1284 |
|
1285 // Post a notification RMobileBroadcastMessaging::NotifyBroadcastIdListChange |
|
1286 TExtEtelRequestStatus notifyBroadcastIdListChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyIdListChange); |
|
1287 CleanupStack::PushL(notifyBroadcastIdListChangeStatus); |
|
1288 broadcastMessaging.NotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus); |
|
1289 |
|
1290 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
1291 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
1292 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
1293 CleanupStack::PushL(storeBroadcastIdList); |
|
1294 broadcastMessaging.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
1295 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
1296 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
1297 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
1298 |
|
1299 // Check RMobileBroadcastMessaging::NotifyBroadcastIdListChange completes with KRequestPending |
|
1300 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus, KRequestPending ); |
|
1301 |
|
1302 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
1303 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting; |
|
1304 TExtEtelRequestStatus notifyFilterSettingChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyFilterSettingChange); |
|
1305 CleanupStack::PushL(notifyFilterSettingChangeStatus); |
|
1306 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
1307 |
|
1308 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptNone |
|
1309 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting1 = RMobileBroadcastMessaging::EBroadcastAcceptNone; |
|
1310 TExtEtelRequestStatus setFilterSettingStatus(broadcastMessaging, EMobileBroadcastMessagingSetFilterSetting); |
|
1311 CleanupStack::PushL(setFilterSettingStatus); |
|
1312 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
1313 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
1314 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
1315 |
|
1316 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptNone |
|
1317 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
1318 broadcastMessaging, |
|
1319 notifyFilterSettingChangeStatus, |
|
1320 filterSetting, |
|
1321 filterSetting1, |
|
1322 KErrNone ); |
|
1323 |
|
1324 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptNone |
|
1325 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSettingObtained; |
|
1326 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
1327 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptNone, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
1328 |
|
1329 // === Check messages with IDs in range are not received === |
|
1330 |
|
1331 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1332 RMobileBroadcastMessaging::TGsmBroadcastMessageData rxMsgData; |
|
1333 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2 rxMsgAttributes; |
|
1334 RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg rxMsgAttributePackage(rxMsgAttributes); |
|
1335 TExtEtelRequestStatus receiveMessageStatus(broadcastMessaging, EMobileBroadcastMessagingReceiveMessage); |
|
1336 CleanupStack::PushL(receiveMessageStatus); |
|
1337 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1338 |
|
1339 // Simulator sends a broadcast message with an ID = 1 |
|
1340 TBuf<110> prompt(_L("Waiting for the CBM, notification of a directly delivered cell broadcast message from the network operator")); |
|
1341 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1342 |
|
1343 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
1344 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
1345 |
|
1346 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1347 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1348 |
|
1349 // Simulator sends a broadcast message with an ID = 50 |
|
1350 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1351 |
|
1352 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
1353 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
1354 |
|
1355 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1356 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1357 |
|
1358 // Simulator sends a broadcast message with an ID = 99 |
|
1359 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1360 |
|
1361 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
1362 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
1363 |
|
1364 |
|
1365 // === Check messages not in range are not received === |
|
1366 |
|
1367 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1368 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1369 |
|
1370 // Simulator sends a broadcast message with an ID = 100. |
|
1371 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1372 |
|
1373 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
1374 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
1375 |
|
1376 // Call RMobileBroadcastMessaging::ReceiveMessage |
|
1377 broadcastMessaging.ReceiveMessage(receiveMessageStatus, rxMsgData, rxMsgAttributePackage); |
|
1378 |
|
1379 // Simulator sends a broadcast message with an ID = 0. |
|
1380 DisplayUserInteractionPromptL(prompt); // 30 seconds |
|
1381 |
|
1382 // Check RMobileBroadcastMessaging::ReceiveMessage is still pending 2 minutes after the message was sent |
|
1383 ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveMessageStatus, ETimeVeryLong),KErrTimedOut, _L("RMobileBroadcastMessaging::ReceiveMessage did not pend 2 mins after the message was sent")); |
|
1384 |
|
1385 |
|
1386 // |
|
1387 // TEST END |
|
1388 // |
|
1389 |
|
1390 StartCleanup(); |
|
1391 |
|
1392 // Pop: |
|
1393 // broadcastIdList |
|
1394 // notifyBroadcastIdListChangeStatus |
|
1395 // storeBroadcastIdList |
|
1396 // notifyFilterSettingChangeStatus |
|
1397 // setFilterSettingStatus |
|
1398 // receiveMessageStatus |
|
1399 CleanupStack::PopAndDestroy(6,broadcastIdList); |
|
1400 |
|
1401 |
|
1402 return TestStepResult(); |
|
1403 } |
|
1404 |
|
1405 TPtrC CCTSYIntegrationTestBroadcastMessaging0007::GetTestStepName() |
|
1406 /** |
|
1407 * @return The test step name. |
|
1408 */ |
|
1409 { |
|
1410 return _L("CCTSYIntegrationTestBroadcastMessaging0007"); |
|
1411 } |
|
1412 |
|
1413 |
|
1414 |
|
1415 CCTSYIntegrationTestBroadcastMessaging0008::CCTSYIntegrationTestBroadcastMessaging0008(CEtelSessionMgr& aEtelSessionMgr) |
|
1416 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
1417 /** |
|
1418 * Constructor. |
|
1419 */ |
|
1420 { |
|
1421 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0008::GetTestStepName()); |
|
1422 } |
|
1423 |
|
1424 CCTSYIntegrationTestBroadcastMessaging0008::~CCTSYIntegrationTestBroadcastMessaging0008() |
|
1425 /** |
|
1426 * Destructor. |
|
1427 */ |
|
1428 { |
|
1429 } |
|
1430 |
|
1431 TVerdict CCTSYIntegrationTestBroadcastMessaging0008::doTestStepL() |
|
1432 /** |
|
1433 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0008 |
|
1434 * @SYMFssID BA/CTSY/BRMSG-0008 |
|
1435 * @SYMTestCaseDesc Store a broadcast ID list with no IDs |
|
1436 * @SYMTestPriority High |
|
1437 * @SYMTestActions RMobileBroadcastMessaging::StoreBroadcastIdListL |
|
1438 * @SYMTestExpectedResults Pass - No entry is stored. |
|
1439 * @SYMTestType CIT |
|
1440 * @SYMTestCaseDependencies live/automatic |
|
1441 * |
|
1442 * Reason for test: Verify list returns KErrNotSupported when stored. |
|
1443 * |
|
1444 * @return - TVerdict code |
|
1445 */ |
|
1446 { |
|
1447 |
|
1448 // |
|
1449 // SET UP |
|
1450 // |
|
1451 |
|
1452 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging); |
|
1453 |
|
1454 // |
|
1455 // SET UP END |
|
1456 // |
|
1457 |
|
1458 StartTest(); |
|
1459 |
|
1460 // |
|
1461 // TEST START |
|
1462 // |
|
1463 |
|
1464 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
1465 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
1466 CleanupStack::PushL(broadcastIdList); |
|
1467 |
|
1468 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
1469 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
1470 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
1471 CleanupStack::PushL(storeBroadcastIdList); |
|
1472 broadcastMessaging.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
1473 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
1474 |
|
1475 // Check RMobileBroadcastMessaging::StoreBroadcastIdListL returns KErrNotSupported |
|
1476 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
1477 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
1478 |
|
1479 // |
|
1480 // TEST END |
|
1481 // |
|
1482 |
|
1483 StartCleanup(); |
|
1484 |
|
1485 // Put any required test clean up here, then remove this comment |
|
1486 // Pop: |
|
1487 // broadcastIdList |
|
1488 // storeBroadcastIdList |
|
1489 |
|
1490 CleanupStack::PopAndDestroy(2,broadcastIdList); |
|
1491 return TestStepResult(); |
|
1492 } |
|
1493 |
|
1494 TPtrC CCTSYIntegrationTestBroadcastMessaging0008::GetTestStepName() |
|
1495 /** |
|
1496 * @return The test step name. |
|
1497 */ |
|
1498 { |
|
1499 return _L("CCTSYIntegrationTestBroadcastMessaging0008"); |
|
1500 } |
|
1501 |
|
1502 |
|
1503 |
|
1504 CCTSYIntegrationTestBroadcastMessaging0009::CCTSYIntegrationTestBroadcastMessaging0009(CEtelSessionMgr& aEtelSessionMgr) |
|
1505 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
1506 /** |
|
1507 * Constructor. |
|
1508 */ |
|
1509 { |
|
1510 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0009::GetTestStepName()); |
|
1511 } |
|
1512 |
|
1513 CCTSYIntegrationTestBroadcastMessaging0009::~CCTSYIntegrationTestBroadcastMessaging0009() |
|
1514 /** |
|
1515 * Destructor. |
|
1516 */ |
|
1517 { |
|
1518 } |
|
1519 |
|
1520 TVerdict CCTSYIntegrationTestBroadcastMessaging0009::doTestStepL() |
|
1521 /** |
|
1522 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0009 |
|
1523 * @SYMFssID BA/CTSY/BRMSG-0009 |
|
1524 * @SYMTestCaseDesc Store 999 IDs with broadcast ID list |
|
1525 * @SYMTestPriority High |
|
1526 * @SYMTestActions RMobileBroadcastMessaging::StoreBroadcastIdListL |
|
1527 * @SYMTestExpectedResults Pass - List is not stored. |
|
1528 * @SYMTestType CIT |
|
1529 * @SYMTestCaseDependencies live/automatic |
|
1530 * |
|
1531 * Reason for test: Verify list can not be stored. |
|
1532 * |
|
1533 * @return - TVerdict code |
|
1534 */ |
|
1535 { |
|
1536 |
|
1537 // |
|
1538 // SET UP |
|
1539 // |
|
1540 |
|
1541 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging); |
|
1542 |
|
1543 // |
|
1544 // SET UP END |
|
1545 // |
|
1546 |
|
1547 StartTest(); |
|
1548 |
|
1549 // |
|
1550 // TEST START |
|
1551 // |
|
1552 |
|
1553 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
1554 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
1555 CleanupStack::PushL(broadcastIdList); |
|
1556 |
|
1557 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=1000 |
|
1558 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry; |
|
1559 idEntry.iId = 1; |
|
1560 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry2; |
|
1561 idEntry2.iId = 1000; |
|
1562 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
1563 |
|
1564 // Post a notification RMobileBroadcastMessaging::NotifyBroadcastIdListChange |
|
1565 TExtEtelRequestStatus notifyBroadcastIdListChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyIdListChange); |
|
1566 CleanupStack::PushL(notifyBroadcastIdListChangeStatus); |
|
1567 broadcastMessaging.NotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus); |
|
1568 |
|
1569 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
1570 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
1571 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
1572 CleanupStack::PushL(storeBroadcastIdList); |
|
1573 broadcastMessaging.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
1574 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
1575 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
1576 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
1577 |
|
1578 // Check RMobileBroadcastMessaging::NotifyBroadcastIdListChange completes with KErrNotSupported |
|
1579 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus, KErrNotSupported); |
|
1580 |
|
1581 // |
|
1582 // TEST END |
|
1583 // |
|
1584 |
|
1585 StartCleanup(); |
|
1586 |
|
1587 // Pop: |
|
1588 // broadcastIdList |
|
1589 // notifyBroadcastIdListChangeStatus |
|
1590 // storeBroadcastIdList |
|
1591 |
|
1592 CleanupStack::PopAndDestroy(3,broadcastIdList); |
|
1593 |
|
1594 return TestStepResult(); |
|
1595 } |
|
1596 |
|
1597 TPtrC CCTSYIntegrationTestBroadcastMessaging0009::GetTestStepName() |
|
1598 /** |
|
1599 * @return The test step name. |
|
1600 */ |
|
1601 { |
|
1602 return _L("CCTSYIntegrationTestBroadcastMessaging0009"); |
|
1603 } |
|
1604 |
|
1605 |
|
1606 |
|
1607 CCTSYIntegrationTestBroadcastMessaging0010::CCTSYIntegrationTestBroadcastMessaging0010(CEtelSessionMgr& aEtelSessionMgr) |
|
1608 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
1609 /** |
|
1610 * Constructor. |
|
1611 */ |
|
1612 { |
|
1613 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0010::GetTestStepName()); |
|
1614 } |
|
1615 |
|
1616 CCTSYIntegrationTestBroadcastMessaging0010::~CCTSYIntegrationTestBroadcastMessaging0010() |
|
1617 /** |
|
1618 * Destructor. |
|
1619 */ |
|
1620 { |
|
1621 } |
|
1622 |
|
1623 TVerdict CCTSYIntegrationTestBroadcastMessaging0010::doTestStepL() |
|
1624 /** |
|
1625 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0010 |
|
1626 * @SYMFssID BA/CTSY/BRMSG-0010 |
|
1627 * @SYMTestCaseDesc Store maximum number of broadcast IDs for the phone. |
|
1628 * @SYMTestPriority High |
|
1629 * @SYMTestActions RMobileBroadcastMessaging::StoreBroadcastIdListL |
|
1630 * @SYMTestExpectedResults Pass - List is stored. |
|
1631 * @SYMTestType CIT |
|
1632 * @SYMTestCaseDependencies live/automatic |
|
1633 * |
|
1634 * Reason for test: Verify list can be stored. |
|
1635 * |
|
1636 * @return - TVerdict code |
|
1637 */ |
|
1638 { |
|
1639 |
|
1640 // |
|
1641 // SET UP |
|
1642 // |
|
1643 |
|
1644 |
|
1645 |
|
1646 // |
|
1647 // SET UP END |
|
1648 // |
|
1649 |
|
1650 StartTest(); |
|
1651 |
|
1652 // |
|
1653 // TEST START |
|
1654 // |
|
1655 |
|
1656 |
|
1657 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
1658 |
|
1659 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=X where X=maximum number of entries supported |
|
1660 |
|
1661 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
1662 |
|
1663 // Check RMobileBroadcastMessaging::NotifyBroadcastIdListChange completes with KErrNone |
|
1664 |
|
1665 |
|
1666 // |
|
1667 // TEST END |
|
1668 // |
|
1669 |
|
1670 StartCleanup(); |
|
1671 |
|
1672 // Put any required test clean up here, then remove this comment |
|
1673 |
|
1674 return TestStepResult(); |
|
1675 } |
|
1676 |
|
1677 TPtrC CCTSYIntegrationTestBroadcastMessaging0010::GetTestStepName() |
|
1678 /** |
|
1679 * @return The test step name. |
|
1680 */ |
|
1681 { |
|
1682 return _L("CCTSYIntegrationTestBroadcastMessaging0010"); |
|
1683 } |
|
1684 |
|
1685 |
|
1686 |
|
1687 CCTSYIntegrationTestBroadcastMessaging0011::CCTSYIntegrationTestBroadcastMessaging0011(CEtelSessionMgr& aEtelSessionMgr) |
|
1688 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
1689 /** |
|
1690 * Constructor. |
|
1691 */ |
|
1692 { |
|
1693 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0011::GetTestStepName()); |
|
1694 } |
|
1695 |
|
1696 CCTSYIntegrationTestBroadcastMessaging0011::~CCTSYIntegrationTestBroadcastMessaging0011() |
|
1697 /** |
|
1698 * Destructor. |
|
1699 */ |
|
1700 { |
|
1701 } |
|
1702 |
|
1703 TVerdict CCTSYIntegrationTestBroadcastMessaging0011::doTestStepL() |
|
1704 /** |
|
1705 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0011 |
|
1706 * @SYMFssID BA/CTSY/BRMSG-0011 |
|
1707 * @SYMTestCaseDesc Store broadcast ID list with duplicate IDs |
|
1708 * @SYMTestPriority High |
|
1709 * @SYMTestActions RMobileBroadcastMessaging::StoreBroadcastIdListL |
|
1710 * @SYMTestExpectedResults Pass - List is not stored. |
|
1711 * @SYMTestType CIT |
|
1712 * @SYMTestCaseDependencies live/automatic |
|
1713 * |
|
1714 * Reason for test: Verify list can not be stored. |
|
1715 * |
|
1716 * @return - TVerdict code |
|
1717 */ |
|
1718 { |
|
1719 |
|
1720 // |
|
1721 // SET UP |
|
1722 // |
|
1723 |
|
1724 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging); |
|
1725 |
|
1726 // |
|
1727 // SET UP END |
|
1728 // |
|
1729 |
|
1730 StartTest(); |
|
1731 |
|
1732 // |
|
1733 // TEST START |
|
1734 // |
|
1735 |
|
1736 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
1737 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
1738 CleanupStack::PushL(broadcastIdList); |
|
1739 |
|
1740 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=3 |
|
1741 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry; |
|
1742 idEntry.iId = 1; |
|
1743 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry2; |
|
1744 idEntry2.iId = 3; |
|
1745 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
1746 |
|
1747 // Add another entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=3 |
|
1748 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
1749 |
|
1750 // Post a notification RMobileBroadcastMessaging::NotifyBroadcastIdListChange |
|
1751 TExtEtelRequestStatus notifyBroadcastIdListChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyIdListChange); |
|
1752 CleanupStack::PushL(notifyBroadcastIdListChangeStatus); |
|
1753 broadcastMessaging.NotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus); |
|
1754 |
|
1755 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
1756 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
1757 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
1758 CleanupStack::PushL(storeBroadcastIdList); |
|
1759 broadcastMessaging.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
1760 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
1761 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
1762 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
1763 |
|
1764 // Check RMobileBroadcastMessaging::NotifyBroadcastIdListChange completes with KErrNotSupported |
|
1765 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyBroadcastIdListChange(notifyBroadcastIdListChangeStatus, KErrNotSupported); |
|
1766 |
|
1767 // |
|
1768 // TEST END |
|
1769 // |
|
1770 |
|
1771 StartCleanup(); |
|
1772 |
|
1773 // Pop: |
|
1774 // broadcastIdList |
|
1775 // notifyBroadcastIdListChangeStatus |
|
1776 // storeBroadcastIdList |
|
1777 CleanupStack::PopAndDestroy(3, broadcastIdList); |
|
1778 |
|
1779 return TestStepResult(); |
|
1780 } |
|
1781 |
|
1782 TPtrC CCTSYIntegrationTestBroadcastMessaging0011::GetTestStepName() |
|
1783 /** |
|
1784 * @return The test step name. |
|
1785 */ |
|
1786 { |
|
1787 return _L("CCTSYIntegrationTestBroadcastMessaging0011"); |
|
1788 } |
|
1789 |
|
1790 |
|
1791 |
|
1792 CCTSYIntegrationTestBroadcastMessaging0012::CCTSYIntegrationTestBroadcastMessaging0012(CEtelSessionMgr& aEtelSessionMgr) |
|
1793 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
1794 /** |
|
1795 * Constructor. |
|
1796 */ |
|
1797 { |
|
1798 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0012::GetTestStepName()); |
|
1799 } |
|
1800 |
|
1801 CCTSYIntegrationTestBroadcastMessaging0012::~CCTSYIntegrationTestBroadcastMessaging0012() |
|
1802 /** |
|
1803 * Destructor. |
|
1804 */ |
|
1805 { |
|
1806 } |
|
1807 |
|
1808 TVerdict CCTSYIntegrationTestBroadcastMessaging0012::doTestStepL() |
|
1809 /** |
|
1810 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0012 |
|
1811 * @SYMFssID BA/CTSY/BRMSG-0012 |
|
1812 * @SYMTestCaseDesc Store and retrieve broadcast ID list. |
|
1813 * @SYMTestPriority High |
|
1814 * @SYMTestActions |
|
1815 * @SYMTestExpectedResults Pass - List retrieved is empty. |
|
1816 * @SYMTestType CIT |
|
1817 * @SYMTestCaseDependencies live/automatic |
|
1818 * |
|
1819 * Reason for test: Verify store returned KErrNotSupported and retrieved an empty list. |
|
1820 * |
|
1821 * @return - TVerdict code |
|
1822 */ |
|
1823 { |
|
1824 |
|
1825 // |
|
1826 // SET UP |
|
1827 // |
|
1828 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1829 |
|
1830 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging); |
|
1831 |
|
1832 // Registered with the network |
|
1833 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
1834 CHECK_EQUALS_L(ret, KErrNone, |
|
1835 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
1836 |
|
1837 // |
|
1838 // SET UP END |
|
1839 // |
|
1840 |
|
1841 StartTest(); |
|
1842 |
|
1843 // |
|
1844 // TEST START |
|
1845 // |
|
1846 |
|
1847 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
1848 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
1849 CleanupStack::PushL(broadcastIdList); |
|
1850 |
|
1851 // Add an entry to the list with CMobilePhoneBroadcastIdList::AddRangeEntryL with aStart.iId=1 and aEnd.iId=4 |
|
1852 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry; |
|
1853 idEntry.iId = 1; |
|
1854 RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 idEntry2; |
|
1855 idEntry2.iId = 4; |
|
1856 broadcastIdList->AddRangeEntryL(idEntry, idEntry2); |
|
1857 |
|
1858 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
1859 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
1860 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
1861 CleanupStack::PushL(storeBroadcastIdList); |
|
1862 broadcastMessaging.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
1863 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
1864 |
|
1865 // Check store returned KErrNotSupported |
|
1866 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
1867 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
1868 |
|
1869 // Use Retrieval helper class to retrieve broadcast Id entries from the list |
|
1870 TInt err; |
|
1871 CRetrieveMobilePhoneBroadcastIdListExec* broadcastIdListExec = CRetrieveMobilePhoneBroadcastIdListHelper::NewL(broadcastMessaging,idType); |
|
1872 CleanupStack::PushL(broadcastIdListExec); |
|
1873 CMobilePhoneBroadcastIdList* broadcastIdList2 = broadcastIdListExec ->DoGetList(err); |
|
1874 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneBroadcastIdList::RetrieveListL is not able to get the list")) |
|
1875 |
|
1876 // Check CMobilePhoneBroadcastIdList::Enumerate returns 0 entry |
|
1877 ASSERT_EQUALS(broadcastIdList2->Enumerate(), 0, _L("CMobilePhoneBroadcastIdList::Enumerate did not return an empty list")); |
|
1878 |
|
1879 // |
|
1880 // TEST END |
|
1881 // |
|
1882 |
|
1883 StartCleanup(); |
|
1884 |
|
1885 // Pop: |
|
1886 // broadcastIdList |
|
1887 // storeBroadcastIdList |
|
1888 // broadcastIdListExec |
|
1889 CleanupStack::PopAndDestroy(3, broadcastIdList); |
|
1890 |
|
1891 return TestStepResult(); |
|
1892 } |
|
1893 |
|
1894 TPtrC CCTSYIntegrationTestBroadcastMessaging0012::GetTestStepName() |
|
1895 /** |
|
1896 * @return The test step name. |
|
1897 */ |
|
1898 { |
|
1899 return _L("CCTSYIntegrationTestBroadcastMessaging0012"); |
|
1900 } |
|
1901 |
|
1902 |
|
1903 |
|
1904 CCTSYIntegrationTestBroadcastMessaging0013::CCTSYIntegrationTestBroadcastMessaging0013(CEtelSessionMgr& aEtelSessionMgr) |
|
1905 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
1906 /** |
|
1907 * Constructor. |
|
1908 */ |
|
1909 { |
|
1910 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0013::GetTestStepName()); |
|
1911 } |
|
1912 |
|
1913 CCTSYIntegrationTestBroadcastMessaging0013::~CCTSYIntegrationTestBroadcastMessaging0013() |
|
1914 /** |
|
1915 * Destructor. |
|
1916 */ |
|
1917 { |
|
1918 } |
|
1919 |
|
1920 TVerdict CCTSYIntegrationTestBroadcastMessaging0013::doTestStepL() |
|
1921 /** |
|
1922 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0013 |
|
1923 * @SYMFssID BA/CTSY/BRMSG-0013 |
|
1924 * @SYMTestCaseDesc Store and retrieve an empty broadcast ID list. |
|
1925 * @SYMTestPriority High |
|
1926 * @SYMTestActions |
|
1927 * @SYMTestExpectedResults Pass - List retrieved is same as that stored. |
|
1928 * @SYMTestType CIT |
|
1929 * @SYMTestCaseDependencies live/automatic |
|
1930 * |
|
1931 * Reason for test: Verify an empty list is retrieved. |
|
1932 * |
|
1933 * @return - TVerdict code |
|
1934 */ |
|
1935 { |
|
1936 |
|
1937 // |
|
1938 // SET UP |
|
1939 // |
|
1940 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1941 |
|
1942 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging); |
|
1943 |
|
1944 // Registered with the network |
|
1945 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
1946 CHECK_EQUALS_L(ret, KErrNone, |
|
1947 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
1948 |
|
1949 // |
|
1950 // SET UP END |
|
1951 // |
|
1952 |
|
1953 StartTest(); |
|
1954 |
|
1955 // |
|
1956 // TEST START |
|
1957 // |
|
1958 |
|
1959 // Create a new CMobilePhoneBroadcastIdList with CMobilePhoneBroadcastIdList ::NewL |
|
1960 CMobilePhoneBroadcastIdList* broadcastIdList= CMobilePhoneBroadcastIdList::NewL(); |
|
1961 CleanupStack::PushL(broadcastIdList); |
|
1962 |
|
1963 // This is deliberate action to open a session because the API in Etelmm allocates memory |
|
1964 // The Session Manager should be used in all other places. |
|
1965 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
1966 RMobileBroadcastMessaging broadcastMessagingStore; |
|
1967 broadcastMessagingStore.Open(phone); |
|
1968 |
|
1969 // Store the broadcast ID list with RMobileBroadcastMessaging::StoreBroadcastIdListL with aIdType=EGsmBroadcastId |
|
1970 RMobileBroadcastMessaging::TMobileBroadcastIdType idType=RMobileBroadcastMessaging::EGsmBroadcastId; |
|
1971 TExtEtelRequestStatus storeBroadcastIdList(broadcastMessaging, EMobileBroadcastMessagingStoreIdList); |
|
1972 CleanupStack::PushL(storeBroadcastIdList); |
|
1973 broadcastMessagingStore.StoreBroadcastIdListL(storeBroadcastIdList,broadcastIdList,idType); |
|
1974 ASSERT_EQUALS(WaitForRequestWithTimeOut(storeBroadcastIdList, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL timed out")); |
|
1975 ASSERT_EQUALS(storeBroadcastIdList.Int(), KErrNotSupported, _L("RMobileBroadcastMessaging::StoreBroadcastIdListL did not return KErrNotSupported")); |
|
1976 ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10028); |
|
1977 broadcastMessagingStore.Close(); |
|
1978 |
|
1979 // Use Retrieval helper class to retrieve broadcast Id entries from the list |
|
1980 TInt err; |
|
1981 CRetrieveMobilePhoneBroadcastIdListExec* broadcastIdListExec = CRetrieveMobilePhoneBroadcastIdListHelper::NewL(broadcastMessaging,idType); |
|
1982 CleanupStack::PushL(broadcastIdListExec); |
|
1983 CMobilePhoneBroadcastIdList* broadcastIdList2 = broadcastIdListExec ->DoGetList(err); |
|
1984 ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneBroadcastIdList::RetrieveListL is not able to get the list")) |
|
1985 |
|
1986 // Check CMobilePhoneBroadcastIdList::Enumerate returns 0 entry |
|
1987 ASSERT_EQUALS(broadcastIdList2->Enumerate(), 0, _L("CMobilePhoneBroadcastIdList::Enumerate did not return an empty list")); |
|
1988 |
|
1989 // |
|
1990 // TEST END |
|
1991 // |
|
1992 |
|
1993 StartCleanup(); |
|
1994 // Pop: |
|
1995 // broadcastIdList |
|
1996 // storeBroadcastIdList |
|
1997 // broadcastIdListExec |
|
1998 CleanupStack::PopAndDestroy(3, broadcastIdList); |
|
1999 |
|
2000 return TestStepResult(); |
|
2001 } |
|
2002 |
|
2003 TPtrC CCTSYIntegrationTestBroadcastMessaging0013::GetTestStepName() |
|
2004 /** |
|
2005 * @return The test step name. |
|
2006 */ |
|
2007 { |
|
2008 return _L("CCTSYIntegrationTestBroadcastMessaging0013"); |
|
2009 } |
|
2010 |
|
2011 CCTSYIntegrationTestBroadcastMessaging0014::CCTSYIntegrationTestBroadcastMessaging0014(CEtelSessionMgr& aEtelSessionMgr) |
|
2012 : CCTSYIntegrationTestBroadcastMessagingBase(aEtelSessionMgr) |
|
2013 /** |
|
2014 * Constructor. |
|
2015 */ |
|
2016 { |
|
2017 SetTestStepName(CCTSYIntegrationTestBroadcastMessaging0014::GetTestStepName()); |
|
2018 } |
|
2019 |
|
2020 CCTSYIntegrationTestBroadcastMessaging0014::~CCTSYIntegrationTestBroadcastMessaging0014() |
|
2021 /** |
|
2022 * Destructor. |
|
2023 */ |
|
2024 { |
|
2025 } |
|
2026 |
|
2027 TVerdict CCTSYIntegrationTestBroadcastMessaging0014::doTestStepL() |
|
2028 /** |
|
2029 * @SYMTestCaseID BA-CTSY-INT-BRMSG-0014 |
|
2030 * @SYMFssID BA/CTSY/BRMSG-0014 |
|
2031 * @SYMTestCaseDesc Set the broadcast messaging Language filter. |
|
2032 * @SYMTestPriority High |
|
2033 * @SYMTestActions RMobileBroadcastMessaging::NotifyFilterSettingChange,RMobileBroadcastMessaging::GetFilterSetting, RMobileBroadcastMessaging::SetFilterSetting, RMobileBroadcastMessaging::SetLanguageFilter, RMobileBroadcastMessaging::GetLanguageFilter |
|
2034 * @SYMTestExpectedResults Pass - Language filter notifications complete and are set correctly. |
|
2035 * @SYMTestType CIT |
|
2036 * @SYMTestCaseDependencies live/automatic |
|
2037 * |
|
2038 * Reason for test: Verify filter change notification completes and correct filter has been set. |
|
2039 * |
|
2040 * @return - TVerdict code |
|
2041 */ |
|
2042 { |
|
2043 |
|
2044 // |
|
2045 // SET UP |
|
2046 // |
|
2047 RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
2048 |
|
2049 RMobileBroadcastMessaging& broadcastMessaging = iEtelSessionMgr.GetBroadcastMessagingL(KMainServer, KMainPhone, KMainBroadcastMessaging) ; |
|
2050 |
|
2051 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iFilterCaps in set of KCapsSimpleFilter |
|
2052 RMobileBroadcastMessaging::TMobileBroadcastCapsV1 caps; |
|
2053 RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg capPkg(caps); |
|
2054 TUint32 expectedCaps = RMobileBroadcastMessaging::KCapsSimpleFilter; |
|
2055 |
|
2056 CHECK_EQUALS_L(broadcastMessaging.GetCaps(capPkg), KErrNone, _L("RMobileBroadcastMessaging::GetCaps returned with an error")); |
|
2057 CHECK_BITS_SET_L(caps.iFilterCaps,expectedCaps ,KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Filter caps")); |
|
2058 |
|
2059 // Ensure RMobileBroadcastMessaging::GetCaps returns aCaps.iModeCaps in set of KCapsGsmTpduFormat |
|
2060 CHECK_BITS_SET_L(caps.iModeCaps, RMobileBroadcastMessaging::KCapsGsmTpduFormat, KNoUnwantedBits, _L("RMobileBroadcastMessaging::GetCaps did not return desired Mode caps")); |
|
2061 |
|
2062 // Registered with the network |
|
2063 TInt ret = iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone); |
|
2064 CHECK_EQUALS_L(ret, KErrNone, |
|
2065 _L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed")); |
|
2066 |
|
2067 |
|
2068 // |
|
2069 // SET UP END |
|
2070 // |
|
2071 |
|
2072 StartTest(); |
|
2073 |
|
2074 // |
|
2075 // TEST START |
|
2076 // |
|
2077 |
|
2078 // === Check no language filter is set, then set language filter for one language === |
|
2079 |
|
2080 // Check RMobileBroadcastMessaging::GetLanguageFilter completes with KErrNotFound |
|
2081 TBuf<10> langFilter; |
|
2082 TExtEtelRequestStatus getLanguageFilterStatus(broadcastMessaging, EMobileBroadcastMessagingGetLanguageFilter); |
|
2083 CleanupStack::PushL(getLanguageFilterStatus); |
|
2084 broadcastMessaging.GetLanguageFilter(getLanguageFilterStatus, langFilter); |
|
2085 ASSERT_EQUALS(WaitForRequestWithTimeOut(getLanguageFilterStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::GetLanguageFilter timed out")); |
|
2086 ASSERT_EQUALS(getLanguageFilterStatus.Int(), KErrNotFound, _L("RMobileBroadcastMessaging::GetLanguageFilter returned with a language filtered unexpectedly")); |
|
2087 |
|
2088 // Post a notification RMobileBroadcastMessaging::NotifyLanguageFilterChange |
|
2089 TBuf<1> langFilterSetting; |
|
2090 TExtEtelRequestStatus notifyLanguageFilterChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyLanguageFilterChange); |
|
2091 CleanupStack::PushL(notifyLanguageFilterChangeStatus); |
|
2092 broadcastMessaging.NotifyLanguageFilterChange(notifyLanguageFilterChangeStatus, langFilterSetting); |
|
2093 |
|
2094 // Set the language filter with RMobileBroadcastMessaging::SetLanguageFilter and aLangFilter="\1" (English, see spec 03.38) |
|
2095 _LIT(KEnglish, "\1"); |
|
2096 TBuf<1> filter(KEnglish); |
|
2097 TExtEtelRequestStatus setLanguageFilterStatus(broadcastMessaging, EMobileBroadcastMessagingSetLanguageFilter); |
|
2098 CleanupStack::PushL(setLanguageFilterStatus); |
|
2099 broadcastMessaging.SetLanguageFilter(setLanguageFilterStatus,filter); |
|
2100 ASSERT_EQUALS(WaitForRequestWithTimeOut(setLanguageFilterStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetLanguageFilter timed out")); |
|
2101 ASSERT_EQUALS(setLanguageFilterStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetLanguageFilter returned with an error")); |
|
2102 |
|
2103 // Check RMobileBroadcastMessaging::NotifyLanguageFilterChange completes with aLangFilter="\1" |
|
2104 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyLanguageFilterChange( |
|
2105 broadcastMessaging, |
|
2106 notifyLanguageFilterChangeStatus, |
|
2107 filter, |
|
2108 langFilterSetting, |
|
2109 KErrNone ); |
|
2110 |
|
2111 // Check RMobileBroadcastMessaging::GetLanguageFilter completes with aLangFilter="\1" |
|
2112 broadcastMessaging.GetLanguageFilter(getLanguageFilterStatus, langFilter); |
|
2113 ASSERT_EQUALS(WaitForRequestWithTimeOut(getLanguageFilterStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::GetLanguageFilter timed out")); |
|
2114 ASSERT_EQUALS(getLanguageFilterStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::GetLanguageFilter returned with a language filtered unexpectedly")); |
|
2115 ASSERT_EQUALS_DES16(langFilter, filter, _L("RMobileBroadcastMessaging::GetLanguageFilter did not complete with a aLangFilter=KEnglish")); |
|
2116 |
|
2117 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
2118 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting; |
|
2119 TExtEtelRequestStatus notifyFilterSettingChangeStatus(broadcastMessaging, EMobileBroadcastMessagingNotifyFilterSettingChange); |
|
2120 CleanupStack::PushL(notifyFilterSettingChangeStatus); |
|
2121 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
2122 |
|
2123 |
|
2124 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptFilter |
|
2125 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSetting1 = RMobileBroadcastMessaging::EBroadcastAcceptFilter; |
|
2126 TExtEtelRequestStatus setFilterSettingStatus(broadcastMessaging, EMobileBroadcastMessagingSetFilterSetting); |
|
2127 CleanupStack::PushL(setFilterSettingStatus); |
|
2128 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
2129 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
2130 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
2131 |
|
2132 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptFilter |
|
2133 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
2134 broadcastMessaging, |
|
2135 notifyFilterSettingChangeStatus, |
|
2136 filterSetting, |
|
2137 filterSetting1, |
|
2138 KErrNone ); |
|
2139 |
|
2140 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptFilter |
|
2141 RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter filterSettingObtained; |
|
2142 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
2143 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptFilter, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
2144 |
|
2145 // === Set language filter to filter for no languages === |
|
2146 |
|
2147 // Post a notification RMobileBroadcastMessaging::NotifyLanguageFilterChange |
|
2148 broadcastMessaging.NotifyLanguageFilterChange(notifyLanguageFilterChangeStatus, langFilterSetting); |
|
2149 |
|
2150 // Set the language filter with RMobileBroadcastMessaging::SetLanguageFilter and aLangFilter="" |
|
2151 _LIT(KNone, ""); |
|
2152 filter=KNone; |
|
2153 broadcastMessaging.SetLanguageFilter(setLanguageFilterStatus,filter); |
|
2154 ASSERT_EQUALS(WaitForRequestWithTimeOut(setLanguageFilterStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetLanguageFilter timed out")); |
|
2155 ASSERT_EQUALS(setLanguageFilterStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetLanguageFilter returned with an error")); |
|
2156 |
|
2157 // Check RMobileBroadcastMessaging::NotifyLanguageFilterChange completes with aLangFilter="" |
|
2158 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyLanguageFilterChange( |
|
2159 broadcastMessaging, |
|
2160 notifyLanguageFilterChangeStatus, |
|
2161 filter, |
|
2162 langFilterSetting, |
|
2163 KErrNone ); |
|
2164 |
|
2165 // Check RMobileBroadcastMessaging::GetLanguageFilter completes with KErrNotFound |
|
2166 broadcastMessaging.GetLanguageFilter(getLanguageFilterStatus, langFilter); |
|
2167 ASSERT_EQUALS(WaitForRequestWithTimeOut(getLanguageFilterStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::GetLanguageFilter timed out")); |
|
2168 ASSERT_EQUALS(getLanguageFilterStatus.Int(), KErrNotFound, _L("RMobileBroadcastMessaging::GetLanguageFilter returned with a language filtered unexpectedly")); |
|
2169 |
|
2170 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
2171 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
2172 |
|
2173 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptFilter |
|
2174 filterSetting1= RMobileBroadcastMessaging::EBroadcastAcceptFilter; |
|
2175 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
2176 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
2177 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
2178 |
|
2179 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptFilter |
|
2180 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
2181 broadcastMessaging, |
|
2182 notifyFilterSettingChangeStatus, |
|
2183 filterSetting, |
|
2184 filterSetting1, |
|
2185 KErrNone ); |
|
2186 |
|
2187 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptFilter |
|
2188 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
2189 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptFilter, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
2190 |
|
2191 // === Check no language filter is set, then set language filter for more than one language === |
|
2192 |
|
2193 // Post a notification RMobileBroadcastMessaging::NotifyLanguageFilterChange |
|
2194 broadcastMessaging.NotifyLanguageFilterChange(notifyLanguageFilterChangeStatus, langFilterSetting); |
|
2195 |
|
2196 // Set the language filter with RMobileBroadcastMessaging::SetLanguageFilter and aLangFilter="\7\1" (Danish + English, see spec 03.38) |
|
2197 _LIT(KMultipleLang, "\7\1"); |
|
2198 filter=KMultipleLang; |
|
2199 broadcastMessaging.SetLanguageFilter(setLanguageFilterStatus,filter); |
|
2200 ASSERT_EQUALS(WaitForRequestWithTimeOut(setLanguageFilterStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetLanguageFilter timed out")); |
|
2201 ASSERT_EQUALS(setLanguageFilterStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetLanguageFilter returned with an error")); |
|
2202 |
|
2203 // Check RMobileBroadcastMessaging::NotifyLanguageFilterChange completes with aLangFilter="\7\1" |
|
2204 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyLanguageFilterChange( |
|
2205 broadcastMessaging, |
|
2206 notifyLanguageFilterChangeStatus, |
|
2207 filter, |
|
2208 langFilterSetting, |
|
2209 KErrNone ); |
|
2210 |
|
2211 // Check RMobileBroadcastMessaging::GetLanguageFilter completes with aLangFilter="\7\1" |
|
2212 broadcastMessaging.GetLanguageFilter(getLanguageFilterStatus, langFilter); |
|
2213 ASSERT_EQUALS(WaitForRequestWithTimeOut(getLanguageFilterStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::GetLanguageFilter timed out")); |
|
2214 ASSERT_EQUALS(getLanguageFilterStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::GetLanguageFilter returned with a language filtered unexpectedly")); |
|
2215 ASSERT_EQUALS_DES16(langFilter, filter, _L("RMobileBroadcastMessaging::GetLanguageFilter did not complete with a aLangFilter=KEnglish")); |
|
2216 |
|
2217 // Post a notification RMobileBroadcastMessaging::NotifyFilterSettingChange |
|
2218 broadcastMessaging.NotifyFilterSettingChange(notifyFilterSettingChangeStatus, filterSetting); |
|
2219 |
|
2220 // Set the filter with RMobileBroadcastMessaging::SetFilterSetting and aSetting=EBroadcastAcceptFilter |
|
2221 filterSetting1= RMobileBroadcastMessaging::EBroadcastAcceptFilter; |
|
2222 broadcastMessaging.SetFilterSetting(setFilterSettingStatus, filterSetting1); |
|
2223 ASSERT_EQUALS(WaitForRequestWithTimeOut(setFilterSettingStatus, ETimeMedium),KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting timed out")); |
|
2224 ASSERT_EQUALS(setFilterSettingStatus.Int(), KErrNone, _L("RMobileBroadcastMessaging::SetFilterSetting returned with an error")); |
|
2225 |
|
2226 // Check RMobileBroadcastMessaging::NotifyFilterSettingChange completes with aSetting=EBroadcastAcceptFilter |
|
2227 iBroadcastMessagingTestHelper.WaitForMobileBroadcastMessagingNotifyFilterSettingChange( |
|
2228 broadcastMessaging, |
|
2229 notifyFilterSettingChangeStatus, |
|
2230 filterSetting, |
|
2231 filterSetting1, |
|
2232 KErrNone ); |
|
2233 |
|
2234 // Check RMobileBroadcastMessaging::GetFilterSetting returns aSetting=EBroadcastAcceptFilter |
|
2235 ASSERT_EQUALS(broadcastMessaging.GetFilterSetting(filterSettingObtained), KErrNone, _L("RMobileBroadcastMessaging::GetFilterSetting returned with an error")); |
|
2236 ASSERT_EQUALS(filterSettingObtained, RMobileBroadcastMessaging::EBroadcastAcceptFilter, _L("RMobileBroadcastMessaging::GetFilterSetting did not return EBroadcastAcceptNone")) |
|
2237 |
|
2238 // |
|
2239 // TEST END |
|
2240 // |
|
2241 |
|
2242 StartCleanup(); |
|
2243 |
|
2244 // Pop : |
|
2245 // getLanguageFilterStatus |
|
2246 // notifyLanguageFilterChangeStatus |
|
2247 // setLanguageFilterStatus |
|
2248 // notifyFilterSettingChangeStatus |
|
2249 // setFilterSettingStatus |
|
2250 CleanupStack::PopAndDestroy(5, &getLanguageFilterStatus); |
|
2251 |
|
2252 return TestStepResult(); |
|
2253 } |
|
2254 |
|
2255 TPtrC CCTSYIntegrationTestBroadcastMessaging0014::GetTestStepName() |
|
2256 /** |
|
2257 * @return The test step name. |
|
2258 */ |
|
2259 { |
|
2260 return _L("CCTSYIntegrationTestBroadcastMessaging0014"); |
|
2261 } |
|
2262 |
|
2263 |
|
2264 |