|
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 "VCXVodContentApiTest.h" |
|
20 #include "VCXTestLog.h" |
|
21 #include "CIptvTestTimer.h" |
|
22 #include "CIptvMyVideosGlobalFileId.h" |
|
23 #include "CIptvTestUtilities.h" |
|
24 #include "CIptvTestEcgUpdateInfo.h" |
|
25 #include "CIptvMediaContent.h" |
|
26 |
|
27 #include <mmf/common/mmfcontrollerpluginresolver.h> |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CIptvVodContentApiTest::TestGetEcgList |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 TInt CIptvVodContentApiTest::TestGetEcgList(TIptvCategoryId aCategoryId, TDesC& aSearchString, TUint32 aFrom, TUint32 aAmount) |
|
34 { |
|
35 VCXLOGLO1(">>>CIptvVodContentApiTest::TestGetEcgList"); |
|
36 TInt testCaseStatus(KErrNone); |
|
37 |
|
38 if(!iIptvVodContenClient) |
|
39 { |
|
40 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
41 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
42 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgList"); |
|
43 return KErrGeneral; |
|
44 } |
|
45 |
|
46 RPointerArray<CIptvVodContentContentBriefDetails> data; |
|
47 CleanupResetAndDestroyPushL(data); |
|
48 TUint32 totalAmount = 0; |
|
49 |
|
50 TRAPD(err, testCaseStatus = iIptvVodContenClient->GetEcgListL(aCategoryId, aSearchString, aFrom, aAmount, totalAmount, data)); |
|
51 if(err != KErrNone) |
|
52 { |
|
53 VCXLOGLO2("* FAIL * GetEcgListL caused a leave: %d.", err); |
|
54 testCaseStatus = err; |
|
55 } |
|
56 else |
|
57 if(testCaseStatus != KErrNone) |
|
58 { |
|
59 VCXLOGLO2("* FAIL * GetEcgListL returned an error: %d.", testCaseStatus); |
|
60 } |
|
61 else |
|
62 { |
|
63 VCXLOGLO2("totalAmount = %d", totalAmount); |
|
64 |
|
65 for (TInt i = 0; i < data.Count(); i++) |
|
66 { |
|
67 PrintVodContentBriefDetails(*(data[i])); |
|
68 } |
|
69 } |
|
70 |
|
71 CleanupStack::PopAndDestroy(&data); |
|
72 |
|
73 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgList"); |
|
74 return testCaseStatus; |
|
75 } |
|
76 |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CIptvVodContentApiTest::TestGetEcgCategoryList |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 TInt CIptvVodContentApiTest::TestGetEcgCategoryList(TIptvCategoryId aParentCategoryId) |
|
83 { |
|
84 VCXLOGLO1(">>>CIptvVodContentApiTest::TestGetEcgCategoryList"); |
|
85 TInt testCaseStatus(KErrNone); |
|
86 |
|
87 if(!iIptvVodContenClient) |
|
88 { |
|
89 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
90 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
91 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgList"); |
|
92 return KErrGeneral; |
|
93 } |
|
94 |
|
95 RPointerArray<CIptvVodContentCategoryBriefDetails> data; |
|
96 CleanupResetAndDestroyPushL(data); |
|
97 |
|
98 TRAPD(err, testCaseStatus = iIptvVodContenClient->GetEcgCategoryListL(aParentCategoryId, data)); |
|
99 if(err != KErrNone) |
|
100 { |
|
101 VCXLOGLO2("* FAIL * GetEcgCategoryListL caused a leave: %d.", err); |
|
102 testCaseStatus = err; |
|
103 } |
|
104 else |
|
105 if(testCaseStatus != KErrNone) |
|
106 { |
|
107 VCXLOGLO2("* FAIL * GetEcgCategoryListL returned an error: %d.", testCaseStatus); |
|
108 } |
|
109 else |
|
110 { |
|
111 TInt count = data.Count(); |
|
112 |
|
113 for (TInt i = 0; i < count; i++) |
|
114 { |
|
115 PrintVodContentCategoryBriefDetails(*(data[i])); |
|
116 } |
|
117 } |
|
118 |
|
119 CleanupStack::PopAndDestroy(&data); |
|
120 |
|
121 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgCategoryList"); |
|
122 return testCaseStatus; |
|
123 } |
|
124 |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CIptvVodContentApiTest::TestGetEcgCategoryDetails |
|
127 // ----------------------------------------------------------------------------- |
|
128 // |
|
129 TInt CIptvVodContentApiTest::TestGetEcgCategoryDetails(TIptvCategoryId aCategoryId) |
|
130 { |
|
131 VCXLOGLO1(">>>CIptvVodContentApiTest::TestGetCategoryDetails"); |
|
132 TInt testCaseStatus(KErrNone); |
|
133 |
|
134 if(!iIptvVodContenClient) |
|
135 { |
|
136 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
137 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
138 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgList"); |
|
139 return KErrGeneral; |
|
140 } |
|
141 |
|
142 CIptvVodContentCategoryBriefDetails* data = CIptvVodContentCategoryBriefDetails::NewL(); |
|
143 CleanupStack::PushL(data); |
|
144 |
|
145 // GetCategoryDetailsL is not supported for search category |
|
146 if( aCategoryId != KIptvRssSearchCategoryId ) |
|
147 { |
|
148 TRAPD(err, testCaseStatus = iIptvVodContenClient->GetCategoryDetailsL(aCategoryId, *data)); |
|
149 if(err != KErrNone) |
|
150 { |
|
151 VCXLOGLO2("* FAIL * GetCategoryDetailsL caused a leave: %d.", err); |
|
152 testCaseStatus = err; |
|
153 } |
|
154 else |
|
155 if(testCaseStatus != KErrNone) |
|
156 { |
|
157 VCXLOGLO2("* FAIL * GetCategoryDetailsL returned an error: %d.", testCaseStatus); |
|
158 } |
|
159 else |
|
160 { |
|
161 PrintVodContentCategoryBriefDetails(*data); |
|
162 } |
|
163 } |
|
164 CleanupStack::PopAndDestroy(data); |
|
165 |
|
166 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetCategoryDetails"); |
|
167 return testCaseStatus; |
|
168 } |
|
169 |
|
170 // ----------------------------------------------------------------------------- |
|
171 // CIptvVodContentApiTest::TestGetEcgAllList |
|
172 // ----------------------------------------------------------------------------- |
|
173 // |
|
174 TInt CIptvVodContentApiTest::TestGetEcgAllList(TDesC& aSearchString, TUint32 aFrom, TUint32 aAmount) |
|
175 { |
|
176 VCXLOGLO1(">>>CIptvVodContentApiTest::TestGetEcgAllList"); |
|
177 TInt testCaseStatus(KErrNone); |
|
178 |
|
179 if(!iIptvVodContenClient) |
|
180 { |
|
181 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
182 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
183 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgList"); |
|
184 return KErrGeneral; |
|
185 } |
|
186 |
|
187 RPointerArray<CIptvVodContentContentBriefDetails> data; |
|
188 CleanupResetAndDestroyPushL(data); |
|
189 |
|
190 TUint32 total=0; |
|
191 |
|
192 TRAPD(err, testCaseStatus = iIptvVodContenClient->GetEcgAllListL(aSearchString, aFrom, aAmount, total, data)); |
|
193 if(err != KErrNone) |
|
194 { |
|
195 VCXLOGLO2("* FAIL * GetEcgAllListL caused a leave: %d.", err); |
|
196 testCaseStatus = err; |
|
197 } |
|
198 else |
|
199 if(testCaseStatus != KErrNone) |
|
200 { |
|
201 VCXLOGLO2("* FAIL * GetEcgAllListL returned an error: %d.", testCaseStatus); |
|
202 } |
|
203 else |
|
204 { |
|
205 VCXLOGLO2("totalAmount = %d", total); |
|
206 |
|
207 for (TInt i = 0; i < data.Count(); i++) |
|
208 { |
|
209 if(!(data[i])) |
|
210 { |
|
211 VCXLOGLO2("data at %d is NULL!", i); |
|
212 testCaseStatus = KErrCorrupt; |
|
213 } |
|
214 else |
|
215 { |
|
216 PrintVodContentBriefDetails(*(data[i])); |
|
217 } |
|
218 } |
|
219 } |
|
220 |
|
221 CleanupStack::PopAndDestroy(&data); |
|
222 |
|
223 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgAllList"); |
|
224 return testCaseStatus; |
|
225 } |
|
226 |
|
227 // ----------------------------------------------------------------------------- |
|
228 // CIptvVodContentApiTest::TestGetParentCategory |
|
229 // ----------------------------------------------------------------------------- |
|
230 // |
|
231 TInt CIptvVodContentApiTest::TestGetParentCategory(TIptvCategoryId aParentCategoryId) |
|
232 { |
|
233 VCXLOGLO2(">>>CIptvVodContentApiTest::TestGetParentCategory: aParentCategoryId = %d",aParentCategoryId ); |
|
234 TInt testCaseStatus(KErrNone); |
|
235 TInt rv = KErrNone; |
|
236 TIptvCategoryId parent = 0; |
|
237 |
|
238 if(!iIptvVodContenClient) |
|
239 { |
|
240 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
241 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
242 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgList"); |
|
243 return KErrGeneral; |
|
244 } |
|
245 |
|
246 RPointerArray<CIptvVodContentCategoryBriefDetails> data; |
|
247 CleanupResetAndDestroyPushL(data); |
|
248 |
|
249 VCXLOGLO2("Getting category list for: %d.", aParentCategoryId); |
|
250 TRAPD(err, testCaseStatus = iIptvVodContenClient->GetEcgCategoryListL(aParentCategoryId, data)); |
|
251 if(err != KErrNone) |
|
252 { |
|
253 VCXLOGLO2("* FAIL * GetEcgCategoryListL caused a leave: %d.", err); |
|
254 testCaseStatus = err; |
|
255 CleanupStack::PopAndDestroy(&data); |
|
256 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetParentCategory"); |
|
257 return err; |
|
258 } |
|
259 |
|
260 if(testCaseStatus != KErrNone) |
|
261 { |
|
262 VCXLOGLO2("* FAIL * GetEcgCategoryListL returned an error: %d.", testCaseStatus); |
|
263 CleanupStack::PopAndDestroy(&data); |
|
264 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetParentCategory"); |
|
265 return err; |
|
266 } |
|
267 |
|
268 TInt count = data.Count(); |
|
269 |
|
270 for (TInt i = 0; i < count; i++) |
|
271 { |
|
272 VCXLOGLO2("categoryid = %d", data[i]->iCategoryId); |
|
273 TRAP(err, rv = iIptvVodContenClient->GetParentCategoryL(data[i]->iCategoryId, parent)); |
|
274 VCXLOGLO2("Parent = %d", parent); |
|
275 |
|
276 if(err != KErrNone) |
|
277 { |
|
278 VCXLOGLO2("* FAIL * GetParentCategoryL caused a leave: %d.", err); |
|
279 testCaseStatus = err; |
|
280 break; |
|
281 } |
|
282 if(rv != KErrNone) |
|
283 { |
|
284 VCXLOGLO2("CIptvVodContentApiTest::TestGetParentCategory: GetParentCategoryL returned an error: %d", rv); |
|
285 testCaseStatus = rv; |
|
286 break; |
|
287 } |
|
288 if(parent != aParentCategoryId) |
|
289 { |
|
290 VCXLOGLO1("CIptvVodContentApiTest::TestGetParentCategory: ParentCategory id doesn't match"); |
|
291 testCaseStatus = KErrGeneral; |
|
292 break; |
|
293 } |
|
294 |
|
295 } |
|
296 |
|
297 |
|
298 CleanupStack::PopAndDestroy(&data); |
|
299 |
|
300 if(count == 0) |
|
301 { |
|
302 VCXLOGLO1("No Categories found!!!"); |
|
303 } |
|
304 |
|
305 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetParentCategory"); |
|
306 return testCaseStatus; |
|
307 } |
|
308 |
|
309 // ----------------------------------------------------------------------------- |
|
310 // CIptvVodContentApiTest::TestVerifyAllCategoryContentL |
|
311 // ----------------------------------------------------------------------------- |
|
312 // |
|
313 TInt CIptvVodContentApiTest::TestVerifyAllCategoryContentL(TIptvCategoryId aParentCategoryId) |
|
314 { |
|
315 // KIptvVodContentCategoryRootId |
|
316 VCXLOGLO2(">>>CIptvVodContentApiTest::TestVerifyAllCategoryContentL: aParentCategoryId = %d",aParentCategoryId ); |
|
317 |
|
318 TInt testCaseStatus(KErrNone); |
|
319 |
|
320 if(!iIptvVodContenClient) |
|
321 { |
|
322 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
323 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
324 VCXLOGLO1("<<<CIptvVodContentApiTest::TestVerifyAllCategoryContentL"); |
|
325 return KErrGeneral; |
|
326 } |
|
327 |
|
328 RPointerArray<CIptvVodContentCategoryBriefDetails> categoryList; |
|
329 CleanupResetAndDestroyPushL(categoryList); |
|
330 |
|
331 testCaseStatus = iIptvVodContenClient->GetEcgCategoryListL(aParentCategoryId, categoryList); |
|
332 if(testCaseStatus != KErrNone) |
|
333 { |
|
334 VCXLOGLO2("* FAIL * GetEcgCategoryListL returned an error: %d.", testCaseStatus); |
|
335 CleanupStack::PopAndDestroy(&categoryList); |
|
336 VCXLOGLO1("<<<CIptvVodContentApiTest::TestVerifyAllCategoryContentL"); |
|
337 return testCaseStatus; |
|
338 } |
|
339 |
|
340 TInt count = categoryList.Count(); |
|
341 |
|
342 for (TInt i = 0; i < count; i++) |
|
343 { |
|
344 VCXLOGLO2("categoryid = %d", categoryList[i]->iCategoryId); |
|
345 |
|
346 PrintVodContentCategoryBriefDetails( *categoryList[i] ); |
|
347 |
|
348 testCaseStatus = TestGetEcgCategoryDetails(categoryList[i]->iCategoryId); |
|
349 if(testCaseStatus != KErrNone) break; |
|
350 |
|
351 RPointerArray<CIptvVodContentContentBriefDetails> ecgList; |
|
352 CleanupResetAndDestroyPushL(ecgList); |
|
353 TUint32 totalAmount = 0; |
|
354 |
|
355 TBuf<10> searchString(_L("") ); |
|
356 testCaseStatus = iIptvVodContenClient->GetEcgListL(categoryList[i]->iCategoryId, searchString, 0, 0, totalAmount, ecgList); |
|
357 if(testCaseStatus != KErrNone) |
|
358 { |
|
359 VCXLOGLO2("* FAIL * GetEcgListL returned an error: %d.", testCaseStatus); |
|
360 CleanupStack::PopAndDestroy(&ecgList); |
|
361 break; |
|
362 } |
|
363 |
|
364 VCXLOGLO2("totalAmount = %d", totalAmount); |
|
365 |
|
366 for (TInt e = 0; e < ecgList.Count(); e++) |
|
367 { |
|
368 PrintVodContentBriefDetails(*(ecgList[e])); |
|
369 |
|
370 CIptvVodContentContentFullDetails* contentDetails = CIptvVodContentContentFullDetails::NewL(); |
|
371 |
|
372 CleanupStack::PushL(contentDetails); |
|
373 |
|
374 testCaseStatus = iIptvVodContenClient->GetContentDetailsL(ecgList[e]->iContentId, *contentDetails); |
|
375 if(testCaseStatus != KErrNone) |
|
376 { |
|
377 VCXLOGLO2("* FAIL * GetContentDetailsL returned an error: %d.", testCaseStatus); |
|
378 CleanupStack::PopAndDestroy(contentDetails); |
|
379 CleanupStack::PopAndDestroy(&ecgList); |
|
380 i = 100000; |
|
381 break; |
|
382 } |
|
383 |
|
384 PrintVodContentFullDetails(ecgList[e]->iContentId, *contentDetails); |
|
385 |
|
386 CleanupStack::PopAndDestroy(contentDetails); |
|
387 |
|
388 } |
|
389 |
|
390 CleanupStack::PopAndDestroy(&ecgList); |
|
391 } |
|
392 |
|
393 CleanupStack::PopAndDestroy(&categoryList); |
|
394 |
|
395 if(count == 0) |
|
396 { |
|
397 VCXLOGLO1("No Categories found!!!"); |
|
398 } |
|
399 |
|
400 VCXLOGLO1("<<<CIptvVodContentApiTest::TestVerifyAllCategoryContentL"); |
|
401 return testCaseStatus; |
|
402 } |
|
403 |
|
404 // ----------------------------------------------------------------------------- |
|
405 // CIptvVodContentApiTest::TestGetContentDetailsList |
|
406 // ----------------------------------------------------------------------------- |
|
407 // |
|
408 TInt CIptvVodContentApiTest::TestGetContentDetailsList(TIptvContentId aContentId) |
|
409 { |
|
410 VCXLOGLO1(">>>CIptvVodContentApiTest::TestGetContentDetailsList"); |
|
411 TInt testCaseStatus(KErrNone); |
|
412 |
|
413 if(!iIptvVodContenClient) |
|
414 { |
|
415 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
416 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
417 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgList"); |
|
418 return KErrGeneral; |
|
419 } |
|
420 |
|
421 CIptvVodContentContentFullDetails* contentDetails = CIptvVodContentContentFullDetails::NewL(); |
|
422 |
|
423 CleanupStack::PushL(contentDetails); |
|
424 |
|
425 TRAPD(err, testCaseStatus = iIptvVodContenClient->GetContentDetailsL(aContentId, *contentDetails)); |
|
426 if(err != KErrNone) |
|
427 { |
|
428 VCXLOGLO2("* FAIL * GetContentDetailsL caused a leave: %d.", err); |
|
429 testCaseStatus = err; |
|
430 } |
|
431 else |
|
432 if(testCaseStatus != KErrNone) |
|
433 { |
|
434 VCXLOGLO2("* FAIL * GetContentDetailsL returned an error: %d.", testCaseStatus); |
|
435 } |
|
436 else |
|
437 { |
|
438 PrintVodContentFullDetails(aContentId, *contentDetails); |
|
439 } |
|
440 |
|
441 CleanupStack::PopAndDestroy(contentDetails); |
|
442 |
|
443 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetContentDetailsList"); |
|
444 return testCaseStatus; |
|
445 } |
|
446 |
|
447 |
|
448 // ----------------------------------------------------------------------------- |
|
449 // CIptvVodContentApiTest::TestUpdateEcg |
|
450 // ----------------------------------------------------------------------------- |
|
451 // |
|
452 TInt CIptvVodContentApiTest::TestUpdateEcg( ) |
|
453 { |
|
454 VCXLOGLO1(">>>CIptvVodContentApiTest::TestUpdateEcg"); |
|
455 TInt testCaseStatus(KErrNone); |
|
456 |
|
457 if(!iIptvVodContenClient) |
|
458 { |
|
459 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
460 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
461 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetEcgList"); |
|
462 return KErrGeneral; |
|
463 } |
|
464 TRAPD(err, testCaseStatus = iIptvVodContenClient->UpdateEcgL( )); |
|
465 |
|
466 if(err != KErrNone) |
|
467 { |
|
468 VCXLOGLO2("* FAIL * UpdateEcgL caused a leave: %d.", err); |
|
469 testCaseStatus = err; |
|
470 } |
|
471 else |
|
472 if(testCaseStatus != KErrNone) |
|
473 { |
|
474 VCXLOGLO2("* FAIL * UpdateEcgL returned an error: %d.", testCaseStatus); |
|
475 } |
|
476 else |
|
477 { |
|
478 iIptvTestEcgUpdateInfo->EcgUpdateStart(iServiceId, iIapId); |
|
479 } |
|
480 |
|
481 VCXLOGLO1("<<<CIptvVodContentApiTest::TestUpdateEcg"); |
|
482 return testCaseStatus; |
|
483 } |
|
484 |
|
485 // ----------------------------------------------------------------------------- |
|
486 // CIptvVodContentApiTest::TestCategoryCount |
|
487 // ----------------------------------------------------------------------------- |
|
488 // |
|
489 TInt CIptvVodContentApiTest::TestCategoryCountL( TInt aExpectedCount ) |
|
490 { |
|
491 // KIptvVodContentCategoryRootId |
|
492 VCXLOGLO1(">>>CIptvVodContentApiTest::TestCategoryCountL"); |
|
493 |
|
494 TInt err( KErrNone ); |
|
495 |
|
496 if( !iIptvVodContenClient ) |
|
497 { |
|
498 err = KErrNotReady; |
|
499 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
500 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
501 } |
|
502 |
|
503 RPointerArray<CIptvVodContentCategoryBriefDetails> categoryList; |
|
504 CleanupResetAndDestroyPushL( categoryList ); |
|
505 |
|
506 err = iIptvVodContenClient->GetEcgCategoryListL( 0 /* all categories */, categoryList ); |
|
507 if( err!= KErrNone ) |
|
508 { |
|
509 VCXLOGLO2("* FAIL * GetEcgCategoryListL returned an error: %d.", err); |
|
510 } |
|
511 else |
|
512 { |
|
513 if( categoryList.Count() != aExpectedCount ) |
|
514 { |
|
515 VCXLOGLO3("* FAIL * Count of categories (%d) is not expected (%d).", categoryList.Count(), aExpectedCount ); |
|
516 } |
|
517 } |
|
518 CleanupStack::PopAndDestroy( &categoryList ); |
|
519 |
|
520 VCXLOGLO1("<<<CIptvVodContentApiTest::TestCategoryCountL"); |
|
521 return err; |
|
522 } |
|
523 |
|
524 // ----------------------------------------------------------------------------- |
|
525 // CIptvVodContentApiTest::TestContentCount |
|
526 // ----------------------------------------------------------------------------- |
|
527 // |
|
528 TInt CIptvVodContentApiTest::TestContentCountL( TInt aExpectedCount ) |
|
529 { |
|
530 // KIptvVodContentCategoryRootId |
|
531 VCXLOGLO1(">>>CIptvVodContentApiTest::TestContentCountL"); |
|
532 |
|
533 TInt err( KErrNone ); |
|
534 |
|
535 if( !iIptvVodContenClient ) |
|
536 { |
|
537 VCXLOGLO1("No iIptvVodContenClient instance, error in testlogic"); |
|
538 iLog->Log(_L("*** FAIL *** No iIptvVodContenClient instance, error in testlogic")); |
|
539 User::Leave( KErrNotReady ); |
|
540 } |
|
541 |
|
542 RPointerArray<CIptvVodContentCategoryBriefDetails> categoryList; |
|
543 CleanupResetAndDestroyPushL( categoryList ); |
|
544 |
|
545 err = iIptvVodContenClient->GetEcgCategoryListL( 0 /* all categories */, categoryList ); |
|
546 |
|
547 TInt contentCount( 0 ); |
|
548 |
|
549 TInt categoryCount = categoryList.Count(); |
|
550 |
|
551 if( err!= KErrNone ) |
|
552 { |
|
553 VCXLOGLO2("* FAIL * GetEcgCategoryListL returned an error: %d.", err); |
|
554 } |
|
555 else |
|
556 for (TInt i = 0; i < categoryCount; i++) |
|
557 { |
|
558 RPointerArray<CIptvVodContentContentBriefDetails> ecgList; |
|
559 CleanupResetAndDestroyPushL(ecgList); |
|
560 |
|
561 TBuf<10> searchString(_L("") ); |
|
562 TUint32 totalAmount; |
|
563 err = iIptvVodContenClient->GetEcgListL( categoryList[i]->iCategoryId, searchString, 0, 0, totalAmount, ecgList ); |
|
564 if(err != KErrNone) |
|
565 { |
|
566 VCXLOGLO2("* FAIL * GetEcgListL returned an error: %d.", err); |
|
567 CleanupStack::PopAndDestroy( &ecgList ); |
|
568 break; |
|
569 } |
|
570 |
|
571 VCXLOGLO4("Category: %d content count: %d (ta: %d).", i, ecgList.Count(), totalAmount); |
|
572 |
|
573 contentCount += totalAmount; |
|
574 CleanupStack::PopAndDestroy( &ecgList ); |
|
575 } |
|
576 |
|
577 if( err == KErrNone ) |
|
578 { |
|
579 if( contentCount != aExpectedCount ) |
|
580 { |
|
581 VCXLOGLO3("* FAIL * Count of content (%d) is not expected (%d).", contentCount, aExpectedCount ); |
|
582 err = KErrCorrupt; |
|
583 } |
|
584 } |
|
585 CleanupStack::PopAndDestroy( &categoryList ); |
|
586 |
|
587 VCXLOGLO1("<<<CIptvVodContentApiTest::TestContentCountL"); |
|
588 return err; |
|
589 } |
|
590 |
|
591 // ----------------------------------------------------------------------------- |
|
592 // CIptvVodContentApiTest::CreateInstanceL |
|
593 // ----------------------------------------------------------------------------- |
|
594 // |
|
595 TInt CIptvVodContentApiTest::CreateInstance(TDesC& serviceName) |
|
596 { |
|
597 VCXLOGLO1(">>>CIptvVodContentApiTest::CreateInstanceL"); |
|
598 TInt rv(KErrNone); |
|
599 TInt error(KErrNone); |
|
600 |
|
601 TRAP(error, iIptvTestUtilities = CIptvTestUtilities::NewL( )); |
|
602 if(KErrNone != error)//Leave |
|
603 { |
|
604 if(iIptvTestUtilities) |
|
605 { |
|
606 delete iIptvTestUtilities; |
|
607 iIptvTestUtilities = NULL; |
|
608 } |
|
609 VCXLOGLO1("Leave in creating CIptvTestUtilities instance"); |
|
610 iLog->Log(_L("*** Fail *** Leave in creating CIptvTestUtilities instance")); |
|
611 return error; |
|
612 } |
|
613 |
|
614 TUint32 serviceId = 0; |
|
615 TInt err = KErrNone; |
|
616 |
|
617 TBuf<256> sname(serviceName); |
|
618 TInt sid; |
|
619 TRAP(err, rv = iIptvTestUtilities->GetServiceIdByNameL(sname, sid)); |
|
620 serviceId = sid; |
|
621 if(KErrNone != err) |
|
622 { |
|
623 VCXLOGLO2("GetServiceIdByNameL caused a leave: %d.", err); |
|
624 VCXLOGLO1("<<<CIptvVodContentApiTest::CreateL"); |
|
625 return err; |
|
626 } |
|
627 if(KErrNone != rv) |
|
628 { |
|
629 VCXLOGLO2("GetServiceIdByNameL returned error: %d.", rv); |
|
630 VCXLOGLO1("<<<CIptvVodContentApiTest::CreateL"); |
|
631 return rv; |
|
632 } |
|
633 |
|
634 TRAP(error, iIptvVodContenClient = CIptvVodContentClient::NewL(serviceId, *this)); |
|
635 |
|
636 if(KErrNone != error)//Leave |
|
637 { |
|
638 if(iIptvVodContenClient) |
|
639 { |
|
640 delete iIptvVodContenClient; |
|
641 iIptvVodContenClient = NULL; |
|
642 } |
|
643 VCXLOGLO2("Leave in creating CIptvVodContentClient instance: %d", error); |
|
644 iLog->Log(_L("*** Fail *** Leave in creating CIptvVodContentClient instance")); |
|
645 return error; |
|
646 } |
|
647 |
|
648 iServiceId = serviceId; |
|
649 TRAP(error, iIptvTestTimer = CIptvTestTimer::NewL( *this, 0 )); |
|
650 |
|
651 if(KErrNone != error)//Leave |
|
652 { |
|
653 if(iIptvTestTimer) |
|
654 { |
|
655 delete iIptvTestTimer; |
|
656 iIptvTestTimer = NULL; |
|
657 } |
|
658 VCXLOGLO1("Leave in creating CIptvTestTimer instance"); |
|
659 iLog->Log(_L("*** Fail *** Leave in creating CIptvTestTimer instance")); |
|
660 return error; |
|
661 } |
|
662 |
|
663 iIptvTestEcgUpdateInfo = CIptvTestEcgUpdateInfo::NewL(); |
|
664 |
|
665 VCXLOGLO1("<<<CIptvVodContentApiTest::CreateInstanceL"); |
|
666 return rv; |
|
667 } |
|
668 |
|
669 // ----------------------------------------------------------------------------- |
|
670 // CIptvVodContentApiTest::DeAllocateResources |
|
671 // ----------------------------------------------------------------------------- |
|
672 // |
|
673 void CIptvVodContentApiTest::DeAllocateResources() |
|
674 { |
|
675 VCXLOGLO1(">>>CIptvVodContentApiTest::DeAllocateResources"); |
|
676 if(iIptvVodContenClient) |
|
677 { |
|
678 delete iIptvVodContenClient; |
|
679 iIptvVodContenClient = NULL; |
|
680 } |
|
681 |
|
682 if(iIptvTestTimer) |
|
683 { |
|
684 delete iIptvTestTimer; |
|
685 iIptvTestTimer = NULL; |
|
686 } |
|
687 |
|
688 if(iIptvTestUtilities) |
|
689 { |
|
690 delete iIptvTestUtilities; |
|
691 iIptvTestUtilities = NULL; |
|
692 } |
|
693 |
|
694 if(iIptvTestEcgUpdateInfo) |
|
695 { |
|
696 delete iIptvTestEcgUpdateInfo; |
|
697 iIptvTestEcgUpdateInfo = NULL; |
|
698 } |
|
699 |
|
700 VCXLOGLO1("<<<CIptvVodContentApiTest::DeAllocateResources"); |
|
701 } |
|
702 |
|
703 // ----------------------------------------------------------------------------- |
|
704 // CIptvVodContentApiTest::PrintVodContentBriefDetails |
|
705 // ----------------------------------------------------------------------------- |
|
706 // |
|
707 void CIptvVodContentApiTest::PrintVodContentBriefDetails(CIptvVodContentContentBriefDetails& aDetails) |
|
708 { |
|
709 VCXLOGLO1(">>>CIptvVodContentApiTest::PrintVodContentBriefDetails"); |
|
710 |
|
711 TInt year, month, day, hour, minute, seconds; |
|
712 GetDateInts(aDetails.iPubDate.DateTime(), year, month, day, hour, minute, seconds); |
|
713 |
|
714 VCXLOGLO3("Id: %d Name = %S", aDetails.iContentId, &aDetails.iName); |
|
715 VCXLOGLO2("iThumbnailPath: %S", &aDetails.iThumbnailPath); |
|
716 |
|
717 VCXLOGLO2("iPlaytime: %d", aDetails.iPlaytime); |
|
718 VCXLOGLO2("iSize: %d", aDetails.iSize); |
|
719 |
|
720 if(aDetails.iFileId) |
|
721 { |
|
722 VCXLOGLO3("iFileId.iDrive = %d, iFileId: %d", aDetails.iFileId->iDrive, aDetails.iFileId->iFileId); |
|
723 } |
|
724 |
|
725 VCXLOGLO4("Pub date = %d.%d.%d", year, month, day); |
|
726 |
|
727 |
|
728 TPtrC browserUrl = aDetails.GetBrowserUrlL(); |
|
729 |
|
730 VCXLOGLO2("iBrowserUrl: %S",&browserUrl); |
|
731 |
|
732 |
|
733 WriteVerifyVodContentBriefDetails(aDetails); |
|
734 |
|
735 VCXLOGLO1("<<<CIptvVodContentApiTest::PrintVodContentBriefDetails"); |
|
736 } |
|
737 |
|
738 // ----------------------------------------------------------------------------- |
|
739 // CIptvVodContentApiTest::PrintVodContentFullDetails |
|
740 // ----------------------------------------------------------------------------- |
|
741 // |
|
742 void CIptvVodContentApiTest::PrintVodContentFullDetails(TUint32 aContentId, CIptvVodContentContentFullDetails& aDetails) |
|
743 { |
|
744 VCXLOGLO1(">>>CIptvVodContentApiTest::PrintVodContentFullDetails"); |
|
745 |
|
746 // |
|
747 // REL 1.1 MEDIACONTENT |
|
748 // |
|
749 |
|
750 VCXLOGLO2("Description = %S", &aDetails.iDescription); |
|
751 VCXLOGLO2("iContentProtection = %d", aDetails.iContentProtection); |
|
752 VCXLOGLO2("iLangugage = %S", &aDetails.iLanguage); |
|
753 VCXLOGLO2("iAuthor = %S", &aDetails.iAuthor); |
|
754 VCXLOGLO2("iCopyright = %S", &aDetails.iCopyright); |
|
755 |
|
756 // |
|
757 // copied from PrintVodContentBriefDetails |
|
758 // |
|
759 |
|
760 TInt year, month, day, hour, minute, seconds; |
|
761 GetDateInts(aDetails.iPubDate.DateTime(), year, month, day, hour, minute, seconds); |
|
762 |
|
763 VCXLOGLO3("Id: %d Name = %S", aDetails.iContentId, &aDetails.iName); |
|
764 VCXLOGLO2("iThumbnailPath: %S", &aDetails.iThumbnailPath); |
|
765 VCXLOGLO2("iPlaytime: %d", aDetails.iPlaytime); |
|
766 VCXLOGLO2("iSize: %d", aDetails.iSize); |
|
767 |
|
768 if(aDetails.iFileId) |
|
769 { |
|
770 VCXLOGLO3("iFileId.iDrive = %d, iFileId: %d", aDetails.iFileId->iDrive, aDetails.iFileId->iFileId); |
|
771 } |
|
772 |
|
773 VCXLOGLO4("Pub date = %d.%d.%d", year, month, day); |
|
774 |
|
775 TPtrC browserUrl = aDetails.GetBrowserUrlL(); |
|
776 VCXLOGLO2("iBrowserUrl: %S",&browserUrl); |
|
777 |
|
778 // |
|
779 // Write to the verify file |
|
780 // |
|
781 WriteVerifyVodContentFullDetails(aContentId, aDetails); |
|
782 |
|
783 VCXLOGLO1("<<<CIptvVodContentApiTest::PrintVodContentFullDetails"); |
|
784 } |
|
785 |
|
786 // ----------------------------------------------------------------------------- |
|
787 // CIptvVodContentApiTest::PrintVodContentCategoryBriefDetails |
|
788 // ----------------------------------------------------------------------------- |
|
789 // |
|
790 void CIptvVodContentApiTest::PrintVodContentCategoryBriefDetails(CIptvVodContentCategoryBriefDetails& aDetails) |
|
791 { |
|
792 VCXLOGLO1(">>>CIptvVodContentApiTest::PrintVodContentCategoryBriefDetails"); |
|
793 |
|
794 TInt year, month, day, hour, minute, seconds; |
|
795 GetDateInts(aDetails.iPubDate.DateTime(), year, month, day, hour, minute, seconds); |
|
796 |
|
797 VCXLOGLO3("Id: %d Name = %S",aDetails.iCategoryId, &aDetails.iName); |
|
798 VCXLOGLO4("Pub date = %d.%d.%d", year, month, day); |
|
799 VCXLOGLO2("iThumbnailPath: %S", &aDetails.iThumbnailPath); |
|
800 VCXLOGLO2("iContentCount: %d", aDetails.iContentCount); |
|
801 VCXLOGLO2("iIsSearchCategory: %d", aDetails.iIsSearchCategory); |
|
802 |
|
803 WriteVerifyVodContentCategoryBriefDetails(aDetails); |
|
804 |
|
805 VCXLOGLO1("<<<CIptvVodContentApiTest::PrintVodContentCategoryBriefDetails"); |
|
806 } |
|
807 |
|
808 // ----------------------------------------------------------------------------- |
|
809 // CIptvVodContentApiTest::WriteVerifyVodContentBriefDetails |
|
810 // ----------------------------------------------------------------------------- |
|
811 // |
|
812 void CIptvVodContentApiTest::WriteVerifyVodContentBriefDetails(CIptvVodContentContentBriefDetails& aDetails) |
|
813 { |
|
814 VCXLOGLO1(">>>CIptvVodContentApiTest::WriteVerifyVodContentBriefDetails"); |
|
815 |
|
816 TInt year, month, day, hour, minute, seconds; |
|
817 GetDateInts(aDetails.iPubDate.DateTime(), year, month, day, hour, minute, seconds); |
|
818 |
|
819 if(iSpecialAction == EBriefContentDetails) |
|
820 { |
|
821 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("VodContentBriefDetails: Id: %d Name = %S"), aDetails.iContentId, &aDetails.iName); |
|
822 return; |
|
823 } |
|
824 |
|
825 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("-----------------------------------------------------------")); |
|
826 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("VodContentBriefDetails")); |
|
827 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("-----------------------------------------------------------")); |
|
828 |
|
829 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("Id: %d Name = %S"), aDetails.iContentId, &aDetails.iName); |
|
830 |
|
831 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iRatingAge: %d"), aDetails.iRatingAge); |
|
832 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iLanguage: %S"), &aDetails.iLanguage); |
|
833 |
|
834 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iThumbnailPath: %S"), &aDetails.iThumbnailPath); |
|
835 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iPlaytime: %d"), aDetails.iPlaytime); |
|
836 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iSize: %d"), aDetails.iSize); |
|
837 |
|
838 if(aDetails.iFileId) |
|
839 { |
|
840 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iFileId.iDrive: %d, iFileId.iFileId: %d"), aDetails.iFileId->iDrive, aDetails.iFileId->iFileId); |
|
841 } |
|
842 else |
|
843 { |
|
844 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("No iFileId ID!") ); |
|
845 } |
|
846 |
|
847 if(aDetails.iPreviewGlobalFileId) |
|
848 { |
|
849 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iPreviewGlobalFileId.iDrive: %d, iPreviewGlobalFileId.iFileId: %d"), aDetails.iPreviewGlobalFileId->iDrive, aDetails.iPreviewGlobalFileId->iFileId); |
|
850 } |
|
851 else |
|
852 { |
|
853 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("No iPreviewGlobalFileId ID!") ); |
|
854 } |
|
855 |
|
856 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("Pub date = %d.%d.%d"), year, month, day); |
|
857 TPtrC browserUrl = aDetails.GetBrowserUrlL(); |
|
858 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iBrowserUrl: %S"), &browserUrl); |
|
859 |
|
860 VCXLOGLO1("<<<CIptvVodContentApiTest::WriteVerifyVodContentBriefDetails"); |
|
861 } |
|
862 |
|
863 // ----------------------------------------------------------------------------- |
|
864 // CIptvVodContentApiTest::WriteVerifyVodContentFullDetails |
|
865 // ----------------------------------------------------------------------------- |
|
866 // |
|
867 void CIptvVodContentApiTest::WriteVerifyVodContentFullDetails(TUint32 aContentId, CIptvVodContentContentFullDetails& aDetails) |
|
868 { |
|
869 VCXLOGLO1(">>>CIptvVodContentApiTest::WriteVerifyVodContentFullDetails"); |
|
870 |
|
871 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("-----------------------------------------------------------")); |
|
872 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("VodContentFullDetails")); |
|
873 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("-----------------------------------------------------------")); |
|
874 |
|
875 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("aContentId = %d"), aContentId); |
|
876 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("Description = %S"),&aDetails.iDescription); |
|
877 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iContentProtection = %d"),aDetails.iContentProtection); |
|
878 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iLanguage = %S"),&aDetails.iLanguage); |
|
879 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iAuthor = %S"),&aDetails.iAuthor); |
|
880 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iCopyright = %S"),&aDetails.iCopyright); |
|
881 |
|
882 // |
|
883 // Print content access list |
|
884 // |
|
885 //IMPORT_C TInt GetContentAccessListL(TUint32 aContentId, RPointerArray<CIptvMediaContent>& aCAList); |
|
886 |
|
887 RPointerArray<CIptvMediaContent> CAList; |
|
888 |
|
889 TInt err = KErrNone, ret = KErrNone; |
|
890 TRAP(err, ret = iIptvVodContenClient->GetContentAccessListL(aContentId, CAList)); |
|
891 |
|
892 CleanupResetAndDestroyPushL(CAList); |
|
893 |
|
894 if(err != KErrNone) |
|
895 { |
|
896 VCXLOGLO2("* ERROR * GetContentAccessListLApiTest caused a leave!: %d", err); |
|
897 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("GetContentAccessListLApiTest caused a leave.")); |
|
898 } |
|
899 else if(ret != KErrNone) |
|
900 { |
|
901 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("GetContentAccessListLApiTest returned error")); |
|
902 VCXLOGLO2("* ERROR * GetContentAccessListLApiTest returned error: %d", ret); |
|
903 } |
|
904 else |
|
905 { |
|
906 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" ")); |
|
907 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("Content access list:")); |
|
908 WriteVerifyCAList(CAList); |
|
909 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" ")); |
|
910 } |
|
911 |
|
912 CleanupStack::PopAndDestroy(&CAList); |
|
913 |
|
914 // copied from WriteVerifyVodContentBriefDetails |
|
915 |
|
916 TInt year, month, day, hour, minute, seconds; |
|
917 GetDateInts(aDetails.iPubDate.DateTime(), year, month, day, hour, minute, seconds); |
|
918 |
|
919 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("Id: %d Name = %S"), aDetails.iContentId, &aDetails.iName); |
|
920 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iThumbnailPath: %S"), &aDetails.iThumbnailPath); |
|
921 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iPlaytime: %d"), aDetails.iPlaytime); |
|
922 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iSize: %d"), aDetails.iSize); |
|
923 |
|
924 if(aDetails.iFileId) |
|
925 { |
|
926 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iFileId.iDrive: %d, iFileId.iFileId: %d"), aDetails.iFileId->iDrive, aDetails.iFileId->iFileId); |
|
927 } |
|
928 |
|
929 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("Pub date = %d.%d.%d"), year, month, day); |
|
930 TPtrC browserUrl = aDetails.GetBrowserUrlL(); |
|
931 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iBrowserUrl: %S"),&browserUrl); |
|
932 |
|
933 |
|
934 VCXLOGLO1("<<<CIptvVodContentApiTest::WriteVerifyVodContentFullDetails"); |
|
935 } |
|
936 |
|
937 // ----------------------------------------------------------------------------- |
|
938 // CIptvVodContentApiTest::WriteVerifyVodContentCategoryBriefDetails |
|
939 // ----------------------------------------------------------------------------- |
|
940 // |
|
941 void CIptvVodContentApiTest::WriteVerifyVodContentCategoryBriefDetails(CIptvVodContentCategoryBriefDetails& aDetails) |
|
942 { |
|
943 VCXLOGLO1(">>>CIptvVodContentApiTest::WriteVerifyVodContentCategoryBriefDetails"); |
|
944 |
|
945 TInt year, month, day, hour, minute, seconds; |
|
946 GetDateInts(aDetails.iPubDate.DateTime(), year, month, day, hour, minute, seconds); |
|
947 |
|
948 if(iSpecialAction == EBriefContentDetails) |
|
949 { |
|
950 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("VodContentCategoryBriefDetails: Id: %d Name = %S"),aDetails.iCategoryId, &aDetails.iName); |
|
951 return; |
|
952 } |
|
953 |
|
954 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("-----------------------------------------------------------")); |
|
955 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("VodContentCategoryBriefDetails")); |
|
956 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("-----------------------------------------------------------")); |
|
957 |
|
958 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("Id: %d Name = %S"),aDetails.iCategoryId, &aDetails.iName); |
|
959 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("Pub date = %d.%d.%d (OBSOLOTE)"), year, month, day); |
|
960 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iThumbnailPath: %S (OBSOLOTE)"), &aDetails.iThumbnailPath); |
|
961 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iContentCount: %d"), aDetails.iContentCount); |
|
962 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("iIsSearchCategory: %d"), aDetails.iIsSearchCategory); |
|
963 |
|
964 VCXLOGLO1("<<<CIptvVodContentApiTest::WriteVerifyVodContentCategoryBriefDetails"); |
|
965 } |
|
966 |
|
967 // ----------------------------------------------------------------------------- |
|
968 // CIptvVodContentApiTest::WriteVerifyCAList |
|
969 // ----------------------------------------------------------------------------- |
|
970 // |
|
971 void CIptvVodContentApiTest::WriteVerifyCAList(RPointerArray<CIptvMediaContent>& aCAList) |
|
972 { |
|
973 |
|
974 for(TInt i = 0; i < aCAList.Count(); i++) |
|
975 { |
|
976 |
|
977 iIptvTestUtilities->WriteVerifyData(iCaseId, _L("%d."), i); |
|
978 |
|
979 CIptvMediaContent *mediaContent = aCAList[i]; |
|
980 |
|
981 TBuf<256> str; |
|
982 |
|
983 /** |
|
984 * Content key |
|
985 */ |
|
986 //TUint32 iContentKey; |
|
987 |
|
988 /** |
|
989 * Index (This index identifies content access objects which belong to some content defined by iContentKey) |
|
990 */ |
|
991 //TUint32 iIndex; |
|
992 |
|
993 /** |
|
994 * Download type. |
|
995 */ |
|
996 //TUint32 iDownloadType |
|
997 |
|
998 switch(mediaContent->iDownloadType) |
|
999 { |
|
1000 |
|
1001 case EIptvDownloadTypeStream: |
|
1002 str = _L("Stream"); |
|
1003 break; |
|
1004 |
|
1005 case EIptvDownloadTypeImmediate: |
|
1006 str = _L("Immediate"); |
|
1007 break; |
|
1008 |
|
1009 case EIptvDownloadTypePostponed: |
|
1010 str = _L("Postponed"); |
|
1011 break; |
|
1012 |
|
1013 case EIptvDownloadTypeScheduled: |
|
1014 str = _L("Scheduled"); |
|
1015 break; |
|
1016 |
|
1017 default: |
|
1018 str = _L("Unknown"); |
|
1019 break; |
|
1020 } |
|
1021 |
|
1022 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iDownloadType: %S (%d)"), &str, mediaContent->iDownloadType); |
|
1023 |
|
1024 /** |
|
1025 * File id (Part of global file id (1/2) |
|
1026 */ |
|
1027 //TUint32 iFileId; |
|
1028 |
|
1029 /** |
|
1030 * Drive id (Part of global file id (2/2) |
|
1031 */ |
|
1032 //TUint32 iDriveId; |
|
1033 |
|
1034 /** |
|
1035 * Content URL (MRSS) |
|
1036 */ |
|
1037 //TBuf<KIptvCAContentUrlLength> iUrl; |
|
1038 |
|
1039 const TPtrC url = mediaContent->GetMediaContentUrl(); |
|
1040 |
|
1041 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iUrl: %S"), &url); |
|
1042 |
|
1043 /** |
|
1044 * File size (MRSS) |
|
1045 */ |
|
1046 //TUint32 iFileSize; |
|
1047 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iFileSize: %d"), mediaContent->iFileSize); |
|
1048 |
|
1049 /** |
|
1050 * Mime-type (MRSS) |
|
1051 */ |
|
1052 //TBuf<KIptvCAMimeTypeLength> iMimeType; |
|
1053 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iMimeType: %S"), &mediaContent->iMimeType); |
|
1054 |
|
1055 /** |
|
1056 * Medium (MRSS) (Not used in client side) |
|
1057 * Medium is the type of object (image | audio | video | document | executable). While this |
|
1058 * attribute can at times seem redundant if type is supplied, it is included because it simplifies |
|
1059 * decision making on the reader side, as well as flushes out any ambiguities between MIME type and |
|
1060 * object type. It is an optional attribute. |
|
1061 */ |
|
1062 //TBuf<KIptvMediumMaxLength> iMedium; |
|
1063 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iMedium: %S"), &mediaContent->iMedium); |
|
1064 |
|
1065 /** |
|
1066 * Is default. (MRSS) (Not used in client side) |
|
1067 * isDefault determines if this is the default object that should be used for the <media:group>. |
|
1068 * There should only be one default object per <media:group>. It is an optional attribute. |
|
1069 */ |
|
1070 //TBool iIsDefault; |
|
1071 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iIsDefault: %d"), mediaContent->iIsDefault); |
|
1072 |
|
1073 /** |
|
1074 * Expression. (MRSS) |
|
1075 * Expression determines if the object is a sample or the full version of the object, or even if it is a |
|
1076 * continuous stream (sample | full | nonstop). Default value is 'full'. It is an optional attribute |
|
1077 */ |
|
1078 //TUint32 iExpression; |
|
1079 if(mediaContent->iExpression == CIptvMediaContent::EFull) str = _L("FULL"); |
|
1080 if(mediaContent->iExpression == CIptvMediaContent::ESample) str = _L("Sample"); |
|
1081 if(mediaContent->iExpression == CIptvMediaContent::ENonStop) str = _L("NonStop"); |
|
1082 |
|
1083 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iExpression: %S (%d)"), &str, mediaContent->iExpression); |
|
1084 |
|
1085 /** |
|
1086 * Bitrate. (MRSS) (Not used in client side) |
|
1087 * Bitrate is the kilobits per second rate of media. It is an optional attribute |
|
1088 */ |
|
1089 //TUint32 iBitrate; |
|
1090 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iBitrate: %d"), mediaContent->iBitrate); |
|
1091 |
|
1092 /** |
|
1093 * Framerate. (MRSS) (Not used in client side) |
|
1094 * Framerate is the number of frames per second for the media object. It is an optional attribute |
|
1095 */ |
|
1096 //TUint32 iFramerate; |
|
1097 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iFramerate: %d"), mediaContent->iFramerate); |
|
1098 |
|
1099 /** |
|
1100 * Samplingrate (MRSS) (Not used in client side) |
|
1101 * Samplingrate is the number of samples per second taken to create the media object. It is expressed in |
|
1102 * thousands of samples per second (kHz). It is an optional attribute. |
|
1103 */ |
|
1104 //TUint32 iSamplingrate; |
|
1105 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iSamplingrate: %d"), mediaContent->iSamplingrate); |
|
1106 |
|
1107 /** |
|
1108 * Channels. (MRSS) (Not used in client side) |
|
1109 * Not supported. |
|
1110 */ |
|
1111 |
|
1112 /** |
|
1113 * Duration. (MRSS) |
|
1114 * Duration is the number of seconds the media object plays. It is an optional attribute. |
|
1115 */ |
|
1116 //TUint32 iDuration; |
|
1117 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iDuration: %d"), mediaContent->iDuration); |
|
1118 |
|
1119 /** |
|
1120 * Height. (MRSS) (Not used in client side) |
|
1121 * Height is the height of the media object. It is an optional attribute. |
|
1122 */ |
|
1123 //TUint32 iHeight; |
|
1124 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iHeight: %d"), mediaContent->iHeight); |
|
1125 |
|
1126 /** |
|
1127 * Width. (MRSS) (Not used in client side) |
|
1128 * Width is the width of the media object. It is an optional attribute. |
|
1129 */ |
|
1130 //TUint32 iWidth; |
|
1131 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iWidth: %d"), mediaContent->iWidth); |
|
1132 |
|
1133 /** |
|
1134 * Language. (MRSS) |
|
1135 * Lang is the primary language encapsulated in the media object. Language codes possible are detailed in |
|
1136 * RFC 3066. This attribute is used similar to the xml:lang attribute detailed in the XML 1.0 Specification |
|
1137 * (Third Edition). It is an optional attribute. |
|
1138 */ |
|
1139 //TBuf<KIptvCALanguageLength> iLanguage; |
|
1140 iIptvTestUtilities->WriteVerifyData(iCaseId, _L(" iLanguage: %S"), &mediaContent->iLanguage); |
|
1141 } |
|
1142 } |
|
1143 |
|
1144 // ----------------------------------------------------------------------------- |
|
1145 // CIptvVodContentApiTest::SetIap |
|
1146 // ----------------------------------------------------------------------------- |
|
1147 // |
|
1148 TInt CIptvVodContentApiTest::SetIap(const TUint32 aIap) |
|
1149 { |
|
1150 VCXLOGLO1(">>>CIptvVodContentApiTest::SetIap"); |
|
1151 TInt rv = KErrNone; |
|
1152 VCXLOGLO2("Selected Iap = %d",aIap); |
|
1153 |
|
1154 TRAPD(error,rv = iIptvVodContenClient->SetIapL(aIap)); |
|
1155 if(KErrNone != error) |
|
1156 { |
|
1157 rv =error; |
|
1158 } |
|
1159 else |
|
1160 { |
|
1161 iIapId = aIap; |
|
1162 } |
|
1163 |
|
1164 VCXLOGLO1("<<<CIptvVodContentApiTest::SetIap"); |
|
1165 return rv; |
|
1166 } |
|
1167 |
|
1168 // ----------------------------------------------------------------------------- |
|
1169 // CIptvVodContentApiTest::TestGetUpdateTimeL |
|
1170 // ----------------------------------------------------------------------------- |
|
1171 // |
|
1172 TInt CIptvVodContentApiTest::TestGetUpdateTimeL(TTime& aTime) |
|
1173 { |
|
1174 VCXLOGLO1(">>>CIptvVodContentApiTest::TestGetUpdateTimeL"); |
|
1175 TInt rv = KErrNone; |
|
1176 |
|
1177 TRAPD(error, rv = iIptvVodContenClient->GetUpdateTimeL(aTime)); |
|
1178 |
|
1179 if(KErrNone != error) |
|
1180 { |
|
1181 rv = error; |
|
1182 } |
|
1183 |
|
1184 VCXLOGLO1("<<<CIptvVodContentApiTest::TestGetUpdateTimeL"); |
|
1185 return rv; |
|
1186 } |
|
1187 |
|
1188 // ----------------------------------------------------------------------------- |
|
1189 // CIptvVodContentApiTest::GetDateInts |
|
1190 // ----------------------------------------------------------------------------- |
|
1191 // |
|
1192 void CIptvVodContentApiTest::GetDateInts(TDateTime aDateTime, TInt& year, TInt& month, TInt& day, TInt& hour, TInt& minute, TInt& second ) |
|
1193 { |
|
1194 year = aDateTime.Year(); |
|
1195 month = aDateTime.Month() + 1; |
|
1196 day = aDateTime.Day() + 1; |
|
1197 hour = aDateTime.Hour(); |
|
1198 minute = aDateTime.Minute(); |
|
1199 second = aDateTime.Second(); |
|
1200 } |
|
1201 |
|
1202 |
|
1203 // ----------------------------------------------------------------------------- |
|
1204 // CIptvVodContentApiTest::RemoveServiceNumberFromThumbnailPathL |
|
1205 // ----------------------------------------------------------------------------- |
|
1206 // |
|
1207 void CIptvVodContentApiTest::RemoveServiceNumberFromThumbnailPathL(TDes& aThumbnailPath) |
|
1208 { |
|
1209 VCXLOGLO1(">>>CIptvVodContentApiTest::RemoveServiceNumberFromThumbnailPath"); |
|
1210 |
|
1211 HBufC* thumbPath; |
|
1212 thumbPath = HBufC::NewL(2048); |
|
1213 |
|
1214 CleanupStack::PushL(thumbPath); |
|
1215 |
|
1216 TInt pos; |
|
1217 |
|
1218 TBool success = EFalse; |
|
1219 |
|
1220 pos = aThumbnailPath.Find( _L("ecg\\") ); |
|
1221 if( pos != KErrNotFound ) |
|
1222 { |
|
1223 thumbPath->Des().Append( aThumbnailPath.Left(pos+4) ); |
|
1224 |
|
1225 pos = aThumbnailPath.Find( _L("tbn\\") ); |
|
1226 if( pos != KErrNotFound ) |
|
1227 { |
|
1228 thumbPath->Des().Append( _L("X") ); |
|
1229 thumbPath->Des().Append( aThumbnailPath.Right( aThumbnailPath.Length() - (pos-1) ) ); |
|
1230 |
|
1231 success = ETrue; |
|
1232 } |
|
1233 } |
|
1234 |
|
1235 if(success) |
|
1236 { |
|
1237 aThumbnailPath = thumbPath->Des(); |
|
1238 } |
|
1239 |
|
1240 CleanupStack::PopAndDestroy(thumbPath); |
|
1241 |
|
1242 VCXLOGLO1("<<<CIptvVodContentApiTest::RemoveServiceNumberFromThumbnailPath"); |
|
1243 } |
|
1244 |
|
1245 // End of File |