|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Test module for IptvVodContentClient* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <e32svr.h> |
|
21 #include <StifParser.h> |
|
22 #include <Stiftestinterface.h> |
|
23 #include "VCXVodContentApiTest.h" |
|
24 #include "VCXTestLog.h" |
|
25 |
|
26 #include "CIptvVodContentClient.h" |
|
27 |
|
28 #include "CIptvVodContentCategoryBriefDetails.h" |
|
29 #include "CIptvVodContentContentBriefDetails.h" |
|
30 #include "CIptvVodContentContentFullDetails.h" |
|
31 |
|
32 #include "CIptvUtil.h" |
|
33 #include "CIptvTestTimer.h" |
|
34 #include "CIptvTestUtilities.h" |
|
35 #include "CIptvTestEcgUpdateInfo.h" |
|
36 #include "TIptvRssSearchQuery.h" |
|
37 #include <CentralRepository.h> |
|
38 |
|
39 #include <f32file.h> |
|
40 |
|
41 // EXTERNAL DATA STRUCTURES |
|
42 |
|
43 // EXTERNAL FUNCTION PROTOTYPES |
|
44 |
|
45 // CONSTANTS |
|
46 |
|
47 // MACROS |
|
48 |
|
49 // LOCAL CONSTANTS AND MACROS |
|
50 |
|
51 // MODULE DATA STRUCTURES |
|
52 |
|
53 // LOCAL FUNCTION PROTOTYPES |
|
54 |
|
55 // FORWARD DECLARATIONS |
|
56 |
|
57 // ============================= LOCAL FUNCTIONS =============================== |
|
58 |
|
59 // ============================ MEMBER FUNCTIONS =============================== |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // CIptvVodContentApiTest::Delete |
|
63 // Delete here all resources allocated and opened from test methods. |
|
64 // Called from destructor. |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 void CIptvVodContentApiTest::Delete() |
|
68 { |
|
69 VCXLOGLO1(">>>CIptvVodContentApiTest::Delete"); |
|
70 DeAllocateResources(); |
|
71 VCXLOGLO1("<<<CIptvVodContentApiTest::Delete"); |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CIptvVodContentApiTest::RunMethodL |
|
76 // Run specified method. Contains also table of test mothods and their names. |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 TInt CIptvVodContentApiTest::RunMethodL( |
|
80 CStifItemParser& aItem ) |
|
81 { |
|
82 |
|
83 static TStifFunctionInfo const KFunctions[] = |
|
84 { |
|
85 // Copy this line for every implemented function. |
|
86 // First string is the function name used in TestScripter script file. |
|
87 // Second is the actual implementation member function. |
|
88 ENTRY( "EnableVerifying", CIptvVodContentApiTest::EnableVerifying ), |
|
89 ENTRY( "Verify", CIptvVodContentApiTest::Verify ), |
|
90 ENTRY( "DeleteEpgDb", CIptvVodContentApiTest::DeleteEpgDb ), |
|
91 ENTRY( "Create", CIptvVodContentApiTest::CreateL ), |
|
92 ENTRY( "GetEcgList", CIptvVodContentApiTest::GetEcgList ), |
|
93 ENTRY( "EcgCategoryList", CIptvVodContentApiTest::EcgCategoryList ), |
|
94 ENTRY( "EcgEcgAllList", CIptvVodContentApiTest::EcgEcgAllList ), |
|
95 ENTRY( "CategoryDetails", CIptvVodContentApiTest::CategoryDetails ), |
|
96 ENTRY( "ParentCategory", CIptvVodContentApiTest::ParentCategory ), |
|
97 ENTRY( "ContentDetailsList", CIptvVodContentApiTest::ContentDetailsList ), |
|
98 ENTRY( "VerifyAllCategoryContent", CIptvVodContentApiTest::VerifyAllCategoryContentL ), |
|
99 ENTRY( "UpdateEcg", CIptvVodContentApiTest::UpdateEcg ), |
|
100 ENTRY( "SetTestCaseTimeOut", CIptvVodContentApiTest::SetTestCaseTimeOut ), |
|
101 ENTRY( "SelectIap", CIptvVodContentApiTest::SelectIapL ), |
|
102 ENTRY( "GetUpdateTime", CIptvVodContentApiTest::GetUpdateTimeL ), |
|
103 ENTRY( "SetSpecialAction", CIptvVodContentApiTest::SetSpecialAction ), |
|
104 ENTRY( "DisableThumbnails", CIptvVodContentApiTest::DisableThumbnails ), |
|
105 ENTRY( "EnableThumbnails", CIptvVodContentApiTest::EnableThumbnails ), |
|
106 ENTRY( "SetParentalControlAge", CIptvVodContentApiTest::SetParentalControlAge ), |
|
107 ENTRY( "Search", CIptvVodContentApiTest::Search ), |
|
108 ENTRY( "CancelSearch", CIptvVodContentApiTest::CancelSearch ), |
|
109 ENTRY( "CancelUpdate", CIptvVodContentApiTest::CancelUpdate ), |
|
110 ENTRY( "SetLastPosition", CIptvVodContentApiTest::SetLastPosition ), |
|
111 ENTRY( "UpdateAvailable", CIptvVodContentApiTest::UpdateAvailableL ), |
|
112 ENTRY( "CategoryCount", CIptvVodContentApiTest::CategoryCountL ), |
|
113 ENTRY( "ContentCount", CIptvVodContentApiTest::ContentCountL ), |
|
114 ENTRY( "SetMsgWhichToSignal", CIptvVodContentApiTest::SetMsgWhichToSignal ), |
|
115 ENTRY( "IgnoreMsg", CIptvVodContentApiTest::IgnoreMsg ), |
|
116 ENTRY( "Destroy", CIptvVodContentApiTest::Destroy ), |
|
117 }; |
|
118 |
|
119 |
|
120 const TInt count = sizeof( KFunctions ) / |
|
121 sizeof( TStifFunctionInfo ); |
|
122 |
|
123 return RunInternalL( KFunctions, count, aItem ); |
|
124 |
|
125 } |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CIptvVodContentApiTest::CreateL |
|
129 // (other items were commented in a header). |
|
130 // ----------------------------------------------------------------------------- |
|
131 // |
|
132 TInt CIptvVodContentApiTest::CreateL( CStifItemParser& aItem ) |
|
133 { |
|
134 VCXLOGLO1(">>>CIptvVodContentApiTest::CreateL"); |
|
135 // Print to UI |
|
136 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
137 _LIT( KCreateL, "In CreateL" ); |
|
138 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KCreateL ); |
|
139 // Print to log file |
|
140 iLog->Log( KCreateL ); |
|
141 |
|
142 //Script parameters: |
|
143 // service id, must be >0 |
|
144 TPtrC serviceName; |
|
145 |
|
146 iMsgWhichToSignal = -1; |
|
147 iIgnoreMsg = KIptvTestNoSignal; |
|
148 |
|
149 TInt testCaseStatus = KErrNone; |
|
150 |
|
151 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
|
152 |
|
153 if(aItem.GetNextString(serviceName) != KErrNone) |
|
154 { |
|
155 VCXLOGLO1("Can't read testcase parameter, serviceName/number !!!"); |
|
156 VCXLOGLO1("<<<CIptvVodContentApiTest::CreateL"); |
|
157 iLog->Log( _L("**** FAIL ***** Can't read testcase parameter!!!") ); |
|
158 return KErrGeneral; |
|
159 } |
|
160 |
|
161 VCXLOGLO2("serviceName/orderNumber: %S", &serviceName); |
|
162 |
|
163 TInt timeoutValue; |
|
164 if(aItem.GetNextInt(timeoutValue) == KErrNone) |
|
165 { |
|
166 iTimeoutMinutes = timeoutValue; |
|
167 } |
|
168 else |
|
169 { |
|
170 iTimeoutMinutes = 4; |
|
171 } |
|
172 |
|
173 testCaseStatus = CreateInstance(serviceName); |
|
174 |
|
175 iRetryCount = 0; |
|
176 |
|
177 VCXLOGLO1("<<<CIptvVodContentApiTest::CreateL"); |
|
178 return testCaseStatus; |
|
179 } |
|
180 |
|
181 |
|
182 // ----------------------------------------------------------------------------- |
|
183 // CIptvVodContentApiTest::DeleteEpgDb(); |
|
184 // ----------------------------------------------------------------------------- |
|
185 // |
|
186 TInt CIptvVodContentApiTest::DeleteEpgDb( CStifItemParser& /* aItem */ ) |
|
187 { |
|
188 VCXLOGLO1(">>>CIptvVodContentApiTest::DeleteEpgDb"); |
|
189 |
|
190 RFs fs; |
|
191 fs.Connect(); |
|
192 |
|
193 CFileMan* fileMan = CFileMan::NewL(fs); |
|
194 |
|
195 TBuf<512> path; |
|
196 |
|
197 // CIptvUtil::GetPathL(fs, EIptvPathMyVideos, path, EDriveC); |
|
198 // fileMan->RmDir(path); |
|
199 |
|
200 CIptvUtil::GetPathL(fs, EIptvPathEcg, path, EDriveC); |
|
201 fileMan->RmDir(path); |
|
202 |
|
203 // CIptvUtil::GetPathL(fs, EIptvPathMyVideos, path, EDriveE); |
|
204 // fileMan->RmDir(path); |
|
205 |
|
206 CIptvUtil::GetPathL(fs, EIptvPathEcg, path, EDriveE); |
|
207 fileMan->RmDir(path); |
|
208 |
|
209 delete fileMan; |
|
210 |
|
211 fs.Close(); |
|
212 |
|
213 VCXLOGLO1("<<<CIptvVodContentApiTest::DeleteEpgDb"); |
|
214 |
|
215 return KErrNone; |
|
216 } |
|
217 |
|
218 // ----------------------------------------------------------------------------- |
|
219 // CIptvVodContentApiTest::GetEcgList(); |
|
220 // ----------------------------------------------------------------------------- |
|
221 // |
|
222 TInt CIptvVodContentApiTest::GetEcgList( CStifItemParser& aItem ) |
|
223 { |
|
224 VCXLOGLO1(">>>CIptvVodContentApiTest::GetEcgList"); |
|
225 // Print to UI |
|
226 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
227 _LIT( KGetEcgList, "In GetEcgList" ); |
|
228 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KGetEcgList ); |
|
229 // Print to log file |
|
230 iLog->Log( KGetEcgList ); |
|
231 |
|
232 //Script parameters |
|
233 |
|
234 TPtrC searchStringPtr; |
|
235 |
|
236 TInt categoryId = 0; |
|
237 TInt from =0; |
|
238 TInt amount = 0; |
|
239 TInt testCaseStatus = KErrNone; |
|
240 TBool isParametersValid = TRUE; |
|
241 |
|
242 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
|
243 |
|
244 //Script parameters |
|
245 if(aItem.GetNextInt(categoryId) != KErrNone) |
|
246 { |
|
247 isParametersValid = FALSE; |
|
248 } |
|
249 |
|
250 if(aItem.GetNextString(searchStringPtr) != KErrNone) |
|
251 { |
|
252 isParametersValid = FALSE; |
|
253 } |
|
254 |
|
255 if(aItem.GetNextInt(from) == KErrNone) |
|
256 { |
|
257 //check validity |
|
258 if(from<0) |
|
259 { |
|
260 isParametersValid = FALSE; |
|
261 } |
|
262 } |
|
263 else |
|
264 { |
|
265 isParametersValid = FALSE; |
|
266 } |
|
267 |
|
268 if(aItem.GetNextInt(amount) == KErrNone) |
|
269 { |
|
270 //check validity |
|
271 if(amount<0) |
|
272 { |
|
273 isParametersValid = FALSE; |
|
274 } |
|
275 } |
|
276 else |
|
277 { |
|
278 isParametersValid = FALSE; |
|
279 } |
|
280 |
|
281 TBuf<256> searchString(searchStringPtr); |
|
282 if(!searchString.Compare(_L("\"\"")) ) |
|
283 { |
|
284 searchString = _L(""); |
|
285 } |
|
286 |
|
287 TUint32 categoryId32 = categoryId; |
|
288 if(categoryId == KIptvTestSearchCategoryId) |
|
289 { |
|
290 categoryId32 = KIptvRssSearchCategoryId; |
|
291 } |
|
292 |
|
293 VCXLOGLO2("categoryId: %d", categoryId32); |
|
294 VCXLOGLO2("searchString: %S", &searchString); |
|
295 VCXLOGLO2("from: %d", from); |
|
296 VCXLOGLO2("amount: %d", amount); |
|
297 |
|
298 if(!isParametersValid) |
|
299 { |
|
300 VCXLOGLO1("Error in testparameters"); |
|
301 iLog->Log(_L("Error in testparameters")); |
|
302 VCXLOGLO1("<<<CIptvVodContentApiTest::GetEcgList"); |
|
303 return KErrGeneral; |
|
304 } |
|
305 |
|
306 //TestGetEcgList(TIptvCategoryId aCategoryId, TDesC& aSearchString, TUint32 aFrom, TUint32 aAmount) |
|
307 //testCaseStatus = TestGetEcgList(categoryId, searchString, from,amount); |
|
308 testCaseStatus = TestGetEcgList(categoryId32, searchString, from,amount); |
|
309 |
|
310 VCXLOGLO1("<<<CIptvVodContentApiTest::GetEcgList"); |
|
311 return testCaseStatus; |
|
312 } |
|
313 |
|
314 |
|
315 |
|
316 // ----------------------------------------------------------------------------- |
|
317 // CIptvVodContentApiTest::EnableVerifying(); |
|
318 // ----------------------------------------------------------------------------- |
|
319 // |
|
320 TInt CIptvVodContentApiTest::EnableVerifying( CStifItemParser& aItem ) |
|
321 { |
|
322 VCXLOGLO1(">>>CIptvVodContentApiTest::EnableVerifying"); |
|
323 // Print to UI |
|
324 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
325 _LIT( KEnableVerifying , "In EnableVerifying" ); |
|
326 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KEnableVerifying ); |
|
327 // Print to log file |
|
328 iLog->Log( KEnableVerifying ); |
|
329 |
|
330 //Script parameters |
|
331 |
|
332 TInt result = KErrNone; |
|
333 |
|
334 TPtrC caseId; |
|
335 TInt countNumber = -1; |
|
336 |
|
337 TBool isParametersValid = ETrue; |
|
338 |
|
339 //Script parameters |
|
340 if(aItem.GetNextString(caseId) != KErrNone) |
|
341 { |
|
342 isParametersValid = EFalse; |
|
343 } |
|
344 |
|
345 TInt appendInt = 0; |
|
346 TBool append = EFalse; |
|
347 if(aItem.GetNextInt(appendInt) == KErrNone) |
|
348 { |
|
349 append = static_cast<TBool>(appendInt); |
|
350 } |
|
351 aItem.GetNextInt(countNumber); |
|
352 |
|
353 if(!isParametersValid) |
|
354 { |
|
355 VCXLOGLO1("Error in testparameters"); |
|
356 iLog->Log(_L("Error in testparameters")); |
|
357 result = KErrGeneral; |
|
358 } |
|
359 else |
|
360 { |
|
361 iCaseId = caseId; |
|
362 if(countNumber >= 0) |
|
363 { |
|
364 iCaseId.AppendNum(countNumber); |
|
365 } |
|
366 iIptvTestUtilities->CreateVerifyData(iCaseId, append); |
|
367 } |
|
368 |
|
369 VCXLOGLO1("<<<CIptvVodContentApiTest::EnableVerifying"); |
|
370 return result; |
|
371 } |
|
372 |
|
373 // ----------------------------------------------------------------------------- |
|
374 // CIptvVodContentApiTest::Verify(); |
|
375 // ----------------------------------------------------------------------------- |
|
376 // |
|
377 TInt CIptvVodContentApiTest::Verify( CStifItemParser& aItem ) |
|
378 { |
|
379 VCXLOGLO1(">>>CIptvVodContentApiTest::Verify"); |
|
380 // Print to UI |
|
381 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
382 _LIT( KVerify , "In Verify" ); |
|
383 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KVerify ); |
|
384 // Print to log file |
|
385 iLog->Log( KVerify ); |
|
386 |
|
387 TInt paramCount = 0; |
|
388 TPtrC caseId; |
|
389 TInt error = KErrNone; |
|
390 while(aItem.GetNextString(caseId) == KErrNone) |
|
391 { |
|
392 paramCount++; |
|
393 VCXLOGLO2("Verifying: %S.", &caseId); |
|
394 CIptvTestVerifyData::TVerifyResult verifyResult; |
|
395 error = iIptvTestUtilities->VerifyData(caseId, verifyResult); |
|
396 if(verifyResult != CIptvTestVerifyData::EVerifyOk) |
|
397 { |
|
398 VCXLOGLO3("Verify failed, VerifyResult: %d, err: %d", verifyResult, error); |
|
399 TestModuleIf().Printf( 0, _L("Verify failed"), _L("") ); |
|
400 error = verifyResult; |
|
401 } |
|
402 else |
|
403 { |
|
404 VCXLOGLO1("Data verified succesfully."); |
|
405 } |
|
406 } |
|
407 |
|
408 if(paramCount == 0) |
|
409 { |
|
410 error = KErrGeneral; |
|
411 VCXLOGLO1("Test case logic error, no CaseId(s) defined for verification.."); |
|
412 } |
|
413 |
|
414 |
|
415 VCXLOGLO1("<<<CIptvVodContentApiTest::Verify"); |
|
416 return error; |
|
417 } |
|
418 |
|
419 // ----------------------------------------------------------------------------- |
|
420 // CIptvVodContentApiTest::EcgCategoryList |
|
421 // ----------------------------------------------------------------------------- |
|
422 // |
|
423 TInt CIptvVodContentApiTest::EcgCategoryList( CStifItemParser& aItem ) |
|
424 { |
|
425 VCXLOGLO1(">>>CIptvVodContentApiTest::EcgCategoryList"); |
|
426 // Print to UI |
|
427 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
428 _LIT( KEcgCategoryList, "In EcgCategoryList" ); |
|
429 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KEcgCategoryList ); |
|
430 // Print to log file |
|
431 iLog->Log( KEcgCategoryList ); |
|
432 |
|
433 //Script parameters |
|
434 //use KIptvVodContentCategoryRootId |
|
435 |
|
436 TInt parentCategoryId = 0; |
|
437 TInt testCaseStatus = KErrNone; |
|
438 |
|
439 TBool isParametersValid = TRUE; |
|
440 |
|
441 if(aItem.GetNextInt(parentCategoryId) != KErrNone) |
|
442 { |
|
443 isParametersValid = FALSE; |
|
444 } |
|
445 |
|
446 VCXLOGLO2("parentCategoryId: %d", parentCategoryId); |
|
447 |
|
448 if(!isParametersValid) |
|
449 { |
|
450 VCXLOGLO1("Error in testparameters"); |
|
451 iLog->Log(_L("Error in testparameters")); |
|
452 VCXLOGLO1("<<<CIptvVodContentApiTest::EcgCategoryList"); |
|
453 return KErrGeneral; |
|
454 } |
|
455 |
|
456 TUint32 parentCategoryId32 = parentCategoryId; |
|
457 if(parentCategoryId == KIptvTestSearchCategoryId) |
|
458 { |
|
459 parentCategoryId32 = KIptvRssSearchCategoryId; |
|
460 } |
|
461 |
|
462 //rv = TestGetEcgCategoryList(TIptvCategoryId aParentCategoryId); |
|
463 testCaseStatus = TestGetEcgCategoryList( parentCategoryId32 ); |
|
464 |
|
465 VCXLOGLO1("<<<CIptvVodContentApiTest::EcgCategoryList"); |
|
466 return testCaseStatus; |
|
467 } |
|
468 |
|
469 // ----------------------------------------------------------------------------- |
|
470 // CIptvVodContentApiTest::EcgEcgAllList |
|
471 // ----------------------------------------------------------------------------- |
|
472 // |
|
473 TInt CIptvVodContentApiTest::EcgEcgAllList( CStifItemParser& aItem ) |
|
474 { |
|
475 VCXLOGLO1(">>>CIptvVodContentApiTest::EcgEcgAllList"); |
|
476 // Print to UI |
|
477 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
478 _LIT( KEcgEcgAllList, "In EcgEcgAllList" ); |
|
479 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KEcgEcgAllList ); |
|
480 // Print to log file |
|
481 iLog->Log( KEcgEcgAllList ); |
|
482 |
|
483 TInt testCaseStatus = KErrNone; |
|
484 TPtrC searchStringPtr; |
|
485 TInt from = 0; |
|
486 TInt amount = 0; |
|
487 |
|
488 TBool isParametersValid = TRUE; |
|
489 |
|
490 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
|
491 |
|
492 //Script parameters |
|
493 if(aItem.GetNextString(searchStringPtr)==KErrNone) |
|
494 { |
|
495 //check string content |
|
496 } |
|
497 else |
|
498 { |
|
499 //isParametersValid = FALSE; |
|
500 } |
|
501 |
|
502 if(aItem.GetNextInt(from) == KErrNone) |
|
503 { |
|
504 //check validity |
|
505 if(from<0) |
|
506 { |
|
507 isParametersValid = FALSE; |
|
508 } |
|
509 } |
|
510 else |
|
511 { |
|
512 isParametersValid = FALSE; |
|
513 } |
|
514 |
|
515 if(aItem.GetNextInt(amount) == KErrNone) |
|
516 { |
|
517 //check validity |
|
518 if(amount<0) |
|
519 { |
|
520 isParametersValid = FALSE; |
|
521 } |
|
522 } |
|
523 else |
|
524 { |
|
525 isParametersValid = FALSE; |
|
526 } |
|
527 |
|
528 TBuf<2560> searchString(searchStringPtr); |
|
529 if(!searchString.Compare(_L("\"\"")) ) |
|
530 { |
|
531 searchString = _L(""); |
|
532 } |
|
533 |
|
534 VCXLOGLO2("searchString: %S", &searchString); |
|
535 VCXLOGLO2("from: %d", from); |
|
536 VCXLOGLO2("amount: %d", amount); |
|
537 |
|
538 if(!isParametersValid) |
|
539 { |
|
540 VCXLOGLO1("Error in testparameters"); |
|
541 iLog->Log(_L("Error in testparameters")); |
|
542 VCXLOGLO1("<<<CIptvVodContentApiTest::EcgCategoryList"); |
|
543 return KErrGeneral; |
|
544 } |
|
545 |
|
546 //rv = TestGetEcgAllList(TDesC& aSearchString, TUint32 aFrom, TUint32 aAmount); |
|
547 testCaseStatus = TestGetEcgAllList( searchString, from, amount); |
|
548 |
|
549 VCXLOGLO1("<<<CIptvVodContentApiTest::EcgEcgAllList"); |
|
550 return testCaseStatus; |
|
551 } |
|
552 |
|
553 // ----------------------------------------------------------------------------- |
|
554 // CIptvVodContentApiTest::CategoryDetails |
|
555 // ----------------------------------------------------------------------------- |
|
556 // |
|
557 TInt CIptvVodContentApiTest::CategoryDetails( CStifItemParser& aItem ) |
|
558 { |
|
559 VCXLOGLO1(">>>CIptvVodContentApiTest::CategoryDetails"); |
|
560 // Print to UI |
|
561 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
562 _LIT( KCategoryDetails, "In CategoryDetails" ); |
|
563 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KCategoryDetails ); |
|
564 // Print to log file |
|
565 iLog->Log( KCategoryDetails ); |
|
566 TInt testCaseStatus = KErrNone; |
|
567 TBool isParametersValid = TRUE; |
|
568 |
|
569 //Script parameters |
|
570 TInt categoryId = 0; |
|
571 |
|
572 if(aItem.GetNextInt(categoryId) != KErrNone) |
|
573 { |
|
574 isParametersValid = FALSE; |
|
575 } |
|
576 |
|
577 VCXLOGLO2("categoryId: %d", categoryId); |
|
578 |
|
579 if(!isParametersValid) |
|
580 { |
|
581 VCXLOGLO1("Error in testparameters"); |
|
582 iLog->Log(_L("Error in testparameters")); |
|
583 VCXLOGLO1("<<<CIptvVodContentApiTest::CategoryDetails"); |
|
584 return KErrGeneral; |
|
585 } |
|
586 |
|
587 TUint32 categoryId32 = categoryId; |
|
588 if(categoryId == KIptvTestSearchCategoryId) |
|
589 { |
|
590 categoryId32 = KIptvRssSearchCategoryId; |
|
591 } |
|
592 |
|
593 //testCaseStatus = TestGetEcgCategoryDetails(TIptvCategoryId aCategoryId); |
|
594 testCaseStatus = TestGetEcgCategoryDetails(categoryId32); |
|
595 |
|
596 VCXLOGLO1("<<<CIptvVodContentApiTest::CategoryDetails"); |
|
597 return testCaseStatus; |
|
598 } |
|
599 |
|
600 // ----------------------------------------------------------------------------- |
|
601 // CIptvVodContentApiTest::ParentCategory |
|
602 // ----------------------------------------------------------------------------- |
|
603 // |
|
604 TInt CIptvVodContentApiTest::ParentCategory( CStifItemParser& aItem ) |
|
605 { |
|
606 VCXLOGLO1(">>>CIptvVodContentApiTest::ParentCategory"); |
|
607 // Print to UI |
|
608 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
609 _LIT( KParentCategory, "In ParentCategory" ); |
|
610 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KParentCategory ); |
|
611 // Print to log file |
|
612 iLog->Log( KParentCategory ); |
|
613 |
|
614 TInt testCaseStatus = KErrNone; |
|
615 TBool isParametersValid = TRUE; |
|
616 |
|
617 //Script parameters |
|
618 TInt categoryId = 0; |
|
619 |
|
620 if(aItem.GetNextInt(categoryId) != KErrNone) |
|
621 { |
|
622 isParametersValid = FALSE; |
|
623 } |
|
624 |
|
625 if(!isParametersValid) |
|
626 { |
|
627 VCXLOGLO1("Error in testparameters"); |
|
628 iLog->Log(_L("Error in testparameters")); |
|
629 VCXLOGLO1("<<<CIptvVodContentApiTest::ParentCategory"); |
|
630 return KErrGeneral; |
|
631 } |
|
632 |
|
633 TUint32 categoryId32 = categoryId; |
|
634 if(categoryId == KIptvTestSearchCategoryId) |
|
635 { |
|
636 categoryId32 = KIptvRssSearchCategoryId; |
|
637 } |
|
638 |
|
639 //rv = TestGetParentCategory(TIptvCategoryId aCategoryId); |
|
640 testCaseStatus = TestGetParentCategory(categoryId32); |
|
641 |
|
642 VCXLOGLO1("<<<CIptvVodContentApiTest::ParentCategory"); |
|
643 return testCaseStatus; |
|
644 } |
|
645 |
|
646 // ----------------------------------------------------------------------------- |
|
647 // CIptvVodContentApiTest::ContentDetailsList |
|
648 // ----------------------------------------------------------------------------- |
|
649 // |
|
650 TInt CIptvVodContentApiTest::ContentDetailsList( CStifItemParser& aItem ) |
|
651 { |
|
652 VCXLOGLO1(">>>CIptvVodContentApiTest::ContentDetailsList"); |
|
653 // Print to UI |
|
654 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
655 _LIT( KContentDetailsList, "In ContentDetailsList" ); |
|
656 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KContentDetailsList ); |
|
657 // Print to log file |
|
658 iLog->Log( KContentDetailsList ); |
|
659 |
|
660 TInt testCaseStatus = KErrNone; |
|
661 TBool isParametersValid = TRUE; |
|
662 |
|
663 //Script parameters |
|
664 TInt contentId = 0; |
|
665 |
|
666 if(aItem.GetNextInt(contentId) == KErrNone) |
|
667 { |
|
668 if(contentId < 0) |
|
669 { |
|
670 isParametersValid = FALSE; |
|
671 } |
|
672 } |
|
673 else |
|
674 { |
|
675 isParametersValid = FALSE; |
|
676 } |
|
677 |
|
678 VCXLOGLO2("contentId: %d", contentId); |
|
679 |
|
680 if(!isParametersValid) |
|
681 { |
|
682 VCXLOGLO1("Error in testparameters"); |
|
683 iLog->Log(_L("Error in testparameters")); |
|
684 VCXLOGLO1("<<<CIptvVodContentApiTest::ContentDetailsList"); |
|
685 return KErrGeneral; |
|
686 } |
|
687 |
|
688 |
|
689 testCaseStatus = TestGetContentDetailsList( contentId ); |
|
690 |
|
691 VCXLOGLO1("<<<CIptvVodContentApiTest::ContentDetailsList"); |
|
692 return testCaseStatus; |
|
693 } |
|
694 |
|
695 // ----------------------------------------------------------------------------- |
|
696 // CIptvVodContentApiTest::VerifyAllCategoryContentL |
|
697 // ----------------------------------------------------------------------------- |
|
698 // |
|
699 TInt CIptvVodContentApiTest::VerifyAllCategoryContentL( CStifItemParser& aItem ) |
|
700 { |
|
701 VCXLOGLO1(">>>CIptvVodContentApiTest::VerifyAllCategoryContentL"); |
|
702 // Print to UI |
|
703 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
704 _LIT( KAllCategoryContentL, "In VerifyAllCategoryContentL" ); |
|
705 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KAllCategoryContentL ); |
|
706 // Print to log file |
|
707 iLog->Log( KAllCategoryContentL ); |
|
708 |
|
709 TInt testCaseStatus = KErrNone; |
|
710 TBool isParametersValid = ETrue; |
|
711 |
|
712 //Script parameters |
|
713 TInt parentCategoryId = 0; |
|
714 |
|
715 if(aItem.GetNextInt(parentCategoryId) != KErrNone) |
|
716 { |
|
717 isParametersValid = EFalse; |
|
718 } |
|
719 |
|
720 if(!isParametersValid) |
|
721 { |
|
722 VCXLOGLO1("Error in testparameters"); |
|
723 iLog->Log(_L("Error in testparameters")); |
|
724 VCXLOGLO1("<<<CIptvVodContentApiTest::VerifyAllCategoryContentL"); |
|
725 return KErrGeneral; |
|
726 } |
|
727 |
|
728 TUint32 parentCategoryId32 = parentCategoryId; |
|
729 if(parentCategoryId == KIptvTestSearchCategoryId) |
|
730 { |
|
731 parentCategoryId32 = KIptvRssSearchCategoryId; |
|
732 } |
|
733 |
|
734 testCaseStatus = TestVerifyAllCategoryContentL( parentCategoryId32 ); |
|
735 |
|
736 VCXLOGLO1("<<<CIptvVodContentApiTest::VerifyAllCategoryContentL"); |
|
737 return testCaseStatus; |
|
738 } |
|
739 |
|
740 // ----------------------------------------------------------------------------- |
|
741 // CIptvVodContentApiTest::UpdateEcg |
|
742 // ----------------------------------------------------------------------------- |
|
743 // |
|
744 TInt CIptvVodContentApiTest::UpdateEcg( CStifItemParser& aItem ) |
|
745 { |
|
746 VCXLOGLO1(">>>CIptvVodContentApiTest::UpdateEcg"); |
|
747 |
|
748 // Print to UI |
|
749 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
750 _LIT( KUpdateEcg, "In UpdateEcg" ); |
|
751 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KUpdateEcg ); |
|
752 // Print to log file |
|
753 iLog->Log( KUpdateEcg ); |
|
754 |
|
755 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
|
756 |
|
757 TInt testCaseStatus = KErrNone; |
|
758 if( aItem.GetNextInt( iRetryCount ) != KErrNone) |
|
759 { |
|
760 iRetryCount = 0; |
|
761 } |
|
762 |
|
763 iExpectedThumbnailCount = -1; |
|
764 iThumbnailCount = -1; |
|
765 |
|
766 VCXLOGLO1("CIptvVodContentApiTest::UpdateEcg -- starting update"); |
|
767 testCaseStatus = TestUpdateEcg(); |
|
768 |
|
769 VCXLOGLO1("<<<CIptvVodContentApiTest::UpdateEcg"); |
|
770 return testCaseStatus; |
|
771 } |
|
772 |
|
773 // ----------------------------------------------------------------------------- |
|
774 // CIptvVodContentApiTest::SetTestCaseTimeOut |
|
775 // ----------------------------------------------------------------------------- |
|
776 // |
|
777 TInt CIptvVodContentApiTest::SetTestCaseTimeOut( CStifItemParser& aItem ) |
|
778 { |
|
779 VCXLOGLO1(">>>CIptvVodContentApiTest::SetTestCaseTimeOut"); |
|
780 |
|
781 // Print to UI |
|
782 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
783 _LIT( KSetTestCaseTimeOut, "In SetTestCaseTimeOut" ); |
|
784 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KSetTestCaseTimeOut ); |
|
785 // Print to log file |
|
786 iLog->Log( KSetTestCaseTimeOut ); |
|
787 |
|
788 TBool isParametersValid = TRUE; |
|
789 |
|
790 //Script parameters: |
|
791 TInt timeOutSeconds = 0; |
|
792 |
|
793 if(aItem.GetNextInt(timeOutSeconds) == KErrNone) |
|
794 { |
|
795 if(timeOutSeconds < 0) |
|
796 { |
|
797 isParametersValid = FALSE; |
|
798 } |
|
799 } |
|
800 else |
|
801 { |
|
802 isParametersValid = FALSE; |
|
803 } |
|
804 |
|
805 if(!isParametersValid) |
|
806 { |
|
807 VCXLOGLO1("Error in testparameters"); |
|
808 iLog->Log(_L("Error in testparameters")); |
|
809 VCXLOGLO1("<<<CIptvVodContentApiTest::SetTestCaseTimeOut"); |
|
810 return KErrGeneral; |
|
811 } |
|
812 VCXLOGLO2("Timer %d seconds", timeOutSeconds); |
|
813 |
|
814 TTimeIntervalMicroSeconds32 interval(timeOutSeconds * 1000 * 1000); |
|
815 |
|
816 iIptvTestTimer->After( interval ); |
|
817 |
|
818 VCXLOGLO1("<<<CIptvVodContentApiTest::SetTestCaseTimeOut"); |
|
819 return KErrNone; |
|
820 } |
|
821 |
|
822 |
|
823 // ----------------------------------------------------------------------------- |
|
824 // CIptvVodContentApiTest::DisableThumbnails |
|
825 // ----------------------------------------------------------------------------- |
|
826 // |
|
827 TInt CIptvVodContentApiTest::DisableThumbnails( CStifItemParser& /* aItem */ ) |
|
828 { |
|
829 |
|
830 VCXLOGLO1(">>>CIptvVodContentApiTest::DisableThumbnails"); |
|
831 CRepository* cenRep = CRepository::NewL(KIptvCenRepUid); |
|
832 if (cenRep) |
|
833 { |
|
834 CleanupStack::PushL(cenRep); |
|
835 TInt error = cenRep->Set(KIptvCenRepVoDThumbnailsKey, EFalse); |
|
836 if (error != KErrNone) |
|
837 { |
|
838 VCXLOGLO2("Setting cenrep value returned error: %d", error); |
|
839 } |
|
840 CleanupStack::PopAndDestroy(cenRep); |
|
841 } |
|
842 VCXLOGLO1("<<<CIptvVodContentApiTest::DisableThumbnails"); |
|
843 return KErrNone; |
|
844 } |
|
845 |
|
846 // ----------------------------------------------------------------------------- |
|
847 // CIptvVodContentApiTest::EnableThumbnails |
|
848 // ----------------------------------------------------------------------------- |
|
849 // |
|
850 TInt CIptvVodContentApiTest::EnableThumbnails( CStifItemParser& /* aItem */ ) |
|
851 { |
|
852 VCXLOGLO1(">>>CIptvVodContentApiTest::EnableThumbnails"); |
|
853 CRepository* cenRep = CRepository::NewL(KIptvCenRepUid); |
|
854 if (cenRep) |
|
855 { |
|
856 CleanupStack::PushL(cenRep); |
|
857 TInt error = cenRep->Set(KIptvCenRepVoDThumbnailsKey, ETrue); |
|
858 if (error != KErrNone) |
|
859 { |
|
860 VCXLOGLO2("Setting cenrep value returned error: %d", error); |
|
861 } |
|
862 CleanupStack::PopAndDestroy(cenRep); |
|
863 } |
|
864 VCXLOGLO1("<<<CIptvVodContentApiTest::EnableThumbnails"); |
|
865 return KErrNone; |
|
866 } |
|
867 |
|
868 |
|
869 // ----------------------------------------------------------------------------- |
|
870 // CIptvVodContentApiTest::Search |
|
871 // ----------------------------------------------------------------------------- |
|
872 // |
|
873 TInt CIptvVodContentApiTest::Search( CStifItemParser& aItem ) |
|
874 { |
|
875 VCXLOGLO1(">>>CIptvVodContentApiTest::Search"); |
|
876 |
|
877 // Print to UI |
|
878 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
879 _LIT( KWhere, "In Search" ); |
|
880 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KWhere ); |
|
881 // Print to log file |
|
882 iLog->Log( KWhere ); |
|
883 |
|
884 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
|
885 |
|
886 TPtrC searchStr; |
|
887 TInt opt; |
|
888 |
|
889 // Get the first string. This can be search string or an option |
|
890 if(KErrNone != aItem.GetNextString(searchStr)) |
|
891 { |
|
892 VCXLOGLO1("Parameter search string/option missing!"); |
|
893 VCXLOGLO1("<<<CIptvVodContentApiTest::Search"); |
|
894 return KErrArgument; |
|
895 } |
|
896 |
|
897 // |
|
898 // It's an option if it's a number |
|
899 // |
|
900 TLex lex(searchStr); |
|
901 if(lex.Val(opt) == KErrNone) |
|
902 { |
|
903 VCXLOGLO2("Checking if %d is a search test option.", opt); |
|
904 |
|
905 if(opt == KBadCharacters) |
|
906 { |
|
907 VCXLOGLO1("YES. Searching with bad characters"); |
|
908 TBuf<50> tempStr; |
|
909 tempStr.Append(KBadCharacters); |
|
910 iSearchQuery.SetSearchString(tempStr); |
|
911 } |
|
912 |
|
913 VCXLOGLO1("NO, continuing with normal search."); |
|
914 } |
|
915 // |
|
916 // It's a search string |
|
917 // |
|
918 VCXLOGLO2("Search: %S", &searchStr); |
|
919 iSearchQuery.SetSearchString(searchStr); |
|
920 |
|
921 TInt err = iIptvVodContenClient->Search( iSearchQuery ); |
|
922 if(err != KErrNone) |
|
923 { |
|
924 VCXLOGLO2("* FAIL * Search returned an error: %d.", err); |
|
925 } |
|
926 |
|
927 VCXLOGLO1("<<<CIptvVodContentApiTest::Search"); |
|
928 return err; |
|
929 } |
|
930 |
|
931 // ----------------------------------------------------------------------------- |
|
932 // CIptvVodContentApiTest::CancelSearch |
|
933 // ----------------------------------------------------------------------------- |
|
934 // |
|
935 TInt CIptvVodContentApiTest::CancelSearch( CStifItemParser& /* aItem */ ) |
|
936 { |
|
937 VCXLOGLO1(">>>CIptvVodContentApiTest::CancelSearch"); |
|
938 |
|
939 // Print to UI |
|
940 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
941 _LIT( KWhere, "In CancelSearch" ); |
|
942 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KWhere ); |
|
943 // Print to log file |
|
944 iLog->Log( KWhere ); |
|
945 |
|
946 TInt err = KErrNone; |
|
947 err = iIptvVodContenClient->CancelSearch(); |
|
948 if(err != KErrNone) |
|
949 { |
|
950 VCXLOGLO2("* FAIL * CancelSearch returned an error: %d.", err); |
|
951 } |
|
952 |
|
953 VCXLOGLO1("<<<CIptvVodContentApiTest::CancelSearch"); |
|
954 return err; |
|
955 } |
|
956 |
|
957 // ----------------------------------------------------------------------------- |
|
958 // CIptvVodContentApiTest::CancelUpdate |
|
959 // ----------------------------------------------------------------------------- |
|
960 // |
|
961 TInt CIptvVodContentApiTest::CancelUpdate( CStifItemParser& /* aItem */ ) |
|
962 { |
|
963 VCXLOGLO1(">>>CIptvVodContentApiTest::CancelUpdate"); |
|
964 |
|
965 // Print to UI |
|
966 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
967 _LIT( KWhere, "In CancelUpdate" ); |
|
968 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KWhere ); |
|
969 // Print to log file |
|
970 iLog->Log( KWhere ); |
|
971 |
|
972 iIptvVodContenClient->CancelUpdate(); |
|
973 |
|
974 VCXLOGLO1("<<<CIptvVodContentApiTest::CancelUpdate"); |
|
975 return KErrNone; |
|
976 } |
|
977 |
|
978 // ----------------------------------------------------------------------------- |
|
979 // CIptvVodContentApiTest::SetLastPosition |
|
980 // ----------------------------------------------------------------------------- |
|
981 // |
|
982 TInt CIptvVodContentApiTest::SetLastPosition( CStifItemParser& aItem ) |
|
983 { |
|
984 VCXLOGLO1(">>>CIptvVodContentApiTest::SetLastPosition"); |
|
985 |
|
986 // Print to UI |
|
987 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
988 _LIT( KWhere, "In SetLastPosition" ); |
|
989 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KWhere ); |
|
990 // Print to log file |
|
991 iLog->Log( KWhere ); |
|
992 |
|
993 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
|
994 |
|
995 TInt contentId; |
|
996 TUint32 index; |
|
997 TUint32 position; |
|
998 |
|
999 TInt temp; |
|
1000 |
|
1001 if(KErrNone != aItem.GetNextInt(contentId)) |
|
1002 { |
|
1003 VCXLOGLO1("Parameter contentId missing!"); |
|
1004 VCXLOGLO1("<<<CIptvVodContentApiTest::SetLastPosition"); |
|
1005 return KErrArgument; |
|
1006 } |
|
1007 |
|
1008 if(KErrNone != aItem.GetNextInt(temp)) |
|
1009 { |
|
1010 VCXLOGLO1("Parameter index missing!"); |
|
1011 VCXLOGLO1("<<<CIptvVodContentApiTest::SetLastPosition"); |
|
1012 return KErrArgument; |
|
1013 } |
|
1014 index = temp; |
|
1015 |
|
1016 if(KErrNone != aItem.GetNextInt(temp)) |
|
1017 { |
|
1018 VCXLOGLO1("Parameter position missing!"); |
|
1019 VCXLOGLO1("<<<CIptvVodContentApiTest::SetLastPosition"); |
|
1020 return KErrArgument; |
|
1021 } |
|
1022 position = temp; |
|
1023 |
|
1024 TInt err = KErrNone; |
|
1025 TRAPD( err2, err = iIptvVodContenClient->SetLastPositionL( contentId, index, position ) ); |
|
1026 if(err2 != KErrNone) |
|
1027 { |
|
1028 VCXLOGLO2("* FAIL * SetLastPosition left with %d.", err); |
|
1029 err = err2; |
|
1030 } |
|
1031 else |
|
1032 if(err != KErrNone) |
|
1033 { |
|
1034 VCXLOGLO2("* FAIL * SetLastPosition returned an error: %d.", err); |
|
1035 } |
|
1036 |
|
1037 VCXLOGLO1("<<<CIptvVodContentApiTest::SetLastPosition"); |
|
1038 return err; |
|
1039 } |
|
1040 |
|
1041 // ----------------------------------------------------------------------------- |
|
1042 // CIptvVodContentApiTest::SetParentalControlAge |
|
1043 // ----------------------------------------------------------------------------- |
|
1044 // |
|
1045 TInt CIptvVodContentApiTest::SetParentalControlAge( CStifItemParser& aItem ) |
|
1046 { |
|
1047 VCXLOGLO1(">>>CIptvVodContentApiTest::SetParentalControlAge"); |
|
1048 |
|
1049 TInt age; |
|
1050 if(KErrNone != aItem.GetNextInt(age)) |
|
1051 { |
|
1052 VCXLOGLO1("Parameter age missing!"); |
|
1053 VCXLOGLO1("<<<CIptvVodContentApiTest::SetParentalControlAge"); |
|
1054 return KErrArgument; |
|
1055 } |
|
1056 |
|
1057 VCXLOGLO2("Set parental control age to: %d", age); |
|
1058 CRepository* cenRep = CRepository::NewL(KIptvCenRepUid); |
|
1059 |
|
1060 if (cenRep) |
|
1061 { |
|
1062 CleanupStack::PushL(cenRep); |
|
1063 TInt error = cenRep->Set(KIptvCenRepParentControlKey, age); |
|
1064 if (error != KErrNone) |
|
1065 { |
|
1066 VCXLOGLO2("Setting cenrep value returned error: %d", error); |
|
1067 } |
|
1068 CleanupStack::PopAndDestroy(cenRep); |
|
1069 } |
|
1070 VCXLOGLO1("<<<CIptvVodContentApiTest::SetParentalControlAge"); |
|
1071 return KErrNone; |
|
1072 } |
|
1073 |
|
1074 // ----------------------------------------------------------------------------- |
|
1075 // CIptvVodContentApiTest::SelectIapL |
|
1076 // ----------------------------------------------------------------------------- |
|
1077 // |
|
1078 TInt CIptvVodContentApiTest::SelectIapL( CStifItemParser& aItem ) |
|
1079 { |
|
1080 VCXLOGLO1(">>>CIptvVodContentApiTest::SelectIapL"); |
|
1081 |
|
1082 // Print to UI |
|
1083 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
1084 _LIT( KSetIap, "In SelectIapL" ); |
|
1085 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KSetIap ); |
|
1086 // Print to log file |
|
1087 iLog->Log( KSetIap ); |
|
1088 |
|
1089 TPtrC iAPName; |
|
1090 TUint32 iapId = 0; |
|
1091 TInt rv = KErrNone; |
|
1092 |
|
1093 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
|
1094 |
|
1095 if(aItem.GetNextString(iAPName) != KErrNone) |
|
1096 { |
|
1097 VCXLOGLO1("Can't read iap name from cfg file"); |
|
1098 VCXLOGLO1("<<<CIptvVodContentApiTest::SelectIapL"); |
|
1099 return KErrArgument; |
|
1100 } |
|
1101 |
|
1102 if(iIptvTestUtilities->GetIapIdL(iAPName, iapId) == FALSE) |
|
1103 { |
|
1104 VCXLOGLO2("Can't find iap, name: %S. Using invalid IAP id: 1000", &iAPName); |
|
1105 iapId = 1000; |
|
1106 } |
|
1107 else |
|
1108 { |
|
1109 VCXLOGLO3("Found iap, name: %S, id = %d", &iAPName,iapId); |
|
1110 } |
|
1111 |
|
1112 rv = SetIap(iapId); |
|
1113 |
|
1114 VCXLOGLO1("<<<CIptvVodContentApiTest::SelectIapL"); |
|
1115 return rv; |
|
1116 } |
|
1117 |
|
1118 // ----------------------------------------------------------------------------- |
|
1119 // CIptvVodContentApiTest::GetUpdateTimeL |
|
1120 // ----------------------------------------------------------------------------- |
|
1121 // |
|
1122 TInt CIptvVodContentApiTest::GetUpdateTimeL( CStifItemParser& aItem ) |
|
1123 { |
|
1124 VCXLOGLO1(">>>CIptvVodContentApiTest::GetUpdateTimeL"); |
|
1125 |
|
1126 // Print to UI |
|
1127 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
1128 _LIT( KGetUpdateTime, "In GetUpdateTimeL" ); |
|
1129 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KGetUpdateTime ); |
|
1130 // Print to log file |
|
1131 iLog->Log( KGetUpdateTime ); |
|
1132 |
|
1133 TInt rv = KErrNone; |
|
1134 |
|
1135 TInt maxMinutes = -1; |
|
1136 aItem.GetNextInt(maxMinutes); |
|
1137 |
|
1138 TTime updateTime; |
|
1139 |
|
1140 rv = TestGetUpdateTimeL(updateTime); |
|
1141 |
|
1142 _LIT(KDateString,"%D%M%Y%/0%1%/1%2%/2%3%/3"); |
|
1143 _LIT(KTimeString,"%-B%:0%H%:1%T%:2%S%.%*C2%:3%-B"); |
|
1144 TBuf<30> dateString; |
|
1145 TBuf<30> timeString; |
|
1146 |
|
1147 updateTime.FormatL(dateString, KDateString); |
|
1148 updateTime.FormatL(timeString, KTimeString); ; |
|
1149 |
|
1150 if(rv == KErrNone) |
|
1151 { |
|
1152 VCXLOGLO2("UpdateTime from server - date: %S", &dateString); |
|
1153 VCXLOGLO2("UpdateTime from server - time: %S", &timeString); |
|
1154 |
|
1155 if(maxMinutes >= 0) |
|
1156 { |
|
1157 TTime currentTime; |
|
1158 TTimeIntervalMinutes minutes; |
|
1159 |
|
1160 currentTime.UniversalTime(); |
|
1161 currentTime.MinutesFrom(updateTime, minutes); |
|
1162 |
|
1163 if(minutes.Int() > maxMinutes) |
|
1164 { |
|
1165 VCXLOGLO3("Time to last ECG update is more than specified maximum: %d. Minutes to last update: %d", maxMinutes, minutes.Int() ); |
|
1166 currentTime.FormatL(dateString, KDateString); |
|
1167 currentTime.FormatL(timeString, KTimeString); |
|
1168 VCXLOGLO2("Current time - date: %S", &dateString); |
|
1169 VCXLOGLO2("Current time - time: %S", &timeString); |
|
1170 rv = KErrGeneral; |
|
1171 } |
|
1172 } |
|
1173 } |
|
1174 else |
|
1175 { |
|
1176 VCXLOGLO2("GetUpdateTimeL returned an error: %d", rv); |
|
1177 } |
|
1178 |
|
1179 VCXLOGLO1("<<<CIptvVodContentApiTest::SelectIapL"); |
|
1180 return rv; |
|
1181 } |
|
1182 |
|
1183 // ----------------------------------------------------------------------------- |
|
1184 // CIptvVodContentApiTest::UpdateAvailableL |
|
1185 // ----------------------------------------------------------------------------- |
|
1186 // |
|
1187 TInt CIptvVodContentApiTest::UpdateAvailableL( CStifItemParser& aItem ) |
|
1188 { |
|
1189 VCXLOGLO1(">>>CIptvVodContentApiTest::UpdateAvailableL"); |
|
1190 |
|
1191 // Print to UI |
|
1192 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
1193 _LIT( KWhere, "In UpdateAvailableL" ); |
|
1194 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KWhere ); |
|
1195 // Print to log file |
|
1196 iLog->Log( KWhere ); |
|
1197 |
|
1198 TInt intArg; |
|
1199 User::LeaveIfError( aItem.GetNextInt( intArg ) ); |
|
1200 |
|
1201 TBool expectedAvailability = static_cast<TBool>( intArg ); |
|
1202 |
|
1203 TBool availability( EFalse ); |
|
1204 |
|
1205 TInt ret( KErrNone ); |
|
1206 TRAPD(error, ret = iIptvVodContenClient->UpdateAvailableL( availability )); |
|
1207 |
|
1208 if( ret != KErrNone || error != KErrNone ) |
|
1209 { |
|
1210 VCXLOGLO3("CIptvVodContentApiTest:: UpdateAvailableL left or returned error: returned: %d, leave: %d", ret, error); |
|
1211 if( error == KErrNone ) |
|
1212 { |
|
1213 error = ret; |
|
1214 } |
|
1215 } |
|
1216 else if( expectedAvailability != availability ) |
|
1217 { |
|
1218 VCXLOGLO2("CIptvVodContentApiTest:: UpdateAvailableL availability: %d, it's not what was expected!", availability); |
|
1219 error = KErrCorrupt; |
|
1220 } |
|
1221 |
|
1222 VCXLOGLO1("<<<CIptvVodContentApiTest::UpdateAvailableL"); |
|
1223 return error; |
|
1224 } |
|
1225 |
|
1226 |
|
1227 // ----------------------------------------------------------------------------- |
|
1228 // CIptvVodContentApiTest::CategoryCountL |
|
1229 // ----------------------------------------------------------------------------- |
|
1230 // |
|
1231 TInt CIptvVodContentApiTest::CategoryCountL( CStifItemParser& aItem ) |
|
1232 { |
|
1233 VCXLOGLO1(">>>CIptvVodContentApiTest::CategoryCountL"); |
|
1234 |
|
1235 // Print to UI |
|
1236 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
1237 _LIT( KWhere, "In CategoryCountL" ); |
|
1238 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KWhere ); |
|
1239 // Print to log file |
|
1240 iLog->Log( KWhere ); |
|
1241 |
|
1242 TInt expectedCount; |
|
1243 User::LeaveIfError( aItem.GetNextInt( expectedCount ) ); |
|
1244 |
|
1245 TInt error = TestCategoryCountL( expectedCount ); |
|
1246 |
|
1247 VCXLOGLO1("<<<CIptvVodContentApiTest::CategoryCountL"); |
|
1248 return error; |
|
1249 } |
|
1250 |
|
1251 // ----------------------------------------------------------------------------- |
|
1252 // CIptvVodContentApiTest::ContentCountL |
|
1253 // ----------------------------------------------------------------------------- |
|
1254 // |
|
1255 TInt CIptvVodContentApiTest::ContentCountL( CStifItemParser& aItem ) |
|
1256 { |
|
1257 VCXLOGLO1(">>>CIptvVodContentApiTest::ContentCountL"); |
|
1258 |
|
1259 // Print to UI |
|
1260 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
1261 _LIT( KWhere, "In CategoryCountL" ); |
|
1262 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KWhere ); |
|
1263 // Print to log file |
|
1264 iLog->Log( KWhere ); |
|
1265 |
|
1266 TInt expectedCount; |
|
1267 User::LeaveIfError( aItem.GetNextInt( expectedCount ) ); |
|
1268 |
|
1269 TInt error = TestContentCountL( expectedCount ); |
|
1270 |
|
1271 VCXLOGLO1("<<<CIptvVodContentApiTest::ContentCountL"); |
|
1272 return error; |
|
1273 } |
|
1274 |
|
1275 // ----------------------------------------------------------------------------- |
|
1276 // CIptvVodContentApiTest::SetSpecialAction |
|
1277 // ----------------------------------------------------------------------------- |
|
1278 // |
|
1279 TInt CIptvVodContentApiTest::SetSpecialAction( CStifItemParser& aItem ) |
|
1280 { |
|
1281 VCXLOGLO1(">>>CIptvVodContentApiTest::SetSpecialAction"); |
|
1282 |
|
1283 // Print to UI |
|
1284 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
1285 _LIT( KSetSpecialAction, "In SetSpecialAction" ); |
|
1286 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KSetSpecialAction ); |
|
1287 // Print to log file |
|
1288 iLog->Log( KSetSpecialAction ); |
|
1289 |
|
1290 TInt action(-1); |
|
1291 |
|
1292 aItem.GetNextInt(action); |
|
1293 |
|
1294 if(action < 0) |
|
1295 { |
|
1296 VCXLOGLO1("Incorrect parameter."); |
|
1297 VCXLOGLO1("<<<CIptvVodContentApiTest::SetSpecialAction"); |
|
1298 return KErrNone; |
|
1299 } |
|
1300 |
|
1301 iSpecialAction = static_cast<TIptvVodContentApiTestSpecialAction>(action); |
|
1302 |
|
1303 VCXLOGLO2("Action: %d", action); |
|
1304 |
|
1305 VCXLOGLO1("<<<CIptvVodContentApiTest::SetSpecialAction"); |
|
1306 return KErrNone; |
|
1307 } |
|
1308 |
|
1309 // ----------------------------------------------------------------------------- |
|
1310 // CIptvVodContentApiTest::SetMsgWhichToSignal |
|
1311 // ----------------------------------------------------------------------------- |
|
1312 // |
|
1313 TInt CIptvVodContentApiTest::SetMsgWhichToSignal( CStifItemParser& aItem ) |
|
1314 { |
|
1315 VCXLOGLO1(">>>CIptvVodContentApiTest::SetMsgWhichToSignal"); |
|
1316 |
|
1317 if(aItem.GetNextInt(iMsgWhichToSignal) != KErrNone) |
|
1318 { |
|
1319 VCXLOGLO1("* ERROR * Argument is wrong."); |
|
1320 VCXLOGLO1("<<<CIptvVodContentApiTest::SetMsgWhichToSignal"); |
|
1321 return KErrArgument; |
|
1322 } |
|
1323 |
|
1324 VCXLOGLO2("Will signal for %d msg from VOD.", iMsgWhichToSignal); |
|
1325 |
|
1326 VCXLOGLO1("<<<CIptvVodContentApiTest::SetMsgWhichToSignal"); |
|
1327 return KErrNone; |
|
1328 } |
|
1329 |
|
1330 // ----------------------------------------------------------------------------- |
|
1331 // CIptvVodContentApiTest::IgnoreMsg |
|
1332 // ----------------------------------------------------------------------------- |
|
1333 // |
|
1334 TInt CIptvVodContentApiTest::IgnoreMsg( CStifItemParser& aItem ) |
|
1335 { |
|
1336 VCXLOGLO1(">>>CIptvVodContentApiTest::IgnoreMsg"); |
|
1337 |
|
1338 if(aItem.GetNextInt(iIgnoreMsg) != KErrNone) |
|
1339 { |
|
1340 VCXLOGLO1("* ERROR * Argument is wrong."); |
|
1341 VCXLOGLO1("<<<CIptvVodContentApiTest::IgnoreMsg"); |
|
1342 return KErrArgument; |
|
1343 } |
|
1344 |
|
1345 VCXLOGLO2("Will ignore next %d msg from VOD.", iIgnoreMsg); |
|
1346 |
|
1347 VCXLOGLO1("<<<CIptvVodContentApiTest::IgnoreMsg"); |
|
1348 return KErrNone; |
|
1349 } |
|
1350 |
|
1351 // ----------------------------------------------------------------------------- |
|
1352 // CIptvVodContentApiTest::Destroy |
|
1353 // ----------------------------------------------------------------------------- |
|
1354 // |
|
1355 TInt CIptvVodContentApiTest::Destroy( CStifItemParser& /* aItem */ ) |
|
1356 { |
|
1357 VCXLOGLO1(">>>CIptvVodContentApiTest::Destroy"); |
|
1358 // Print to UI |
|
1359 _LIT( KIptvVodContentApiTest, "IptvVodContentApiTest" ); |
|
1360 _LIT( KDestroy, "In Destroy" ); |
|
1361 TestModuleIf().Printf( 0, KIptvVodContentApiTest, KDestroy ); |
|
1362 // Print to log file |
|
1363 iLog->Log( KDestroy ); |
|
1364 |
|
1365 //Script parameters: |
|
1366 //None |
|
1367 |
|
1368 TInt testCaseStatus = KErrNone; |
|
1369 |
|
1370 DeAllocateResources(); |
|
1371 |
|
1372 VCXLOGLO1("<<<CIptvVodContentApiTest::Destroy"); |
|
1373 return testCaseStatus; |
|
1374 } |
|
1375 |
|
1376 // ============================= CALLBACK FUNCTIONS =============================== |
|
1377 |
|
1378 // ----------------------------------------------------------------------------- |
|
1379 // CIptvVodContentApiTest::EcgCategoryListUpdated |
|
1380 // ----------------------------------------------------------------------------- |
|
1381 // |
|
1382 void CIptvVodContentApiTest::HandleEpgManagerMsgL(TInt aMsg, TInt aInfo, TIptvServiceId aServiceId) |
|
1383 { |
|
1384 VCXLOGLO1(">>>CIptvVodContentApiTest::HandleEpgManagerMsgL"); |
|
1385 |
|
1386 VCXLOGLO2("aMsg = %d", aMsg); |
|
1387 VCXLOGLO2("aInfo = %d", aInfo); |
|
1388 VCXLOGLO2("aServiceId = %d", aServiceId); |
|
1389 |
|
1390 TInt signalValue = KIptvTestNoSignal; |
|
1391 |
|
1392 switch(aMsg) |
|
1393 { |
|
1394 |
|
1395 // 137, aInfo is 0 |
|
1396 case KIptvVodUpdateNotStarted: |
|
1397 { |
|
1398 VCXLOGLO1("Message: KIptvVodUpdateNotStarted"); |
|
1399 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvVodUpdateNotStarted")); |
|
1400 |
|
1401 if(iSpecialAction == EIgnoreUpdateNotStarted) |
|
1402 { |
|
1403 VCXLOGLO1("Ignoring, special action set."); |
|
1404 iSpecialAction = ENone; |
|
1405 break; |
|
1406 } |
|
1407 |
|
1408 iIptvTestEcgUpdateInfo->EcgUpdateStop(aServiceId, aMsg, aInfo); |
|
1409 |
|
1410 signalValue = KIptvVodUpdateNotStarted; |
|
1411 } |
|
1412 break; |
|
1413 |
|
1414 // 139, aInfo is 0 |
|
1415 case KIptvErrorVodNoIap: |
|
1416 { |
|
1417 VCXLOGLO1("Message: KIptvErrorVodNoIap"); |
|
1418 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvErrorVodNoIap")); |
|
1419 signalValue = aMsg; |
|
1420 } |
|
1421 break; |
|
1422 |
|
1423 //// 136, aInfo is 0 |
|
1424 case KIptvVodUpdateStarted: |
|
1425 { |
|
1426 VCXLOGLO1("Message: KIptvVodUpdateStarted"); |
|
1427 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvVodUpdateStarted")); |
|
1428 //start 10 min timer to wait download |
|
1429 iIptvTestTimer->After(iTimeoutMinutes*60*1000000); |
|
1430 |
|
1431 iExpectedThumbnailCount = -1; |
|
1432 iThumbnailCount = -1; |
|
1433 |
|
1434 CIptvService* service = iIptvTestUtilities->GetServiceFromDb(aServiceId); |
|
1435 if(service) |
|
1436 { |
|
1437 CleanupStack::PushL(service); |
|
1438 iLastUpdateTimeFromService = service->GetEpgUpdateTimeL(); |
|
1439 CleanupStack::PopAndDestroy(service); |
|
1440 service = NULL; |
|
1441 } |
|
1442 else |
|
1443 { |
|
1444 iIptvTestEcgUpdateInfo->WriteLogL(_L("Error, could not get service.")); |
|
1445 } |
|
1446 } |
|
1447 |
|
1448 break; |
|
1449 |
|
1450 // 146, aInfo is 0 |
|
1451 case KIptvContentUpdateCompleted: |
|
1452 { |
|
1453 VCXLOGLO1("Message: KIptvContentUpdateCompleted"); |
|
1454 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvContentUpdateCompleted")); |
|
1455 } |
|
1456 break; |
|
1457 |
|
1458 // 143, parameter is service id |
|
1459 case KIptvServiceThumbnailDownloaded: |
|
1460 { |
|
1461 VCXLOGLO1("Message: KIptvServiceThumbnailDownloaded"); |
|
1462 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvServiceThumbnailDownloaded")); |
|
1463 iThumbnailCount++; |
|
1464 } |
|
1465 break; |
|
1466 |
|
1467 // 144, aInfo parameter is content id |
|
1468 case KIptvContentThumbnailDownloaded: |
|
1469 { |
|
1470 VCXLOGLO1("Message: KIptvContentThumbnailDownloaded"); |
|
1471 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvContentThumbnailDownloaded")); |
|
1472 iThumbnailCount++; |
|
1473 } |
|
1474 break; |
|
1475 |
|
1476 // 133, aInfo: KIptvRssParserError (145) or TIptvDlError (defined in this file) |
|
1477 case KIptvErrorEpgUpdateFailed: |
|
1478 { |
|
1479 VCXLOGLO1("Message: KIptvErrorEpgUpdateFailed"); |
|
1480 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvErrorEpgUpdateFailed")); |
|
1481 iIptvTestEcgUpdateInfo->EcgUpdateStop(aServiceId, aMsg, aInfo); |
|
1482 |
|
1483 if(iRetryCount > 0) |
|
1484 { |
|
1485 iRetryCount--; |
|
1486 VCXLOGLO2("CIptvVodContentApiTest: Retrying update! Retries left: %d", iRetryCount ); |
|
1487 iIptvTestEcgUpdateInfo->WriteLogL(_L("Retrying update!")); |
|
1488 User::LeaveIfError( TestUpdateEcg() ); |
|
1489 break; |
|
1490 } |
|
1491 |
|
1492 iEcgUpdateSuccesfull = EFalse; |
|
1493 |
|
1494 if(EIptvDlNoError != aInfo) |
|
1495 { |
|
1496 signalValue = aInfo; |
|
1497 } |
|
1498 else |
|
1499 { |
|
1500 // Be sure that error is handled if aInfo == 0 |
|
1501 signalValue = aMsg; |
|
1502 } |
|
1503 } |
|
1504 break; |
|
1505 |
|
1506 // 134, aInfo is 0 |
|
1507 case KIptvErrorEpgUpdateSuccessed: |
|
1508 { |
|
1509 VCXLOGLO1("Message: KIptvErrorEpgUpdateSuccessed"); |
|
1510 iIptvTestEcgUpdateInfo->WriteLogL(_L("Thubmnails downloaded: %d"), iThumbnailCount); |
|
1511 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvErrorEpgUpdateSuccessed")); |
|
1512 |
|
1513 CIptvService* service = iIptvTestUtilities->GetServiceFromDb(aServiceId); |
|
1514 if(service) |
|
1515 { |
|
1516 CleanupStack::PushL(service); |
|
1517 |
|
1518 TTime time = service->GetEpgUpdateTimeL(); |
|
1519 |
|
1520 _LIT(KDateString,"%D%M%Y%/0%1%/1%2%/2%3%/3"); |
|
1521 _LIT(KTimeString,"%-B%:0%H%:1%T%:2%S%.%*C2%:3%-B"); |
|
1522 TBuf<30> timeString; |
|
1523 |
|
1524 time.FormatL(timeString, KDateString); |
|
1525 time.FormatL(timeString, KTimeString); |
|
1526 VCXLOGLO2("Update time: %S", &timeString); |
|
1527 |
|
1528 time.UniversalTime(); |
|
1529 time.FormatL(timeString, KDateString); |
|
1530 time.FormatL(timeString, KTimeString); |
|
1531 VCXLOGLO2("Time now: %S", &timeString); |
|
1532 |
|
1533 if(iLastUpdateTimeFromService == time) |
|
1534 { |
|
1535 // last update time was not updated, return error |
|
1536 signalValue = KErrGeneral; |
|
1537 } |
|
1538 else |
|
1539 { |
|
1540 signalValue = KErrNone; |
|
1541 } |
|
1542 CleanupStack::PopAndDestroy(service); |
|
1543 service = NULL; |
|
1544 } |
|
1545 else |
|
1546 { |
|
1547 iIptvTestEcgUpdateInfo->WriteLogL(_L("Error, could not get service.")); |
|
1548 } |
|
1549 |
|
1550 iEcgUpdateSuccesfull = ETrue; |
|
1551 iIptvTestEcgUpdateInfo->EcgUpdateStop(aServiceId, aMsg, aInfo); |
|
1552 } |
|
1553 break; |
|
1554 |
|
1555 // 135, EPG manager messages sent to client (LIVE TV ONLY) |
|
1556 case KIptvErrorFailedToLoadPlugin: |
|
1557 { |
|
1558 VCXLOGLO1("Message: KIptvErrorFailedToLoadPlugin"); |
|
1559 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvErrorFailedToLoadPlugin")); |
|
1560 } |
|
1561 break; |
|
1562 |
|
1563 // 141, // aInfo is thumbnail count |
|
1564 case KIptvThumbnailCount: |
|
1565 { |
|
1566 VCXLOGLO2("Message: KIptvThumbnailCount: %d", aInfo); |
|
1567 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvThumbnailCount: %d"), aInfo); |
|
1568 |
|
1569 iExpectedThumbnailCount = aInfo; |
|
1570 iThumbnailCount = 0; |
|
1571 } |
|
1572 break; |
|
1573 |
|
1574 case KIptvErrorRssSearchStarted: // 170 |
|
1575 { |
|
1576 VCXLOGLO1("Message: KIptvErrorRssSearchStarted"); |
|
1577 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvErrorRssSearchStarted")); |
|
1578 //start 10 min timer to wait download |
|
1579 iIptvTestTimer->After(iTimeoutMinutes*60*1000000); |
|
1580 } |
|
1581 break; |
|
1582 |
|
1583 case KIptvErrorRssSearchFailed: // 171 |
|
1584 { |
|
1585 VCXLOGLO1("Message: KIptvErrorRssSearchFailed"); |
|
1586 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvErrorRssSearchFailed")); |
|
1587 |
|
1588 if(iRetryCount > 0) |
|
1589 { |
|
1590 iRetryCount--; |
|
1591 VCXLOGLO2("CIptvVodContentApiTest: Retrying search! Retries left: %d", iRetryCount ); |
|
1592 iIptvTestEcgUpdateInfo->WriteLogL(_L("Retrying search!")); |
|
1593 |
|
1594 TInt err = iIptvVodContenClient->Search( iSearchQuery ); |
|
1595 if(err != KErrNone) |
|
1596 { |
|
1597 VCXLOGLO2("* FAIL * Search returned an error: %d.", err); |
|
1598 User::Leave(err); |
|
1599 } |
|
1600 |
|
1601 break; |
|
1602 } |
|
1603 |
|
1604 iIptvTestEcgUpdateInfo->EcgUpdateStop(aServiceId, aMsg, aInfo); |
|
1605 |
|
1606 iEcgUpdateSuccesfull = EFalse; |
|
1607 |
|
1608 if(EIptvDlNoError != aInfo) |
|
1609 { |
|
1610 signalValue = aInfo; |
|
1611 } |
|
1612 else |
|
1613 { |
|
1614 //be sure that error is handled if aInfo == 0 |
|
1615 signalValue = aMsg; |
|
1616 } |
|
1617 } |
|
1618 break; |
|
1619 |
|
1620 case KIptvErrorRssSearchSucceed: // 172 |
|
1621 { |
|
1622 VCXLOGLO1("Message: KIptvErrorRssSearchSucceed"); |
|
1623 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvErrorRssSearchSucceed")); |
|
1624 |
|
1625 iEcgUpdateSuccesfull = ETrue; |
|
1626 iIptvTestEcgUpdateInfo->EcgUpdateStop(aServiceId, aMsg, aInfo); |
|
1627 signalValue = KErrNone; |
|
1628 } |
|
1629 break; |
|
1630 |
|
1631 case KIptvErrorRssSearchNoIap: // 173 |
|
1632 { |
|
1633 VCXLOGLO1("Message: KIptvErrorRssSearchNoIap"); |
|
1634 iIptvTestEcgUpdateInfo->WriteLogL(_L("KIptvErrorRssSearchNoIap")); |
|
1635 signalValue = aMsg; |
|
1636 } |
|
1637 break; |
|
1638 |
|
1639 case KIptvRssSearchContentUpdateCompleted: |
|
1640 { |
|
1641 VCXLOGLO1("Message: KIptvRssSearchContentUpdateCompleted"); |
|
1642 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvRssSearchContentUpdateCompleted")); |
|
1643 } |
|
1644 break; |
|
1645 |
|
1646 case KIptvRssSearchThumbnailCount: |
|
1647 { |
|
1648 VCXLOGLO2("Message: KIptvThumbnailCount: %d", aInfo); |
|
1649 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvThumbnailCount: %d"), aInfo); |
|
1650 |
|
1651 iExpectedThumbnailCount = aInfo; |
|
1652 iThumbnailCount = 0; |
|
1653 } |
|
1654 break; |
|
1655 |
|
1656 case KIptvRssSearchContentThumbnailDownloaded: |
|
1657 { |
|
1658 VCXLOGLO2("Message: KIptvRssSearchContentThumbnailDownloaded, id %d", aInfo); |
|
1659 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: KIptvRssSearchContentThumbnailDownloaded, id %d"), aInfo); |
|
1660 |
|
1661 ++iThumbnailCount; |
|
1662 } |
|
1663 break; |
|
1664 |
|
1665 #ifdef __S60_50__ |
|
1666 case KIptvErrorEpgUpdateStopped: |
|
1667 { |
|
1668 // Do nothing right now, test script is signaled in other cases. |
|
1669 VCXLOGLO1("Message: KIptvErrorEpgUpdateStopped"); |
|
1670 iIptvTestEcgUpdateInfo->WriteLogL(_L("KIptvErrorEpgUpdateStopped")); |
|
1671 } |
|
1672 break; |
|
1673 #endif |
|
1674 |
|
1675 default: |
|
1676 { |
|
1677 VCXLOGLO1("Unknown message, panicing"); |
|
1678 iIptvTestEcgUpdateInfo->WriteLogL(_L("Message: UNKNOWN: aMsg: %d, aInfo: %d, aServiceId: %d"), aMsg, aInfo, aServiceId); |
|
1679 User::Panic(_L("CIptvVodContentApiTest: Unknown msg"), KErrGeneral); |
|
1680 } |
|
1681 break; |
|
1682 |
|
1683 } // Switch |
|
1684 |
|
1685 // Is there message which will be signaled to the script? |
|
1686 if(signalValue != KIptvTestNoSignal) |
|
1687 { |
|
1688 // Is the message to be ignored |
|
1689 if(aMsg != iIgnoreMsg) |
|
1690 { |
|
1691 AsyncCompleted(signalValue); |
|
1692 } |
|
1693 iIgnoreMsg = KIptvTestNoSignal; |
|
1694 } |
|
1695 // Has script set msg which must be signaled? |
|
1696 else if(iMsgWhichToSignal != -1 && iMsgWhichToSignal == aMsg) |
|
1697 { |
|
1698 AsyncCompleted(aMsg); |
|
1699 iMsgWhichToSignal = -1; |
|
1700 } |
|
1701 |
|
1702 VCXLOGLO1("<<<CIptvVodContentApiTest::HandleEpgManagerMsgL"); |
|
1703 } |
|
1704 |
|
1705 // ----------------------------------------------------------------------------- |
|
1706 // CIptvVodContentApiTest::TimerComplete |
|
1707 // ----------------------------------------------------------------------------- |
|
1708 // |
|
1709 void CIptvVodContentApiTest::TimerComplete(TInt aTimerId, TInt aError) |
|
1710 { |
|
1711 VCXLOGLO1(">>>CIptvVodContentApiTest::TimerComplete"); |
|
1712 VCXLOGLO2("aTimerId = %d",aTimerId); |
|
1713 VCXLOGLO2("aError = %d",aError); |
|
1714 |
|
1715 if(aError == KErrNone) |
|
1716 { |
|
1717 iLog->Log(_L("*** Fail *** TimeOut!!!")); |
|
1718 aError = KErrTimedOut; |
|
1719 iIptvTestEcgUpdateInfo->EcgUpdateStop(iServiceId, aError, 0); |
|
1720 } |
|
1721 VCXLOGLO2("aError = %d",aError); |
|
1722 AsyncCompleted(aError); |
|
1723 VCXLOGLO1("<<<CIptvVodContentApiTest::TimerComplete"); |
|
1724 } |
|
1725 |
|
1726 // ----------------------------------------------------------------------------- |
|
1727 // CIptvVodContentApiTest::AsyncCompleted |
|
1728 // ----------------------------------------------------------------------------- |
|
1729 // |
|
1730 void CIptvVodContentApiTest::AsyncCompleted(TInt aError) |
|
1731 { |
|
1732 VCXLOGLO1(">>>CIptvVodContentApiTest::AsyncCompleted"); |
|
1733 VCXLOGLO2("aError = %d", aError); |
|
1734 |
|
1735 iIptvTestTimer->Cancel(); |
|
1736 |
|
1737 if(iSpecialAction == EUpdateSucceedsAlways) |
|
1738 { |
|
1739 VCXLOGLO1("Signaling KErrNone, special action EUpdateSucceedsAlways set."); |
|
1740 aError = KErrNone; |
|
1741 } |
|
1742 |
|
1743 Signal(aError); |
|
1744 VCXLOGLO1("<<<CIptvVodContentApiTest::AsyncCompleted"); |
|
1745 } |
|
1746 |
|
1747 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
1748 |
|
1749 // End of File |