|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CGlxMediaList unit tests |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // CLASS HEADER |
|
22 #include "ut_cglxmedialist.h" |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <digia/eunit/eunitmacros.h> |
|
26 |
|
27 #include <mpxcommandgeneraldefs.h> |
|
28 #include <mpxmediageneraldefs.h> |
|
29 #include <mpxmessagegeneraldefs.h> |
|
30 #include <mpxmessageprogressdefs.h> |
|
31 #include <mpxcollectionmessage.h> |
|
32 #include <glxcommandgeneraldefs.h> |
|
33 #include <glxdrmutility.h> |
|
34 |
|
35 // INTERNAL INCLUDES |
|
36 #include "glxmedialist.h" |
|
37 #include "glxattributecontext.h" |
|
38 |
|
39 _LIT(KTitle, "Albums"); |
|
40 |
|
41 const TInt KTestCollectionPluginUid = 0x20007195; |
|
42 const TInt KTestAlbumCollectionPluginUid = 0x2000718B; |
|
43 const TInt KFavouritesAlbumId = 3000; |
|
44 const TInt KFavouritesAlbumFirstItemId = 3009; |
|
45 const TInt KProgressTotalCount = 10; |
|
46 |
|
47 const TMPXAttribute KProgressCountAttr(KMPXMessageContentIdProgress, EMPXMessageProgressCurrentCount); |
|
48 const TMPXAttribute KProgressTotalCountAttr(KMPXMessageContentIdProgress, EMPXMessageProgressTotalCount); |
|
49 |
|
50 void CGlxDRMUtility::Close() |
|
51 { |
|
52 delete this; |
|
53 } |
|
54 |
|
55 TBool CGlxDRMUtility::CheckOpenRightsL(const TDesC&, TBool) |
|
56 { |
|
57 return ETrue; |
|
58 } |
|
59 |
|
60 CGlxDRMUtility* CGlxDRMUtility::InstanceL() |
|
61 { |
|
62 CGlxDRMUtility* drm = new(ELeave)CGlxDRMUtility(); |
|
63 return drm; |
|
64 } |
|
65 |
|
66 TSize CGlxDRMUtility::DRMThumbnailSize(TSize& aSize) |
|
67 { |
|
68 return aSize; |
|
69 } |
|
70 |
|
71 CGlxDRMUtility::CGlxDRMUtility() |
|
72 { |
|
73 |
|
74 } |
|
75 |
|
76 CGlxDRMUtility::~CGlxDRMUtility() |
|
77 { |
|
78 |
|
79 } |
|
80 |
|
81 // CONSTRUCTION |
|
82 UT_CGlxMediaList* UT_CGlxMediaList::NewL() |
|
83 { |
|
84 UT_CGlxMediaList* self = UT_CGlxMediaList::NewLC(); |
|
85 CleanupStack::Pop(); |
|
86 |
|
87 return self; |
|
88 } |
|
89 |
|
90 UT_CGlxMediaList* UT_CGlxMediaList::NewLC() |
|
91 { |
|
92 UT_CGlxMediaList* self = new( ELeave ) UT_CGlxMediaList(); |
|
93 CleanupStack::PushL( self ); |
|
94 |
|
95 self->ConstructL(); |
|
96 |
|
97 return self; |
|
98 } |
|
99 |
|
100 // Destructor (virtual by CBase) |
|
101 UT_CGlxMediaList::~UT_CGlxMediaList() |
|
102 { |
|
103 } |
|
104 |
|
105 // Default constructor |
|
106 UT_CGlxMediaList::UT_CGlxMediaList() |
|
107 { |
|
108 } |
|
109 |
|
110 // Second phase construct |
|
111 void UT_CGlxMediaList::ConstructL() |
|
112 { |
|
113 // The ConstructL from the base class CEUnitTestSuiteClass must be called. |
|
114 // It generates the test case table. |
|
115 CEUnitTestSuiteClass::ConstructL(); |
|
116 } |
|
117 |
|
118 // METHODS |
|
119 |
|
120 void UT_CGlxMediaList::HandleItemAddedL(TInt /*aStartIndex*/, TInt /*aEndIndex*/, MGlxMediaList* /*aList*/) |
|
121 { |
|
122 iSchedulerWait->AsyncStop(); |
|
123 } |
|
124 |
|
125 void UT_CGlxMediaList::HandleAttributesAvailableL(TInt /*aItemIndex*/, const RArray<TMPXAttribute>& /*aAttributes*/, MGlxMediaList* /*aList*/) |
|
126 { |
|
127 iSchedulerWait->AsyncStop(); |
|
128 } |
|
129 |
|
130 void UT_CGlxMediaList::SetupL( ) |
|
131 { |
|
132 CMPXCollectionPath* path = CMPXCollectionPath::NewL(); |
|
133 CleanupStack::PushL(path); |
|
134 |
|
135 path->AppendL(KTestCollectionPluginUid); |
|
136 path->AppendL(KFavouritesAlbumId); |
|
137 |
|
138 iCGlxMediaList = CGlxMediaList::InstanceL(*path, NULL); |
|
139 CleanupStack::PopAndDestroy(); // path |
|
140 |
|
141 iCGlxMediaList->AddMediaListObserverL(this); |
|
142 |
|
143 iContext = CGlxDefaultAttributeContext::NewL(); |
|
144 iContext->AddAttributeL(KMPXMediaGeneralTitle); |
|
145 |
|
146 iCGlxMediaList->AddContextL(iContext, 0); |
|
147 |
|
148 |
|
149 iSchedulerWait = new (ELeave) CActiveSchedulerWait(); |
|
150 iSchedulerWait->Start(); // wait for Media list to be populated (HandleItemAddedL will be called) |
|
151 } |
|
152 |
|
153 void UT_CGlxMediaList::Teardown( ) |
|
154 { |
|
155 iCGlxMediaList->RemoveContext(iContext); |
|
156 delete iContext; |
|
157 iContext = NULL; |
|
158 |
|
159 iCGlxMediaList->RemoveMediaListObserver(this); |
|
160 iCGlxMediaList->Close(); |
|
161 |
|
162 delete iSchedulerWait; |
|
163 iSchedulerWait = NULL; |
|
164 } |
|
165 |
|
166 void UT_CGlxMediaList::UT_CGlxMediaList_InstanceLL( ) |
|
167 { |
|
168 // Obtain instance of media list to existing path with filter applied |
|
169 CMPXCollectionPath* existingPath = CMPXCollectionPath::NewL(); |
|
170 CleanupStack::PushL(existingPath); |
|
171 |
|
172 |
|
173 existingPath->AppendL(KTestCollectionPluginUid); |
|
174 existingPath->AppendL(KFavouritesAlbumId); |
|
175 |
|
176 |
|
177 CMPXFilter* filter1 = CMPXFilter::NewL(); |
|
178 CleanupStack::PushL(filter1); |
|
179 |
|
180 EUNIT_PRINT(_L("Obtain instance of media list to existing path with filter applied")); |
|
181 CGlxMediaList* filteredCGlxMediaList1 = CGlxMediaList::InstanceL(*existingPath, KGlxIdNone, filter1); |
|
182 |
|
183 // filter ownership passed to media list |
|
184 CleanupStack::Pop(filter1); |
|
185 |
|
186 CleanupClosePushL(*filteredCGlxMediaList1); |
|
187 |
|
188 // Check instance is different |
|
189 EUNIT_PRINT(_L("Check instance is different")); |
|
190 EUNIT_ASSERT(filteredCGlxMediaList1 != iCGlxMediaList); |
|
191 |
|
192 // Obtain instance of media list with different path |
|
193 CMPXCollectionPath* differentPath = CMPXCollectionPath::NewL(); |
|
194 CleanupStack::PushL(differentPath); |
|
195 |
|
196 differentPath->AppendL(KTestAlbumCollectionPluginUid); |
|
197 differentPath->AppendL(KFavouritesAlbumId); |
|
198 |
|
199 EUNIT_PRINT(_L("Obtain instance of media list with different path")); |
|
200 CGlxMediaList* cGlxMediaList1 = CGlxMediaList::InstanceL(*differentPath, NULL); |
|
201 |
|
202 CleanupClosePushL(*cGlxMediaList1); |
|
203 |
|
204 // Check instance is different |
|
205 EUNIT_PRINT(_L("Check instance is different")); |
|
206 EUNIT_ASSERT(cGlxMediaList1 != iCGlxMediaList); |
|
207 |
|
208 // Obtain instance of media list to existing path with filter applied |
|
209 CMPXFilter* filter2 = CMPXFilter::NewL(); |
|
210 CleanupStack::PushL(filter2); |
|
211 |
|
212 EUNIT_PRINT(_L("Obtain instance of media list to existing path with filter applied")); |
|
213 CGlxMediaList* filteredCGlxMediaList2 = CGlxMediaList::InstanceL(*existingPath, KGlxIdNone, filter2); |
|
214 |
|
215 // filter ownership passed to media list |
|
216 CleanupStack::Pop(filter2); |
|
217 |
|
218 CleanupClosePushL(*filteredCGlxMediaList2); |
|
219 |
|
220 // Check instance is different |
|
221 EUNIT_PRINT(_L("Check instance is different")); |
|
222 EUNIT_ASSERT(filteredCGlxMediaList2 != filteredCGlxMediaList1) |
|
223 |
|
224 // Obtain instance of media list with same path |
|
225 EUNIT_PRINT(_L("Obtain instance of media list with same path")); |
|
226 CGlxMediaList* cGlxMediaList2 = CGlxMediaList::InstanceL(*existingPath, NULL); |
|
227 |
|
228 CleanupClosePushL(*cGlxMediaList2); |
|
229 |
|
230 // Check instance is the same |
|
231 EUNIT_PRINT(_L("Check instance is the same")); |
|
232 EUNIT_ASSERT(cGlxMediaList2 == iCGlxMediaList); |
|
233 |
|
234 CleanupStack::PopAndDestroy(cGlxMediaList2); |
|
235 CleanupStack::PopAndDestroy(filteredCGlxMediaList2); |
|
236 CleanupStack::PopAndDestroy(cGlxMediaList1); |
|
237 CleanupStack::PopAndDestroy(differentPath); |
|
238 CleanupStack::PopAndDestroy(filteredCGlxMediaList1); |
|
239 CleanupStack::PopAndDestroy(existingPath); |
|
240 } |
|
241 |
|
242 void UT_CGlxMediaList::UT_CGlxMediaList_MediaListsL( ) |
|
243 { |
|
244 // Check media lists array |
|
245 EUNIT_PRINT(_L("Check media lists array")); |
|
246 RPointerArray<CGlxMediaList>& mediaLists = CGlxMediaList::MediaListsL(); |
|
247 |
|
248 // Check media lists initial count |
|
249 TInt mediaListCount = mediaLists.Count(); |
|
250 EUNIT_PRINT(_L("Check media lists initial count")); |
|
251 EUNIT_ASSERT(mediaListCount == 1); |
|
252 |
|
253 // Check media lists initial item |
|
254 EUNIT_PRINT(_L("Check media lists initial item")); |
|
255 EUNIT_ASSERT(mediaLists[0] == iCGlxMediaList); |
|
256 |
|
257 // Obtain instance of media list with different path |
|
258 CMPXCollectionPath* differentPath = CMPXCollectionPath::NewL(); |
|
259 CleanupStack::PushL(differentPath); |
|
260 |
|
261 differentPath->AppendL(KTestAlbumCollectionPluginUid); |
|
262 differentPath->AppendL(KFavouritesAlbumId); |
|
263 |
|
264 EUNIT_PRINT(_L("Obtain instance of media list with different path")); |
|
265 CGlxMediaList* cGlxMediaList1 = CGlxMediaList::InstanceL(*differentPath, NULL); |
|
266 |
|
267 CleanupClosePushL(*cGlxMediaList1); |
|
268 |
|
269 // Check media lists count |
|
270 mediaListCount = mediaLists.Count(); |
|
271 EUNIT_PRINT(_L("Check media lists count")); |
|
272 EUNIT_ASSERT(mediaListCount == 2); |
|
273 |
|
274 // Check media lists items |
|
275 EUNIT_PRINT(_L("Check media lists items")); |
|
276 EUNIT_ASSERT((mediaLists[0] == cGlxMediaList1) && (mediaLists[1] == iCGlxMediaList)); |
|
277 |
|
278 // Obtain instance of media list to existing path |
|
279 CMPXCollectionPath* existingPath = CMPXCollectionPath::NewL(); |
|
280 CleanupStack::PushL(existingPath); |
|
281 |
|
282 existingPath->AppendL(KTestCollectionPluginUid); |
|
283 existingPath->AppendL(KFavouritesAlbumId); |
|
284 |
|
285 EUNIT_PRINT(_L("Obtain instance of media list with existing path")); |
|
286 CGlxMediaList* cGlxMediaList2 = CGlxMediaList::InstanceL(*existingPath, NULL); |
|
287 |
|
288 CleanupClosePushL(*cGlxMediaList2); |
|
289 |
|
290 // Check media lists count |
|
291 mediaListCount = mediaLists.Count(); |
|
292 EUNIT_PRINT(_L("Check media lists count")); |
|
293 EUNIT_ASSERT(mediaListCount == 2); |
|
294 |
|
295 // Check media lists items |
|
296 EUNIT_PRINT(_L("Check media lists items")); |
|
297 EUNIT_ASSERT((mediaLists[1] == cGlxMediaList1) && (mediaLists[0] == iCGlxMediaList)); |
|
298 |
|
299 CleanupStack::PopAndDestroy(cGlxMediaList2); |
|
300 CleanupStack::PopAndDestroy(existingPath); |
|
301 CleanupStack::PopAndDestroy(cGlxMediaList1); |
|
302 CleanupStack::PopAndDestroy(differentPath); |
|
303 } |
|
304 |
|
305 void UT_CGlxMediaList::UT_CGlxMediaList_NewLCL( ) |
|
306 { |
|
307 EUNIT_ASSERT( EFalse ); |
|
308 } |
|
309 |
|
310 void UT_CGlxMediaList::UT_CGlxMediaList_OpenLL( ) |
|
311 { |
|
312 EUNIT_ASSERT( EFalse ); |
|
313 } |
|
314 |
|
315 void UT_CGlxMediaList::UT_CGlxMediaList_AddReferenceL( ) |
|
316 { |
|
317 EUNIT_ASSERT( EFalse ); |
|
318 } |
|
319 |
|
320 void UT_CGlxMediaList::UT_CGlxMediaList_RemoveReferenceL( ) |
|
321 { |
|
322 EUNIT_ASSERT( EFalse ); |
|
323 } |
|
324 |
|
325 void UT_CGlxMediaList::UT_CGlxMediaList_ReferenceCountL( ) |
|
326 { |
|
327 EUNIT_ASSERT( EFalse ); |
|
328 } |
|
329 |
|
330 void UT_CGlxMediaList::UT_CGlxMediaList_EqualsL( ) |
|
331 { |
|
332 EUNIT_ASSERT( EFalse ); |
|
333 } |
|
334 |
|
335 void UT_CGlxMediaList::UT_CGlxMediaList_OfferMediaL( ) |
|
336 { |
|
337 EUNIT_ASSERT( EFalse ); |
|
338 } |
|
339 |
|
340 void UT_CGlxMediaList::UT_CGlxMediaList_HandleAttributesAvailableLL( ) |
|
341 { |
|
342 EUNIT_ASSERT( EFalse ); |
|
343 } |
|
344 |
|
345 void UT_CGlxMediaList::UT_CGlxMediaList_AttributeRequestLL( ) |
|
346 { |
|
347 EUNIT_ASSERT( EFalse ); |
|
348 } |
|
349 |
|
350 void UT_CGlxMediaList::UT_CGlxMediaList_CloseL( ) |
|
351 { |
|
352 EUNIT_ASSERT( EFalse ); |
|
353 } |
|
354 |
|
355 void UT_CGlxMediaList::UT_CGlxMediaList_IdL( ) |
|
356 { |
|
357 EUNIT_ASSERT( EFalse ); |
|
358 } |
|
359 |
|
360 void UT_CGlxMediaList::UT_CGlxMediaList_CountL( ) |
|
361 { |
|
362 EUNIT_ASSERT( EFalse ); |
|
363 } |
|
364 |
|
365 void UT_CGlxMediaList::UT_CGlxMediaList_FocusIndexL( ) |
|
366 { |
|
367 // Setup test |
|
368 SetupFocusTestL(); |
|
369 |
|
370 // Check focus is index 3 |
|
371 EUNIT_PRINT(_L("Check focus is index 3")); |
|
372 TInt focusIndex = iCGlxMediaList->FocusIndex(); |
|
373 EUNIT_ASSERT(focusIndex == 3); |
|
374 } |
|
375 |
|
376 void UT_CGlxMediaList::UT_CGlxMediaList_SetFocusLL( ) |
|
377 { |
|
378 // Setup test |
|
379 SetupFocusTestL(); |
|
380 |
|
381 MoveFocusAbsoluteGreaterThanCurrentFocusL(); |
|
382 MoveFocusAbsoluteLessThanCurrentFocusL(); |
|
383 MoveFocusRelativeForwardL(); |
|
384 MoveFocusRelativeBackwardL(); |
|
385 MoveFocusRelativeForwardGreaterThanListCountL(); |
|
386 MoveFocusRelativeBackwardLessThanZeroL(); |
|
387 } |
|
388 |
|
389 void UT_CGlxMediaList::UT_CGlxMediaList_ItemL( ) |
|
390 { |
|
391 EUNIT_ASSERT( EFalse ); |
|
392 } |
|
393 |
|
394 void UT_CGlxMediaList::UT_CGlxMediaList_IndexL( ) |
|
395 { |
|
396 EUNIT_ASSERT( EFalse ); |
|
397 } |
|
398 |
|
399 void UT_CGlxMediaList::UT_CGlxMediaList_AddMediaListObserverLL( ) |
|
400 { |
|
401 EUNIT_ASSERT( EFalse ); |
|
402 } |
|
403 |
|
404 void UT_CGlxMediaList::UT_CGlxMediaList_RemoveMediaListObserverL( ) |
|
405 { |
|
406 EUNIT_ASSERT( EFalse ); |
|
407 } |
|
408 |
|
409 void UT_CGlxMediaList::UT_CGlxMediaList_AddContextLL( ) |
|
410 { |
|
411 EUNIT_ASSERT( EFalse ); |
|
412 } |
|
413 |
|
414 void UT_CGlxMediaList::UT_CGlxMediaList_RemoveContextL( ) |
|
415 { |
|
416 EUNIT_ASSERT( EFalse ); |
|
417 } |
|
418 |
|
419 void UT_CGlxMediaList::UT_CGlxMediaList_CollectionL( ) |
|
420 { |
|
421 EUNIT_ASSERT( EFalse ); |
|
422 } |
|
423 |
|
424 void UT_CGlxMediaList::UT_CGlxMediaList_PathLCL( ) |
|
425 { |
|
426 // Setup test |
|
427 SetupPathTestL(); |
|
428 |
|
429 CMPXCollectionPath* path = iCGlxMediaList->PathLC(); |
|
430 |
|
431 // Check path has 3 levels |
|
432 EUNIT_PRINT(_L("Check path has 3 levels")); |
|
433 EUNIT_ASSERT(path->Levels() == 3); |
|
434 |
|
435 // Check level 0 is test collection plugin uid |
|
436 EUNIT_PRINT(_L("Check level 0 is test collection plugin uid")); |
|
437 EUNIT_ASSERT(path->Id(0) == KTestCollectionPluginUid); |
|
438 |
|
439 // Check level 1 is favourites album id |
|
440 EUNIT_PRINT(_L("Check level 1 is favourites album id")); |
|
441 EUNIT_ASSERT(path->Id(1) == KFavouritesAlbumId); |
|
442 |
|
443 // Check level 2 is favourites album first item id |
|
444 EUNIT_PRINT(_L("Check level 2 is favourites album first item id")); |
|
445 EUNIT_ASSERT(path->Id(2) == KFavouritesAlbumFirstItemId); |
|
446 |
|
447 // Check path item count |
|
448 TInt pathCount = path->Count(); |
|
449 TInt listCount = iCGlxMediaList->Count(); |
|
450 EUNIT_PRINT(_L("Check path item count")); |
|
451 EUNIT_ASSERT(pathCount == listCount); |
|
452 |
|
453 // Check path items |
|
454 EUNIT_PRINT(_L("Check path items")); |
|
455 for (TInt count = 0; count < pathCount; ++count) |
|
456 { |
|
457 EUNIT_ASSERT(path->IdOfIndex(count) == TMPXItemId(iCGlxMediaList->Item(count).Id().Value())); |
|
458 } |
|
459 |
|
460 // Check path selection count |
|
461 TArray<TInt> pathSelection = path->Selection(); |
|
462 TInt pathSelectionCount = pathSelection.Count(); |
|
463 TInt listSelectionCount = iCGlxMediaList->SelectionCount(); |
|
464 EUNIT_PRINT(_L("Check path selection count")); |
|
465 EUNIT_ASSERT(pathSelectionCount == listSelectionCount); |
|
466 |
|
467 // Check path selected items |
|
468 EUNIT_PRINT(_L("Check path selected items")); |
|
469 for (TInt count = 0; count < pathSelectionCount; ++count) |
|
470 { |
|
471 EUNIT_ASSERT(pathSelection[count] == iCGlxMediaList->SelectedItemIndex(count)); |
|
472 } |
|
473 |
|
474 // Check focused item |
|
475 EUNIT_PRINT(_L("Check focused item")); |
|
476 EUNIT_ASSERT(path->Id() == TMPXItemId(iCGlxMediaList->Item(iCGlxMediaList->FocusIndex()).Id().Value())); |
|
477 |
|
478 CleanupStack::PopAndDestroy(path); |
|
479 } |
|
480 |
|
481 void UT_CGlxMediaList::UT_CGlxMediaList_IsSelectedL( ) |
|
482 { |
|
483 // Setup test |
|
484 SetupSelectionTestL(); |
|
485 |
|
486 TBool isSelected = EFalse; |
|
487 |
|
488 // Check 2 is selected |
|
489 EUNIT_PRINT(_L("Check 2 is selected")); |
|
490 isSelected = iCGlxMediaList->IsSelected(2); |
|
491 EUNIT_ASSERT(isSelected == ETrue); |
|
492 |
|
493 // Check 3 is not selected |
|
494 EUNIT_PRINT(_L("Check 3 is not selected")); |
|
495 isSelected = iCGlxMediaList->IsSelected(3); |
|
496 EUNIT_ASSERT(isSelected == EFalse); |
|
497 } |
|
498 |
|
499 void UT_CGlxMediaList::UT_CGlxMediaList_SetSelectedLL( ) |
|
500 { |
|
501 // Setup test |
|
502 SetupSelectionTestL(); |
|
503 |
|
504 // Select 1 (insert at beginning) |
|
505 EUNIT_PRINT(_L("Select 1")); |
|
506 iCGlxMediaList->SetSelectedL(1, ETrue); |
|
507 |
|
508 RArray<TInt> selection; |
|
509 CleanupClosePushL(selection); |
|
510 |
|
511 TInt selectionCount = iCGlxMediaList->SelectionCount(); |
|
512 for (TInt count = 0; count < selectionCount; ++count) |
|
513 { |
|
514 selection.AppendL(iCGlxMediaList->SelectedItemIndex(count)); |
|
515 } |
|
516 |
|
517 EUNIT_PRINT(_L("Check 1, 2 and 4 is selected in order")); |
|
518 EUNIT_ASSERT(selection.Count() == 3 && selection[0] == 1 && selection[1] == 2 && selection[2] == 4); |
|
519 |
|
520 // Select 3 (insert in middle) |
|
521 EUNIT_PRINT(_L("Select 3")); |
|
522 iCGlxMediaList->SetSelectedL(3, ETrue); |
|
523 |
|
524 selection.Reset(); |
|
525 selectionCount = iCGlxMediaList->SelectionCount(); |
|
526 for (TInt count = 0; count < selectionCount; ++count) |
|
527 { |
|
528 selection.AppendL(iCGlxMediaList->SelectedItemIndex(count)); |
|
529 } |
|
530 |
|
531 EUNIT_PRINT(_L("Check 1, 2, 3 and 4 is selected in order")); |
|
532 EUNIT_ASSERT(selection.Count() == 4 && selection[0] == 1 && selection[1] == 2 && selection[2] == 3 && selection[3] == 4); |
|
533 |
|
534 // Select 3 again (already selected) |
|
535 EUNIT_PRINT(_L("Select 3 again")); |
|
536 iCGlxMediaList->SetSelectedL(3, ETrue); |
|
537 |
|
538 selection.Reset(); |
|
539 selectionCount = iCGlxMediaList->SelectionCount(); |
|
540 for (TInt count = 0; count < selectionCount; ++count) |
|
541 { |
|
542 selection.AppendL(iCGlxMediaList->SelectedItemIndex(count)); |
|
543 } |
|
544 |
|
545 EUNIT_PRINT(_L("Check 1, 2, 3 and 4 is still selected in order")); |
|
546 EUNIT_ASSERT(selection.Count() == 4 && selection[0] == 1 && selection[1] == 2 && selection[2] == 3 && selection[3] == 4); |
|
547 |
|
548 // Select 5 (insert at end) |
|
549 EUNIT_PRINT(_L("Select 5")); |
|
550 iCGlxMediaList->SetSelectedL(5, ETrue); |
|
551 |
|
552 selection.Reset(); |
|
553 selectionCount = iCGlxMediaList->SelectionCount(); |
|
554 for (TInt count = 0; count < selectionCount; ++count) |
|
555 { |
|
556 selection.AppendL(iCGlxMediaList->SelectedItemIndex(count)); |
|
557 } |
|
558 |
|
559 EUNIT_PRINT(_L("Check 1, 2, 3, 4 and 5 is selected in order")); |
|
560 EUNIT_ASSERT(selection.Count() == 5 && selection[0] == 1 && selection[1] == 2 && selection[2] == 3 && selection[3] == 4 && selection[4] == 5); |
|
561 |
|
562 // Deselect 1 (remove from beginning) |
|
563 EUNIT_PRINT(_L("Deselect 1")); |
|
564 iCGlxMediaList->SetSelectedL(1, EFalse); |
|
565 |
|
566 selection.Reset(); |
|
567 selectionCount = iCGlxMediaList->SelectionCount(); |
|
568 for (TInt count = 0; count < selectionCount; ++count) |
|
569 { |
|
570 selection.AppendL(iCGlxMediaList->SelectedItemIndex(count)); |
|
571 } |
|
572 |
|
573 EUNIT_PRINT(_L("Check 2, 3, 4 and 5 is selected in order")); |
|
574 EUNIT_ASSERT(selection.Count() == 4 && selection[0] == 2 && selection[1] == 3 && selection[2] == 4 && selection[3] == 5); |
|
575 |
|
576 // Deselect 3 (remove from middle) |
|
577 EUNIT_PRINT(_L("Deselect 3")); |
|
578 iCGlxMediaList->SetSelectedL(3, EFalse); |
|
579 |
|
580 selection.Reset(); |
|
581 selectionCount = iCGlxMediaList->SelectionCount(); |
|
582 for (TInt count = 0; count < selectionCount; ++count) |
|
583 { |
|
584 selection.AppendL(iCGlxMediaList->SelectedItemIndex(count)); |
|
585 } |
|
586 |
|
587 EUNIT_PRINT(_L("Check 2, 4 and 5 is selected in order")); |
|
588 EUNIT_ASSERT(selection.Count() == 3 && selection[0] == 2 && selection[1] == 4 && selection[2] == 5); |
|
589 |
|
590 // Deselect 3 again (already removed) |
|
591 EUNIT_PRINT(_L("Deselect 3 again")); |
|
592 iCGlxMediaList->SetSelectedL(3, EFalse); |
|
593 |
|
594 selection.Reset(); |
|
595 selectionCount = iCGlxMediaList->SelectionCount(); |
|
596 for (TInt count = 0; count < selectionCount; ++count) |
|
597 { |
|
598 selection.AppendL(iCGlxMediaList->SelectedItemIndex(count)); |
|
599 } |
|
600 |
|
601 EUNIT_PRINT(_L("Check 2, 4 and 5 is still selected in order")); |
|
602 EUNIT_ASSERT(selection.Count() == 3 && selection[0] == 2 && selection[1] == 4 && selection[2] == 5); |
|
603 |
|
604 // Deselect 5 (remove from end) |
|
605 EUNIT_PRINT(_L("Deselect 5")); |
|
606 iCGlxMediaList->SetSelectedL(5, EFalse); |
|
607 |
|
608 selection.Reset(); |
|
609 selectionCount = iCGlxMediaList->SelectionCount(); |
|
610 for (TInt count = 0; count < selectionCount; ++count) |
|
611 { |
|
612 selection.AppendL(iCGlxMediaList->SelectedItemIndex(count)); |
|
613 } |
|
614 |
|
615 EUNIT_PRINT(_L("Check 2 and 4 is selected in order")); |
|
616 EUNIT_ASSERT(selection.Count() == 2 && selection[0] == 2 && selection[1] == 4); |
|
617 |
|
618 CleanupStack::PopAndDestroy(&selection); |
|
619 } |
|
620 |
|
621 void UT_CGlxMediaList::UT_CGlxMediaList_SelectionCountL( ) |
|
622 { |
|
623 // Setup test |
|
624 SetupSelectionTestL(); |
|
625 |
|
626 // Check selection count is 2 |
|
627 TInt selectionCount = iCGlxMediaList->SelectionCount(); |
|
628 |
|
629 EUNIT_PRINT(_L("Check selection count is 2")); |
|
630 EUNIT_ASSERT(selectionCount == 2); |
|
631 } |
|
632 |
|
633 void UT_CGlxMediaList::UT_CGlxMediaList_SelectedItemIndexL( ) |
|
634 { |
|
635 // Setup test |
|
636 SetupSelectionTestL(); |
|
637 |
|
638 // Check selected item index for selection index 0 is 2 |
|
639 TInt selectedItemIndex = iCGlxMediaList->SelectedItemIndex(0); |
|
640 |
|
641 EUNIT_PRINT(_L("Check selected item index for selection index 0 is 2")); |
|
642 EUNIT_ASSERT(selectedItemIndex == 2); |
|
643 |
|
644 // Check selected item index for selection index 1 is 4 |
|
645 selectedItemIndex = iCGlxMediaList->SelectedItemIndex(1); |
|
646 |
|
647 EUNIT_PRINT(_L("Check selected item index for selection index 1 is 4")); |
|
648 EUNIT_ASSERT(selectedItemIndex == 4); |
|
649 |
|
650 // Check selected item index for out of bounds selection index is KErrNotFound |
|
651 // SelectedItemIndex does not return KErrNotFound. |
|
652 EUNIT_ASSERT_PANIC_DESC( selectedItemIndex = iCGlxMediaList->SelectedItemIndex(2) ,"USER",130,"Index out of bounds" ); |
|
653 } |
|
654 |
|
655 void UT_CGlxMediaList::UT_CGlxMediaList_CommandLL( ) |
|
656 { |
|
657 CMPXCommand* addContainerCommand = CMPXCommand::NewL(); |
|
658 CleanupStack::PushL(addContainerCommand); |
|
659 |
|
660 addContainerCommand->SetTObjectValueL<TUint32>(KMPXCommandGeneralId, KGlxCommandIdAdd); |
|
661 addContainerCommand->SetTObjectValueL<TInt>(KMPXCommandGeneralSessionId, (TInt)this); |
|
662 addContainerCommand->SetTextValueL(KMPXMediaGeneralTitle, KTitle()); |
|
663 |
|
664 EUNIT_PRINT(_L("Send add container command")); |
|
665 iCGlxMediaList->CommandL(*addContainerCommand); |
|
666 |
|
667 TInt attributeCount = addContainerCommand->Count(); |
|
668 EUNIT_PRINT(_L("Check correct attributes for sent command")); |
|
669 EUNIT_ASSERT(attributeCount == 3); |
|
670 |
|
671 TBool commandIdAvailable = addContainerCommand->IsSupported(KMPXCommandGeneralId); |
|
672 TUint32 commandId(0); |
|
673 if (commandIdAvailable) |
|
674 { |
|
675 commandId = *(addContainerCommand->Value<TUint32>(KMPXCommandGeneralId)); |
|
676 } |
|
677 EUNIT_PRINT(_L("Check command id sent and is correct value")); |
|
678 EUNIT_ASSERT(commandIdAvailable && (commandId == KGlxCommandIdAdd)); |
|
679 |
|
680 TBool sessionIdAvailable = addContainerCommand->IsSupported(KMPXCommandGeneralSessionId); |
|
681 TInt sessionId(0); |
|
682 if (sessionIdAvailable) |
|
683 { |
|
684 sessionId = *(addContainerCommand->Value<TInt>(KMPXCommandGeneralSessionId)); |
|
685 } |
|
686 EUNIT_PRINT(_L("Check session id sent and is correct value")); |
|
687 EUNIT_ASSERT(sessionIdAvailable && (sessionId == (TInt)this)); |
|
688 |
|
689 TBool titleAvailable = addContainerCommand->IsSupported(KMPXMediaGeneralTitle); |
|
690 HBufC* title = NULL; |
|
691 if (titleAvailable) |
|
692 { |
|
693 title = HBufC::NewL((addContainerCommand->ValueText(KMPXMediaGeneralTitle)).Length()); |
|
694 TPtr titlePtr = title->Des(); |
|
695 titlePtr.Append(addContainerCommand->ValueText(KMPXMediaGeneralTitle)); |
|
696 } |
|
697 EUNIT_PRINT(_L("Check title sent and is correct value")); |
|
698 EUNIT_ASSERT(titleAvailable && (*title == KTitle())); |
|
699 |
|
700 delete title; |
|
701 CleanupStack::PopAndDestroy(); // addContainerCommand |
|
702 } |
|
703 |
|
704 void UT_CGlxMediaList::UT_CGlxMediaList_CancelCommandL( ) |
|
705 { |
|
706 EUNIT_ASSERT( EFalse ); |
|
707 } |
|
708 |
|
709 void UT_CGlxMediaList::UT_CGlxMediaList_SetFilterLL( ) |
|
710 { |
|
711 // Setup test |
|
712 SetupFilterTestL(); |
|
713 |
|
714 // Change filter to videos |
|
715 EUNIT_PRINT(_L("Set filter to videos")); |
|
716 CMPXFilter* filter = iCGlxMediaList->Filter(); |
|
717 filter->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXVideo); |
|
718 iCGlxMediaList->SetFilterL(filter); |
|
719 |
|
720 filter = iCGlxMediaList->Filter(); |
|
721 |
|
722 TBool mediaCategoryAvailable = filter->IsSupported(KMPXMediaGeneralCategory); |
|
723 TMPXGeneralCategory category(EMPXNoCategory); |
|
724 if (mediaCategoryAvailable) |
|
725 { |
|
726 category = *(filter->Value<TMPXGeneralCategory>(KMPXMediaGeneralCategory)); |
|
727 } |
|
728 EUNIT_PRINT(_L("Check filter is videos")); |
|
729 EUNIT_ASSERT(mediaCategoryAvailable && (category == EMPXVideo)); |
|
730 } |
|
731 |
|
732 void UT_CGlxMediaList::UT_CGlxMediaList_FilterL( ) |
|
733 { |
|
734 // Setup test |
|
735 SetupFilterTestL(); |
|
736 |
|
737 CMPXFilter* filter = iCGlxMediaList->Filter(); |
|
738 |
|
739 TBool mediaCategoryAvailable = filter->IsSupported(KMPXMediaGeneralCategory); |
|
740 TMPXGeneralCategory category(EMPXNoCategory); |
|
741 if (mediaCategoryAvailable) |
|
742 { |
|
743 category = *(filter->Value<TMPXGeneralCategory>(KMPXMediaGeneralCategory)); |
|
744 } |
|
745 EUNIT_PRINT(_L("Check filter is images")); |
|
746 EUNIT_ASSERT(mediaCategoryAvailable && (category == EMPXImage)); |
|
747 } |
|
748 |
|
749 void UT_CGlxMediaList::UT_CGlxMediaList_HandleOpenLL( ) |
|
750 { |
|
751 EUNIT_ASSERT( EFalse ); |
|
752 } |
|
753 |
|
754 void UT_CGlxMediaList::UT_CGlxMediaList_HandleOpenL_1L( ) |
|
755 { |
|
756 EUNIT_ASSERT( EFalse ); |
|
757 } |
|
758 |
|
759 void UT_CGlxMediaList::UT_CGlxMediaList_HandleCollectionMediaLL( ) |
|
760 { |
|
761 EUNIT_ASSERT( EFalse ); |
|
762 } |
|
763 |
|
764 void UT_CGlxMediaList::UT_CGlxMediaList_HandleCollectionMessageL_1L( ) |
|
765 { |
|
766 CGlxMediaListObserverTest* mediaListObserver = CGlxMediaListObserverTest::NewL(); |
|
767 CleanupStack::PushL(mediaListObserver); |
|
768 |
|
769 iCGlxMediaList->AddMediaListObserverL(mediaListObserver); |
|
770 |
|
771 CMPXMessage* message = CMPXMessage::NewL(); |
|
772 CleanupStack::PushL(message); |
|
773 |
|
774 message->SetTObjectValueL<TUint32>(KMPXMessageGeneralId, KMPXMessageContentIdProgress); |
|
775 message->SetTObjectValueL<TInt>(KMPXCommandGeneralSessionId, (TInt)this); |
|
776 message->SetTObjectValueL<TInt>(KProgressTotalCountAttr, KProgressTotalCount); |
|
777 |
|
778 // Send progress messages |
|
779 EUNIT_PRINT(_L("Send progress messages")); |
|
780 for (TInt count = 0; count < KProgressTotalCount; ++count) |
|
781 { |
|
782 message->SetTObjectValueL<TInt>(KProgressCountAttr, count + 1); |
|
783 iCGlxMediaList->HandleCollectionMessageL(*message); |
|
784 } |
|
785 |
|
786 CleanupStack::PopAndDestroy(); // message |
|
787 |
|
788 // Check correct notification was observed |
|
789 const TInt messageCount = mediaListObserver->MessageCount(); |
|
790 |
|
791 EUNIT_PRINT(_L("Check correct number of messages was received by observer")); |
|
792 EUNIT_ASSERT(messageCount == KProgressTotalCount); |
|
793 |
|
794 const MGlxMediaList* observedMediaList = mediaListObserver->List(); |
|
795 |
|
796 EUNIT_PRINT(_L("Check correct media list was received by observer")); |
|
797 EUNIT_ASSERT(observedMediaList == (MGlxMediaList*)iCGlxMediaList); |
|
798 |
|
799 const CMPXMessage* observedMessage = mediaListObserver->Message(); |
|
800 TInt attributeCount = observedMessage->Count(); |
|
801 |
|
802 EUNIT_PRINT(_L("Check correct number of attributes for received progress message")); |
|
803 EUNIT_ASSERT(attributeCount == 4); |
|
804 |
|
805 TBool messageIdAvailable = observedMessage->IsSupported(KMPXMessageGeneralId); |
|
806 TUint32 messageId(0); |
|
807 if (messageIdAvailable) |
|
808 { |
|
809 messageId = *(observedMessage->Value<TUint32>(KMPXMessageGeneralId)); |
|
810 } |
|
811 EUNIT_PRINT(_L("Check message id received and is correct value")); |
|
812 EUNIT_ASSERT(messageIdAvailable && (messageId == KMPXMessageContentIdProgress)); |
|
813 |
|
814 TBool sessionIdAvailable = observedMessage->IsSupported(KMPXCommandGeneralSessionId); |
|
815 TInt sessionId(0); |
|
816 if (sessionIdAvailable) |
|
817 { |
|
818 sessionId = *(observedMessage->Value<TInt>(KMPXCommandGeneralSessionId)); |
|
819 } |
|
820 EUNIT_PRINT(_L("Check session id received and is correct value")); |
|
821 EUNIT_ASSERT(sessionIdAvailable && (sessionId == (TInt)this)); |
|
822 |
|
823 TBool progressCountAvailable = observedMessage->IsSupported(KProgressCountAttr); |
|
824 TInt progressCount(0); |
|
825 if (progressCountAvailable) |
|
826 { |
|
827 progressCount = *(observedMessage->Value<TInt>(KProgressCountAttr)); |
|
828 } |
|
829 EUNIT_PRINT(_L("Check progress current count received and is correct value")); |
|
830 EUNIT_ASSERT(progressCountAvailable && (progressCount == KProgressTotalCount)); |
|
831 |
|
832 TBool progressTotalCountAvailable = observedMessage->IsSupported(KProgressTotalCountAttr); |
|
833 TInt progressTotalCount(0); |
|
834 if (progressTotalCountAvailable) |
|
835 { |
|
836 progressTotalCount = *(observedMessage->Value<TInt>(KProgressTotalCountAttr)); |
|
837 } |
|
838 EUNIT_PRINT(_L("Check progress total count received and is correct value")); |
|
839 EUNIT_ASSERT(progressTotalCountAvailable && (progressTotalCount == KProgressTotalCount)); |
|
840 |
|
841 iCGlxMediaList->RemoveMediaListObserver(mediaListObserver); |
|
842 |
|
843 CleanupStack::PopAndDestroy(); // mediaListObserver |
|
844 } |
|
845 |
|
846 void UT_CGlxMediaList::SetupFocusTestL() |
|
847 { |
|
848 // Initial focus 3 |
|
849 EUNIT_PRINT(_L("Initial focus 3")); |
|
850 iCGlxMediaList->SetFocusL(NGlxListDefs::EAbsolute, 3); |
|
851 } |
|
852 |
|
853 void UT_CGlxMediaList::SetupPathTestL() |
|
854 { |
|
855 SetupSelectionTestL(); |
|
856 } |
|
857 |
|
858 void UT_CGlxMediaList::SetupSelectionTestL() |
|
859 { |
|
860 // Initial selection 2 and 4 |
|
861 EUNIT_PRINT(_L("Initial selection 2 and 4")); |
|
862 iCGlxMediaList->SetSelectedL(2, ETrue); |
|
863 iCGlxMediaList->SetSelectedL(4, ETrue); |
|
864 } |
|
865 |
|
866 void UT_CGlxMediaList::SetupFilterTestL() |
|
867 { |
|
868 // Initial filter images |
|
869 EUNIT_PRINT(_L("Initial filter images")); |
|
870 CMPXFilter* filter = CMPXFilter::NewL(); |
|
871 CleanupStack::PushL(filter); |
|
872 |
|
873 filter->SetTObjectValueL<TMPXGeneralCategory>(KMPXMediaGeneralCategory, EMPXImage); |
|
874 |
|
875 iCGlxMediaList->SetFilterL(filter); |
|
876 |
|
877 CleanupStack::Pop(filter); // filter ownership passed to media list |
|
878 } |
|
879 |
|
880 void UT_CGlxMediaList::MoveFocusAbsoluteGreaterThanCurrentFocusL() |
|
881 { |
|
882 CGlxMediaListObserverTest* mediaListObserver = CGlxMediaListObserverTest::NewL(); |
|
883 CleanupStack::PushL(mediaListObserver); |
|
884 |
|
885 iCGlxMediaList->AddMediaListObserverL(mediaListObserver); |
|
886 |
|
887 // Set focus to absolute value 4 |
|
888 EUNIT_PRINT(_L("Set focus to absolute value 4")); |
|
889 iCGlxMediaList->SetFocusL(NGlxListDefs::EAbsolute, 4); |
|
890 |
|
891 // Check focus is index 4 |
|
892 EUNIT_PRINT(_L("Check focus is index 4")); |
|
893 TInt focusIndex = iCGlxMediaList->FocusIndex(); |
|
894 EUNIT_ASSERT(focusIndex == 4); |
|
895 |
|
896 // Check correct notification was observed |
|
897 EUNIT_PRINT(_L("Check correct media list was received by observer")); |
|
898 const MGlxMediaList* observedMediaList = mediaListObserver->List(); |
|
899 EUNIT_ASSERT(observedMediaList == (MGlxMediaList*)iCGlxMediaList); |
|
900 |
|
901 EUNIT_PRINT(_L("Check correct focus change type was received by observer")); |
|
902 NGlxListDefs::TFocusChangeType observedFocusChangeType = mediaListObserver->FocusChangeType(); |
|
903 EUNIT_ASSERT(observedFocusChangeType == NGlxListDefs::EForward); |
|
904 |
|
905 EUNIT_PRINT(_L("Check correct new focus index was received by observer")); |
|
906 TInt observedFocusNewIndex = mediaListObserver->FocusNewIndex(); |
|
907 EUNIT_ASSERT(observedFocusNewIndex == 4); |
|
908 |
|
909 EUNIT_PRINT(_L("Check correct old focus index was received by observer")); |
|
910 TInt observedFocusOldIndex = mediaListObserver->FocusOldIndex(); |
|
911 EUNIT_ASSERT(observedFocusOldIndex == 3); |
|
912 |
|
913 iCGlxMediaList->RemoveMediaListObserver(mediaListObserver); |
|
914 |
|
915 CleanupStack::PopAndDestroy(); // mediaListObserver |
|
916 } |
|
917 |
|
918 void UT_CGlxMediaList::MoveFocusAbsoluteLessThanCurrentFocusL() |
|
919 { |
|
920 CGlxMediaListObserverTest* mediaListObserver = CGlxMediaListObserverTest::NewL(); |
|
921 CleanupStack::PushL(mediaListObserver); |
|
922 |
|
923 iCGlxMediaList->AddMediaListObserverL(mediaListObserver); |
|
924 |
|
925 // Set focus to absolute value 2 |
|
926 EUNIT_PRINT(_L("Set focus to absolute value 2")); |
|
927 iCGlxMediaList->SetFocusL(NGlxListDefs::EAbsolute, 2); |
|
928 |
|
929 // Check focus is index 2 |
|
930 EUNIT_PRINT(_L("Check focus is index 2")); |
|
931 TInt focusIndex = iCGlxMediaList->FocusIndex(); |
|
932 EUNIT_ASSERT(focusIndex == 2); |
|
933 |
|
934 // Check correct notification was observed |
|
935 EUNIT_PRINT(_L("Check correct media list was received by observer")); |
|
936 const MGlxMediaList* observedMediaList = mediaListObserver->List(); |
|
937 EUNIT_ASSERT(observedMediaList == (MGlxMediaList*)iCGlxMediaList); |
|
938 |
|
939 EUNIT_PRINT(_L("Check correct focus change type was received by observer")); |
|
940 NGlxListDefs::TFocusChangeType observedFocusChangeType = mediaListObserver->FocusChangeType(); |
|
941 EUNIT_ASSERT(observedFocusChangeType == NGlxListDefs::EBackward); |
|
942 |
|
943 EUNIT_PRINT(_L("Check correct new focus index was received by observer")); |
|
944 TInt observedFocusNewIndex = mediaListObserver->FocusNewIndex(); |
|
945 EUNIT_ASSERT(observedFocusNewIndex == 2); |
|
946 |
|
947 EUNIT_PRINT(_L("Check correct old focus index was received by observer")); |
|
948 TInt observedFocusOldIndex = mediaListObserver->FocusOldIndex(); |
|
949 EUNIT_ASSERT(observedFocusOldIndex == 4); |
|
950 |
|
951 iCGlxMediaList->RemoveMediaListObserver(mediaListObserver); |
|
952 |
|
953 CleanupStack::PopAndDestroy(); // mediaListObserver |
|
954 } |
|
955 |
|
956 void UT_CGlxMediaList::MoveFocusRelativeForwardL() |
|
957 { |
|
958 CGlxMediaListObserverTest* mediaListObserver = CGlxMediaListObserverTest::NewL(); |
|
959 CleanupStack::PushL(mediaListObserver); |
|
960 |
|
961 iCGlxMediaList->AddMediaListObserverL(mediaListObserver); |
|
962 |
|
963 // Set focus to relative value forward 1 |
|
964 EUNIT_PRINT(_L("Set focus to relative value forward 1")); |
|
965 iCGlxMediaList->SetFocusL(NGlxListDefs::ERelative, 1); |
|
966 |
|
967 // Check focus is index 3 |
|
968 EUNIT_PRINT(_L("Check focus is index 3")); |
|
969 TInt focusIndex = iCGlxMediaList->FocusIndex(); |
|
970 EUNIT_ASSERT(focusIndex == 3); |
|
971 |
|
972 // Check correct notification was observed |
|
973 EUNIT_PRINT(_L("Check correct media list was received by observer")); |
|
974 const MGlxMediaList* observedMediaList = mediaListObserver->List(); |
|
975 EUNIT_ASSERT(observedMediaList == (MGlxMediaList*)iCGlxMediaList); |
|
976 |
|
977 EUNIT_PRINT(_L("Check correct focus change type was received by observer")); |
|
978 NGlxListDefs::TFocusChangeType observedFocusChangeType = mediaListObserver->FocusChangeType(); |
|
979 EUNIT_ASSERT(observedFocusChangeType == NGlxListDefs::EForward); |
|
980 |
|
981 EUNIT_PRINT(_L("Check correct new focus index was received by observer")); |
|
982 TInt observedFocusNewIndex = mediaListObserver->FocusNewIndex(); |
|
983 EUNIT_ASSERT(observedFocusNewIndex == 3); |
|
984 |
|
985 EUNIT_PRINT(_L("Check correct old focus index was received by observer")); |
|
986 TInt observedFocusOldIndex = mediaListObserver->FocusOldIndex(); |
|
987 EUNIT_ASSERT(observedFocusOldIndex == 2); |
|
988 |
|
989 iCGlxMediaList->RemoveMediaListObserver(mediaListObserver); |
|
990 |
|
991 CleanupStack::PopAndDestroy(); // mediaListObserver |
|
992 } |
|
993 |
|
994 void UT_CGlxMediaList::MoveFocusRelativeBackwardL() |
|
995 { |
|
996 CGlxMediaListObserverTest* mediaListObserver = CGlxMediaListObserverTest::NewL(); |
|
997 CleanupStack::PushL(mediaListObserver); |
|
998 |
|
999 iCGlxMediaList->AddMediaListObserverL(mediaListObserver); |
|
1000 |
|
1001 // Set focus to relative value backwards 1 |
|
1002 EUNIT_PRINT(_L("Set focus to relative value backwards 1")); |
|
1003 iCGlxMediaList->SetFocusL(NGlxListDefs::ERelative, -1); |
|
1004 |
|
1005 // Check focus is index 2 |
|
1006 EUNIT_PRINT(_L("Check focus is index 2")); |
|
1007 TInt focusIndex = iCGlxMediaList->FocusIndex(); |
|
1008 EUNIT_ASSERT(focusIndex == 2); |
|
1009 |
|
1010 // Check correct notification was observed |
|
1011 EUNIT_PRINT(_L("Check correct media list was received by observer")); |
|
1012 const MGlxMediaList* observedMediaList = mediaListObserver->List(); |
|
1013 EUNIT_ASSERT(observedMediaList == (MGlxMediaList*)iCGlxMediaList); |
|
1014 |
|
1015 EUNIT_PRINT(_L("Check correct focus change type was received by observer")); |
|
1016 NGlxListDefs::TFocusChangeType observedFocusChangeType = mediaListObserver->FocusChangeType(); |
|
1017 EUNIT_ASSERT(observedFocusChangeType == NGlxListDefs::EBackward); |
|
1018 |
|
1019 EUNIT_PRINT(_L("Check correct new focus index was received by observer")); |
|
1020 TInt observedFocusNewIndex = mediaListObserver->FocusNewIndex(); |
|
1021 EUNIT_ASSERT(observedFocusNewIndex == 2); |
|
1022 |
|
1023 EUNIT_PRINT(_L("Check correct old focus index was received by observer")); |
|
1024 TInt observedFocusOldIndex = mediaListObserver->FocusOldIndex(); |
|
1025 EUNIT_ASSERT(observedFocusOldIndex == 3); |
|
1026 |
|
1027 iCGlxMediaList->RemoveMediaListObserver(mediaListObserver); |
|
1028 |
|
1029 CleanupStack::PopAndDestroy(); // mediaListObserver |
|
1030 } |
|
1031 |
|
1032 void UT_CGlxMediaList::MoveFocusRelativeForwardGreaterThanListCountL() |
|
1033 { |
|
1034 CGlxMediaListObserverTest* mediaListObserver = CGlxMediaListObserverTest::NewL(); |
|
1035 CleanupStack::PushL(mediaListObserver); |
|
1036 |
|
1037 iCGlxMediaList->AddMediaListObserverL(mediaListObserver); |
|
1038 |
|
1039 // Set focus to relative value forward list count - 1 |
|
1040 EUNIT_PRINT(_L("Set focus to relative value forward list count - 1")); |
|
1041 TInt listCount = iCGlxMediaList->Count(); |
|
1042 iCGlxMediaList->SetFocusL(NGlxListDefs::ERelative, listCount - 1); |
|
1043 |
|
1044 // Check focus is index 1 |
|
1045 EUNIT_PRINT(_L("Check focus is index 1")); |
|
1046 TInt focusIndex = iCGlxMediaList->FocusIndex(); |
|
1047 EUNIT_ASSERT(focusIndex == 1); |
|
1048 |
|
1049 // Check correct notification was observed |
|
1050 EUNIT_PRINT(_L("Check correct media list was received by observer")); |
|
1051 const MGlxMediaList* observedMediaList = mediaListObserver->List(); |
|
1052 EUNIT_ASSERT(observedMediaList == (MGlxMediaList*)iCGlxMediaList); |
|
1053 |
|
1054 EUNIT_PRINT(_L("Check correct focus change type was received by observer")); |
|
1055 NGlxListDefs::TFocusChangeType observedFocusChangeType = mediaListObserver->FocusChangeType(); |
|
1056 EUNIT_ASSERT(observedFocusChangeType == NGlxListDefs::EForward); |
|
1057 |
|
1058 EUNIT_PRINT(_L("Check correct new focus index was received by observer")); |
|
1059 TInt observedFocusNewIndex = mediaListObserver->FocusNewIndex(); |
|
1060 EUNIT_ASSERT(observedFocusNewIndex == 1); |
|
1061 |
|
1062 EUNIT_PRINT(_L("Check correct old focus index was received by observer")); |
|
1063 TInt observedFocusOldIndex = mediaListObserver->FocusOldIndex(); |
|
1064 EUNIT_ASSERT(observedFocusOldIndex == 2); |
|
1065 |
|
1066 iCGlxMediaList->RemoveMediaListObserver(mediaListObserver); |
|
1067 |
|
1068 CleanupStack::PopAndDestroy(); // mediaListObserver |
|
1069 } |
|
1070 |
|
1071 void UT_CGlxMediaList::MoveFocusRelativeBackwardLessThanZeroL() |
|
1072 { |
|
1073 CGlxMediaListObserverTest* mediaListObserver = CGlxMediaListObserverTest::NewL(); |
|
1074 CleanupStack::PushL(mediaListObserver); |
|
1075 |
|
1076 iCGlxMediaList->AddMediaListObserverL(mediaListObserver); |
|
1077 |
|
1078 // Set focus to relative value backwards 2 |
|
1079 EUNIT_PRINT(_L("Set focus to relative value backwards 2")); |
|
1080 iCGlxMediaList->SetFocusL(NGlxListDefs::ERelative, -2); |
|
1081 |
|
1082 // Check focus is index (list count - 1) |
|
1083 EUNIT_PRINT(_L("Check focus is index (list count - 1)")); |
|
1084 TInt listCount = iCGlxMediaList->Count(); |
|
1085 TInt focusIndex = iCGlxMediaList->FocusIndex(); |
|
1086 EUNIT_ASSERT(focusIndex == (listCount - 1)); |
|
1087 |
|
1088 // Check correct notification was observed |
|
1089 EUNIT_PRINT(_L("Check correct media list was received by observer")); |
|
1090 const MGlxMediaList* observedMediaList = mediaListObserver->List(); |
|
1091 EUNIT_ASSERT(observedMediaList == (MGlxMediaList*)iCGlxMediaList); |
|
1092 |
|
1093 EUNIT_PRINT(_L("Check correct focus change type was received by observer")); |
|
1094 NGlxListDefs::TFocusChangeType observedFocusChangeType = mediaListObserver->FocusChangeType(); |
|
1095 EUNIT_ASSERT(observedFocusChangeType == NGlxListDefs::EBackward); |
|
1096 |
|
1097 EUNIT_PRINT(_L("Check correct new focus index was received by observer")); |
|
1098 TInt observedFocusNewIndex = mediaListObserver->FocusNewIndex(); |
|
1099 EUNIT_ASSERT(observedFocusNewIndex == (listCount - 1)); |
|
1100 |
|
1101 EUNIT_PRINT(_L("Check correct old focus index was received by observer")); |
|
1102 TInt observedFocusOldIndex = mediaListObserver->FocusOldIndex(); |
|
1103 EUNIT_ASSERT(observedFocusOldIndex == 1); |
|
1104 |
|
1105 iCGlxMediaList->RemoveMediaListObserver(mediaListObserver); |
|
1106 |
|
1107 CleanupStack::PopAndDestroy(); // mediaListObserver |
|
1108 } |
|
1109 |
|
1110 void UT_CGlxMediaList::ReceiveMessageItemChangedItemModifiedL() |
|
1111 { |
|
1112 iSchedulerWait->Start(); // wait for attributes to be retrieved (HandleAttributesAvailableL will be called) |
|
1113 |
|
1114 // Check media attributes initial count |
|
1115 TInt listIndex = iCGlxMediaList->Index(NULL, TGlxMediaId(KFavouritesAlbumFirstItemId)); |
|
1116 |
|
1117 EUNIT_PRINT(_L("Check initial media has 1 attribute")); |
|
1118 const TGlxMedia& tGlxMediaBefore = iCGlxMediaList->Item(listIndex); |
|
1119 const CGlxMedia* cGlxMediaBefore = tGlxMediaBefore.Properties(); |
|
1120 EUNIT_ASSERT(cGlxMediaBefore->Count() == 1); |
|
1121 |
|
1122 CGlxMediaListObserverTest* mediaListObserver = CGlxMediaListObserverTest::NewL(); |
|
1123 CleanupStack::PushL(mediaListObserver); |
|
1124 |
|
1125 iCGlxMediaList->AddMediaListObserverL(mediaListObserver); |
|
1126 |
|
1127 // Send item modified notification for item not in list |
|
1128 EUNIT_PRINT(_L("Send item modified notification for item not in list")); |
|
1129 TMPXCollectionMessage message1(TMPXCollectionMessage::EItemChanged, EMcItemModified, KFavouritesAlbumId); |
|
1130 // iCGlxMediaList->HandleCollectionMessageL(message1); |
|
1131 |
|
1132 // Check no notification was observed |
|
1133 TInt messageCount = mediaListObserver->MessageCount(); |
|
1134 |
|
1135 EUNIT_PRINT(_L("Check no messages was received by observer")); |
|
1136 EUNIT_ASSERT(messageCount == 0); |
|
1137 |
|
1138 // Send item modified notification for item in list |
|
1139 EUNIT_PRINT(_L("Send item modified notification for item in list")); |
|
1140 TMPXCollectionMessage message2(TMPXCollectionMessage::EItemChanged, EMcItemModified, KFavouritesAlbumFirstItemId); |
|
1141 // iCGlxMediaList->HandleCollectionMessageL(message2); |
|
1142 |
|
1143 // Check correct notification was observed |
|
1144 messageCount = mediaListObserver->MessageCount(); |
|
1145 |
|
1146 EUNIT_PRINT(_L("Check correct number of messages was received by observer")); |
|
1147 EUNIT_ASSERT(messageCount == 1); |
|
1148 |
|
1149 const MGlxMediaList* observedMediaList = mediaListObserver->List(); |
|
1150 |
|
1151 EUNIT_PRINT(_L("Check correct media list was received by observer")); |
|
1152 EUNIT_ASSERT(observedMediaList == (MGlxMediaList*)iCGlxMediaList); |
|
1153 |
|
1154 const RArray<TInt>& modifiedItemIndices = mediaListObserver->ModifiedItemIndices(); |
|
1155 |
|
1156 EUNIT_PRINT(_L("Check correct number of modified items was received by observer")); |
|
1157 TInt modifiedItemIndicesCount = modifiedItemIndices.Count(); |
|
1158 EUNIT_ASSERT(modifiedItemIndicesCount == 1); |
|
1159 |
|
1160 EUNIT_PRINT(_L("Check correct modified items was received by observer")); |
|
1161 TInt modifedItemIndex = modifiedItemIndices[0]; |
|
1162 EUNIT_ASSERT(modifedItemIndex == listIndex); |
|
1163 |
|
1164 // Check media attributes removed |
|
1165 EUNIT_PRINT(_L("Check media has no attributes")); |
|
1166 const TGlxMedia& tGlxMediaAfter = iCGlxMediaList->Item(listIndex); |
|
1167 const CGlxMedia* cGlxMediaAfter = tGlxMediaAfter.Properties(); |
|
1168 EUNIT_ASSERT(cGlxMediaAfter->Count() == 0); |
|
1169 |
|
1170 iCGlxMediaList->RemoveMediaListObserver(mediaListObserver); |
|
1171 |
|
1172 CleanupStack::PopAndDestroy(mediaListObserver); |
|
1173 } |
|
1174 |
|
1175 UT_CGlxMediaList::CGlxMediaListObserverTest* UT_CGlxMediaList::CGlxMediaListObserverTest::NewL() |
|
1176 { |
|
1177 CGlxMediaListObserverTest* self = new (ELeave) CGlxMediaListObserverTest(); |
|
1178 CleanupStack::PushL(self); |
|
1179 self->ConstructL(); |
|
1180 CleanupStack::Pop(); |
|
1181 return self; |
|
1182 } |
|
1183 |
|
1184 UT_CGlxMediaList::CGlxMediaListObserverTest::~CGlxMediaListObserverTest() |
|
1185 { |
|
1186 delete iMessage; |
|
1187 iMessage = NULL; |
|
1188 |
|
1189 iModifiedItemIndices.Close(); |
|
1190 } |
|
1191 |
|
1192 UT_CGlxMediaList::CGlxMediaListObserverTest::CGlxMediaListObserverTest() : |
|
1193 iList(NULL), |
|
1194 iFocusChangeType(NGlxListDefs::EUnknown), |
|
1195 iFocusNewIndex(KErrNotFound), |
|
1196 iFocusOldIndex(KErrNotFound), |
|
1197 iModifiedItemIndices(), |
|
1198 iMessage(NULL), |
|
1199 iMessageCount(0) |
|
1200 { |
|
1201 } |
|
1202 |
|
1203 void UT_CGlxMediaList::CGlxMediaListObserverTest::ConstructL() |
|
1204 { |
|
1205 iMessage = CMPXMessage::NewL(); |
|
1206 } |
|
1207 |
|
1208 void UT_CGlxMediaList::CGlxMediaListObserverTest::HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList) |
|
1209 { |
|
1210 iList = aList; |
|
1211 |
|
1212 iFocusChangeType = aType; |
|
1213 iFocusNewIndex = aNewIndex; |
|
1214 iFocusOldIndex = aOldIndex; |
|
1215 |
|
1216 ++iMessageCount; |
|
1217 } |
|
1218 |
|
1219 void UT_CGlxMediaList::CGlxMediaListObserverTest::HandleItemModifiedL(const RArray<TInt>& aItemIndices, MGlxMediaList* aList) |
|
1220 { |
|
1221 iList = aList; |
|
1222 |
|
1223 TInt itemIndexCount = aItemIndices.Count(); |
|
1224 for (TInt count = 0; count < itemIndexCount; ++count) |
|
1225 { |
|
1226 iModifiedItemIndices.AppendL(aItemIndices[count]); |
|
1227 } |
|
1228 |
|
1229 ++iMessageCount; |
|
1230 } |
|
1231 |
|
1232 void UT_CGlxMediaList::CGlxMediaListObserverTest::HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList) |
|
1233 { |
|
1234 iList = aList; |
|
1235 |
|
1236 if (aMessage.IsSupported(KMPXMessageGeneralId)) |
|
1237 { |
|
1238 TUint32 messageId = *(aMessage.Value<TUint32>(KMPXMessageGeneralId)); |
|
1239 iMessage->SetTObjectValueL<TUint32>(KMPXMessageGeneralId, messageId); |
|
1240 } |
|
1241 |
|
1242 if (aMessage.IsSupported(KMPXCommandGeneralSessionId)) |
|
1243 { |
|
1244 TInt sessionId = *(aMessage.Value<TInt>(KMPXCommandGeneralSessionId)); |
|
1245 iMessage->SetTObjectValueL<TInt>(KMPXCommandGeneralSessionId, sessionId); |
|
1246 } |
|
1247 |
|
1248 if (aMessage.IsSupported(KProgressCountAttr)) |
|
1249 { |
|
1250 TInt progressCount = *(aMessage.Value<TInt>(KProgressCountAttr)); |
|
1251 iMessage->SetTObjectValueL<TInt>(KProgressCountAttr, progressCount); |
|
1252 } |
|
1253 |
|
1254 if (aMessage.IsSupported(KProgressTotalCountAttr)) |
|
1255 { |
|
1256 TInt progressTotalCount = *(aMessage.Value<TInt>(KProgressTotalCountAttr)); |
|
1257 iMessage->SetTObjectValueL<TInt>(KProgressTotalCountAttr, progressTotalCount); |
|
1258 } |
|
1259 |
|
1260 ++iMessageCount; |
|
1261 } |
|
1262 |
|
1263 // TEST TABLE |
|
1264 |
|
1265 EUNIT_BEGIN_TEST_TABLE( |
|
1266 UT_CGlxMediaList, |
|
1267 "Unit tests for CGlxMediaList", |
|
1268 "UNIT" ) |
|
1269 |
|
1270 EUNIT_TEST( |
|
1271 "InstanceL - test ", |
|
1272 "CGlxMediaList", |
|
1273 "InstanceL", |
|
1274 "FUNCTIONALITY", |
|
1275 SetupL, UT_CGlxMediaList_InstanceLL, Teardown) |
|
1276 |
|
1277 EUNIT_TEST( |
|
1278 "MediaLists - test ", |
|
1279 "CGlxMediaList", |
|
1280 "MediaLists", |
|
1281 "FUNCTIONALITY", |
|
1282 SetupL, UT_CGlxMediaList_MediaListsL, Teardown) |
|
1283 /* |
|
1284 EUNIT_TEST( |
|
1285 "NewLC - test ", |
|
1286 "CGlxMediaList", |
|
1287 "NewLC", |
|
1288 "FUNCTIONALITY", |
|
1289 SetupL, UT_CGlxMediaList_NewLCL, Teardown) |
|
1290 |
|
1291 EUNIT_TEST( |
|
1292 "OpenL - test ", |
|
1293 "CGlxMediaList", |
|
1294 "OpenL", |
|
1295 "FUNCTIONALITY", |
|
1296 SetupL, UT_CGlxMediaList_OpenLL, Teardown) |
|
1297 |
|
1298 EUNIT_TEST( |
|
1299 "AddReference - test ", |
|
1300 "CGlxMediaList", |
|
1301 "AddReference", |
|
1302 "FUNCTIONALITY", |
|
1303 SetupL, UT_CGlxMediaList_AddReferenceL, Teardown) |
|
1304 |
|
1305 EUNIT_TEST( |
|
1306 "RemoveReference - test ", |
|
1307 "CGlxMediaList", |
|
1308 "RemoveReference", |
|
1309 "FUNCTIONALITY", |
|
1310 SetupL, UT_CGlxMediaList_RemoveReferenceL, Teardown) |
|
1311 |
|
1312 EUNIT_TEST( |
|
1313 "ReferenceCount - test ", |
|
1314 "CGlxMediaList", |
|
1315 "ReferenceCount", |
|
1316 "FUNCTIONALITY", |
|
1317 SetupL, UT_CGlxMediaList_ReferenceCountL, Teardown) |
|
1318 |
|
1319 EUNIT_TEST( |
|
1320 "Equals - test ", |
|
1321 "CGlxMediaList", |
|
1322 "Equals", |
|
1323 "FUNCTIONALITY", |
|
1324 SetupL, UT_CGlxMediaList_EqualsL, Teardown) |
|
1325 |
|
1326 EUNIT_TEST( |
|
1327 "OfferMedia - test ", |
|
1328 "CGlxMediaList", |
|
1329 "OfferMedia", |
|
1330 "FUNCTIONALITY", |
|
1331 SetupL, UT_CGlxMediaList_OfferMediaL, Teardown) |
|
1332 |
|
1333 EUNIT_TEST( |
|
1334 "HandleAttributesAvailableL - test ", |
|
1335 "CGlxMediaList", |
|
1336 "HandleAttributesAvailableL", |
|
1337 "FUNCTIONALITY", |
|
1338 SetupL, UT_CGlxMediaList_HandleAttributesAvailableLL, Teardown) |
|
1339 |
|
1340 EUNIT_TEST( |
|
1341 "AttributeRequestL - test ", |
|
1342 "CGlxMediaList", |
|
1343 "AttributeRequestL", |
|
1344 "FUNCTIONALITY", |
|
1345 SetupL, UT_CGlxMediaList_AttributeRequestLL, Teardown) |
|
1346 |
|
1347 EUNIT_TEST( |
|
1348 "Close - test ", |
|
1349 "CGlxMediaList", |
|
1350 "Close", |
|
1351 "FUNCTIONALITY", |
|
1352 SetupL, UT_CGlxMediaList_CloseL, Teardown) |
|
1353 |
|
1354 EUNIT_TEST( |
|
1355 "Id - test ", |
|
1356 "CGlxMediaList", |
|
1357 "Id", |
|
1358 "FUNCTIONALITY", |
|
1359 SetupL, UT_CGlxMediaList_IdL, Teardown) |
|
1360 |
|
1361 EUNIT_TEST( |
|
1362 "Count - test ", |
|
1363 "CGlxMediaList", |
|
1364 "Count", |
|
1365 "FUNCTIONALITY", |
|
1366 SetupL, UT_CGlxMediaList_CountL, Teardown) |
|
1367 */ |
|
1368 EUNIT_TEST( |
|
1369 "FocusIndex - test ", |
|
1370 "CGlxMediaList", |
|
1371 "FocusIndex", |
|
1372 "FUNCTIONALITY", |
|
1373 SetupL, UT_CGlxMediaList_FocusIndexL, Teardown) |
|
1374 |
|
1375 EUNIT_TEST( |
|
1376 "SetFocusL - test ", |
|
1377 "CGlxMediaList", |
|
1378 "SetFocusL", |
|
1379 "FUNCTIONALITY", |
|
1380 SetupL, UT_CGlxMediaList_SetFocusLL, Teardown) |
|
1381 /* |
|
1382 EUNIT_TEST( |
|
1383 "Item - test ", |
|
1384 "CGlxMediaList", |
|
1385 "Item", |
|
1386 "FUNCTIONALITY", |
|
1387 SetupL, UT_CGlxMediaList_ItemL, Teardown) |
|
1388 |
|
1389 EUNIT_TEST( |
|
1390 "Index - test ", |
|
1391 "CGlxMediaList", |
|
1392 "Index", |
|
1393 "FUNCTIONALITY", |
|
1394 SetupL, UT_CGlxMediaList_IndexL, Teardown) |
|
1395 |
|
1396 EUNIT_TEST( |
|
1397 "AddMediaListObserverL - test ", |
|
1398 "CGlxMediaList", |
|
1399 "AddMediaListObserverL", |
|
1400 "FUNCTIONALITY", |
|
1401 SetupL, UT_CGlxMediaList_AddMediaListObserverLL, Teardown) |
|
1402 |
|
1403 EUNIT_TEST( |
|
1404 "RemoveMediaListObserver - test ", |
|
1405 "CGlxMediaList", |
|
1406 "RemoveMediaListObserver", |
|
1407 "FUNCTIONALITY", |
|
1408 SetupL, UT_CGlxMediaList_RemoveMediaListObserverL, Teardown) |
|
1409 |
|
1410 EUNIT_TEST( |
|
1411 "AddContextL - test ", |
|
1412 "CGlxMediaList", |
|
1413 "AddContextL", |
|
1414 "FUNCTIONALITY", |
|
1415 SetupL, UT_CGlxMediaList_AddContextLL, Teardown) |
|
1416 |
|
1417 EUNIT_TEST( |
|
1418 "RemoveContext - test ", |
|
1419 "CGlxMediaList", |
|
1420 "RemoveContext", |
|
1421 "FUNCTIONALITY", |
|
1422 SetupL, UT_CGlxMediaList_RemoveContextL, Teardown) |
|
1423 |
|
1424 EUNIT_TEST( |
|
1425 "Collection - test ", |
|
1426 "CGlxMediaList", |
|
1427 "Collection", |
|
1428 "FUNCTIONALITY", |
|
1429 SetupL, UT_CGlxMediaList_CollectionL, Teardown) |
|
1430 */ |
|
1431 EUNIT_TEST( |
|
1432 "PathLC - test ", |
|
1433 "CGlxMediaList", |
|
1434 "PathLC", |
|
1435 "FUNCTIONALITY", |
|
1436 SetupL, UT_CGlxMediaList_PathLCL, Teardown) |
|
1437 |
|
1438 EUNIT_TEST( |
|
1439 "IsSelected - test ", |
|
1440 "CGlxMediaList", |
|
1441 "IsSelected", |
|
1442 "FUNCTIONALITY", |
|
1443 SetupL, UT_CGlxMediaList_IsSelectedL, Teardown) |
|
1444 |
|
1445 EUNIT_TEST( |
|
1446 "SetSelectedL - test ", |
|
1447 "CGlxMediaList", |
|
1448 "SetSelectedL", |
|
1449 "FUNCTIONALITY", |
|
1450 SetupL, UT_CGlxMediaList_SetSelectedLL, Teardown) |
|
1451 |
|
1452 EUNIT_TEST( |
|
1453 "SelectionCount - test ", |
|
1454 "CGlxMediaList", |
|
1455 "SelectionCount", |
|
1456 "FUNCTIONALITY", |
|
1457 SetupL, UT_CGlxMediaList_SelectionCountL, Teardown) |
|
1458 |
|
1459 EUNIT_TEST( |
|
1460 "SelectedItemIndex - test ", |
|
1461 "CGlxMediaList", |
|
1462 "SelectedItemIndex", |
|
1463 "FUNCTIONALITY", |
|
1464 SetupL, UT_CGlxMediaList_SelectedItemIndexL, Teardown) |
|
1465 |
|
1466 EUNIT_TEST( |
|
1467 "CommandL - test ", |
|
1468 "CGlxMediaList", |
|
1469 "CommandL", |
|
1470 "FUNCTIONALITY", |
|
1471 SetupL, UT_CGlxMediaList_CommandLL, Teardown) |
|
1472 /* |
|
1473 EUNIT_TEST( |
|
1474 "CancelCommand - test ", |
|
1475 "CGlxMediaList", |
|
1476 "CancelCommand", |
|
1477 "FUNCTIONALITY", |
|
1478 SetupL, UT_CGlxMediaList_CancelCommandL, Teardown) |
|
1479 */ |
|
1480 EUNIT_TEST( |
|
1481 "SetFilterL - test ", |
|
1482 "CGlxMediaList", |
|
1483 "SetFilterL", |
|
1484 "FUNCTIONALITY", |
|
1485 SetupL, UT_CGlxMediaList_SetFilterLL, Teardown) |
|
1486 |
|
1487 EUNIT_TEST( |
|
1488 "Filter - test ", |
|
1489 "CGlxMediaList", |
|
1490 "Filter", |
|
1491 "FUNCTIONALITY", |
|
1492 SetupL, UT_CGlxMediaList_FilterL, Teardown) |
|
1493 |
|
1494 /** |
|
1495 EUNIT_TEST( |
|
1496 "HandleCollectionMessageL - test ", |
|
1497 "CGlxMediaList", |
|
1498 "HandleCollectionMessageL", |
|
1499 "FUNCTIONALITY", |
|
1500 SetupL, UT_CGlxMediaList_HandleCollectionMessageLL, Teardown) |
|
1501 / |
|
1502 EUNIT_TEST( |
|
1503 "HandleOpenL - test ", |
|
1504 "CGlxMediaList", |
|
1505 "HandleOpenL", |
|
1506 "FUNCTIONALITY", |
|
1507 SetupL, UT_CGlxMediaList_HandleOpenLL, Teardown) |
|
1508 |
|
1509 EUNIT_TEST( |
|
1510 "HandleOpenL - test ", |
|
1511 "CGlxMediaList", |
|
1512 "HandleOpenL", |
|
1513 "FUNCTIONALITY", |
|
1514 SetupL, UT_CGlxMediaList_HandleOpenL_1L, Teardown) |
|
1515 |
|
1516 EUNIT_TEST( |
|
1517 "HandleCollectionMediaL - test ", |
|
1518 "CGlxMediaList", |
|
1519 "HandleCollectionMediaL", |
|
1520 "FUNCTIONALITY", |
|
1521 SetupL, UT_CGlxMediaList_HandleCollectionMediaLL, Teardown) |
|
1522 |
|
1523 EUNIT_TEST( |
|
1524 "HandleCollectionMessageL - test ", |
|
1525 "CGlxMediaList", |
|
1526 "HandleCollectionMessageL", |
|
1527 "FUNCTIONALITY", |
|
1528 SetupL, UT_CGlxMediaList_HandleCollectionMessageL_1L, Teardown) |
|
1529 */ |
|
1530 EUNIT_END_TEST_TABLE |
|
1531 |
|
1532 // END OF FILE |