|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This file contains the definition of the classes for each of the MediaSvrBC Unit test steps |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __MEDIASVRTEST_H__ |
|
19 #define __MEDIASVRTEST_H__ |
|
20 |
|
21 |
|
22 #include <mdaimageconverter.h> |
|
23 #include "TestImageParameter.h" |
|
24 |
|
25 /** |
|
26 * |
|
27 * Class with an invalid format to test framework |
|
28 * |
|
29 * @lib "TS_MediaSvr.lib" |
|
30 * |
|
31 * @xxxx |
|
32 * |
|
33 */ |
|
34 class TMdaInvalidClipFormat : public TMdaClipFormat |
|
35 { |
|
36 public: |
|
37 TMdaInvalidClipFormat(); |
|
38 }; |
|
39 |
|
40 /** |
|
41 * |
|
42 * MM-ICL-MEDIASVR-U-001. Test loading bitmap images from various formats |
|
43 * |
|
44 * @lib "TS_MediaSvr.lib" |
|
45 * |
|
46 * @xxxx |
|
47 * |
|
48 */ |
|
49 class CMediaSvrTest : public CTestStepMediaSvr |
|
50 { |
|
51 public: |
|
52 static CMediaSvrTest* NewL(); |
|
53 virtual TVerdict DoTestStepPreambleL(); |
|
54 virtual TVerdict DoTestStepPostambleL(); |
|
55 virtual TVerdict DoTestStepL(); |
|
56 private: |
|
57 CMediaSvrTest(); |
|
58 private: |
|
59 CArrayFixFlat<TTestImage>* iTestImages; |
|
60 }; |
|
61 |
|
62 /** |
|
63 * |
|
64 * MM-ICL-MEDIASVR-U-002. Test loading a bitmap image, without specifying a file format |
|
65 * |
|
66 * @lib "TS_MediaSvr.lib" |
|
67 * |
|
68 * @xxxx |
|
69 * |
|
70 */ |
|
71 class CMediaSvrTest2 : public CTestStepMediaSvr |
|
72 { |
|
73 public: |
|
74 static CMediaSvrTest2* NewL(); |
|
75 virtual TVerdict DoTestStepPreambleL(); |
|
76 virtual TVerdict DoTestStepPostambleL(); |
|
77 virtual TVerdict DoTestStepL(); |
|
78 private: |
|
79 CMediaSvrTest2(); |
|
80 private: |
|
81 CArrayFixFlat<TTestImage>* iTestImages; |
|
82 }; |
|
83 |
|
84 /** |
|
85 * |
|
86 * MM-ICL-MEDIASVR-U-003. Store image in descriptor, and retrieve it from the descriptor |
|
87 * |
|
88 * @lib "TS_MediaSvr.lib" |
|
89 * |
|
90 * @xxxx |
|
91 * |
|
92 */ |
|
93 class CMediaSvrTest3 : public CTestStepMediaSvr |
|
94 { |
|
95 public: |
|
96 static CMediaSvrTest3* NewL(); |
|
97 virtual TVerdict DoTestStepPreambleL(); |
|
98 virtual TVerdict DoTestStepPostambleL(); |
|
99 virtual TVerdict DoTestStepL(); |
|
100 protected: |
|
101 CMediaSvrTest3(); |
|
102 |
|
103 virtual TInt DescriptorSize() { return 0; } // 0 -> calculate properly |
|
104 virtual TInt ExpectedResult() { return KErrNone; } |
|
105 private: |
|
106 CArrayFixFlat<TTestImage>* iTestImages; |
|
107 }; |
|
108 |
|
109 /** |
|
110 * |
|
111 * MM-ICL-MEDIASVR-U-004. Test saving an image to all supported encodings |
|
112 * |
|
113 * @lib "TS_MediaSvr.lib" |
|
114 * |
|
115 * @xxxx |
|
116 * |
|
117 */ |
|
118 class CMediaSvrTest4 : public CTestStepMediaSvr |
|
119 { |
|
120 public: |
|
121 static CMediaSvrTest4* NewL(); |
|
122 virtual TVerdict DoTestStepPreambleL(); |
|
123 virtual TVerdict DoTestStepPostambleL(); |
|
124 virtual TVerdict DoTestStepL(); |
|
125 private: |
|
126 CMediaSvrTest4(); |
|
127 private: |
|
128 TTestImage iInitialImage; |
|
129 CArrayFixFlat<TTestImage>* iTestImages; |
|
130 }; |
|
131 |
|
132 /** |
|
133 * |
|
134 * MM-ICL-MEDIASVR-U-005. Test streaming an image from a descriptor |
|
135 * |
|
136 * @lib "TS_MediaSvr.lib" |
|
137 * |
|
138 * @xxxx |
|
139 * |
|
140 */ |
|
141 class CMediaSvrTest5 : public CTestStepMediaSvr |
|
142 { |
|
143 public: |
|
144 static CMediaSvrTest5* NewL(); |
|
145 virtual TVerdict DoTestStepPreambleL(); |
|
146 virtual TVerdict DoTestStepPostambleL(); |
|
147 virtual TVerdict DoTestStepL(); |
|
148 private: |
|
149 CMediaSvrTest5(); |
|
150 private: |
|
151 CArrayFixFlat<TTestImage>* iTestImages; |
|
152 TInt iTestInt; |
|
153 }; |
|
154 |
|
155 /** |
|
156 * |
|
157 * MM-ICL-MEDIASVR-U-006. Test streaming an image from a file |
|
158 * |
|
159 * @lib "TS_MediaSvr.lib" |
|
160 * |
|
161 * @xxxx |
|
162 * |
|
163 */ |
|
164 class CMediaSvrTest6 : public CTestStepMediaSvr |
|
165 { |
|
166 public: |
|
167 static CMediaSvrTest6* NewL(); |
|
168 virtual TVerdict DoTestStepPreambleL(); |
|
169 virtual TVerdict DoTestStepPostambleL(); |
|
170 virtual TVerdict DoTestStepL(); |
|
171 private: |
|
172 CMediaSvrTest6(); |
|
173 private: |
|
174 CArrayFixFlat<TTestImage>* iTestImages; |
|
175 TInt iTestInt; |
|
176 }; |
|
177 |
|
178 /** |
|
179 * |
|
180 * MM-ICL-MEDIASVR-U-007. Test loading a bitmap image, specifying an different format from that of |
|
181 * the image. |
|
182 * |
|
183 * @lib "TS_MediaSvr.lib" |
|
184 * |
|
185 * @xxxx |
|
186 * |
|
187 */ |
|
188 class CMediaSvrTest7 : public CTestStepMediaSvr |
|
189 { |
|
190 public: |
|
191 static CMediaSvrTest7* NewL(); |
|
192 virtual TVerdict DoTestStepPreambleL(); |
|
193 virtual TVerdict DoTestStepPostambleL(); |
|
194 virtual TVerdict DoTestStepL(); |
|
195 private: |
|
196 CMediaSvrTest7(); |
|
197 private: |
|
198 CArrayFixFlat<TTestImage>* iTestImages; |
|
199 }; |
|
200 |
|
201 /** |
|
202 * |
|
203 * MM-ICL-MEDIASVR-U-008. Test saving an image to an invalid file |
|
204 * |
|
205 * @lib "TS_MediaSvr.lib" |
|
206 * |
|
207 * @xxxx |
|
208 * |
|
209 */ |
|
210 class CMediaSvrTest8 : public CTestStepMediaSvr |
|
211 { |
|
212 public: |
|
213 static CMediaSvrTest8* NewL(); |
|
214 virtual TVerdict DoTestStepPreambleL(); |
|
215 virtual TVerdict DoTestStepPostambleL(); |
|
216 virtual TVerdict DoTestStepL(); |
|
217 private: |
|
218 CMediaSvrTest8(); |
|
219 private: |
|
220 TTestImage iInitialImage; |
|
221 CArrayFixFlat<TTestImage>* iTestImages; |
|
222 }; |
|
223 |
|
224 /** |
|
225 * |
|
226 * MM-ICL-MEDIASVR-U-009. Test loading a file specifying an invalid format |
|
227 * |
|
228 * @lib "TS_MediaSvr.lib" |
|
229 * |
|
230 * @xxxx |
|
231 * |
|
232 */ |
|
233 class CMediaSvrTest9 : public CTestStepMediaSvr |
|
234 { |
|
235 public: |
|
236 static CMediaSvrTest9* NewL(); |
|
237 virtual TVerdict DoTestStepPreambleL(); |
|
238 virtual TVerdict DoTestStepPostambleL(); |
|
239 virtual TVerdict DoTestStepL(); |
|
240 private: |
|
241 CMediaSvrTest9(); |
|
242 private: |
|
243 CArrayFixFlat<TTestImage>* iTestImages; |
|
244 TMdaInvalidClipFormat iInvalidFormat; |
|
245 }; |
|
246 |
|
247 /** |
|
248 * |
|
249 * MM-ICL-MEDIASVR-U-010. Test loading a file which is not an image file |
|
250 * |
|
251 * @lib "TS_MediaSvr.lib" |
|
252 * |
|
253 * @xxxx |
|
254 * |
|
255 */ |
|
256 class CMediaSvrTest10 : public CTestStepMediaSvr |
|
257 { |
|
258 public: |
|
259 static CMediaSvrTest10* NewL(); |
|
260 virtual TVerdict DoTestStepPreambleL(); |
|
261 virtual TVerdict DoTestStepPostambleL(); |
|
262 virtual TVerdict DoTestStepL(); |
|
263 private: |
|
264 CMediaSvrTest10(); |
|
265 private: |
|
266 CArrayFixFlat<TTestImage>* iTestImages; |
|
267 }; |
|
268 |
|
269 class CMdaStressTest; |
|
270 |
|
271 /** |
|
272 * |
|
273 * MM-ICL-MEDIASVR-U-011. Multiple thread stress testing |
|
274 * |
|
275 * @lib "TS_MediaSvr.lib" |
|
276 * |
|
277 * @xxxx |
|
278 * |
|
279 */ |
|
280 class CMediaSvrTest11 : public CTestStepMediaSvr |
|
281 { |
|
282 public: |
|
283 static CMediaSvrTest11* NewL(); |
|
284 virtual TVerdict DoTestStepPreambleL(); |
|
285 virtual TVerdict DoTestStepPostambleL(); |
|
286 virtual TVerdict DoTestStepL(); |
|
287 private: |
|
288 CMediaSvrTest11(); |
|
289 private: |
|
290 CMdaStressTest* iStressTest; |
|
291 }; |
|
292 |
|
293 /** |
|
294 * |
|
295 * |
|
296 * MM-ICL-MEDIASVR-U-012. Load image testing failure of each individual memory allocation |
|
297 * |
|
298 * @lib "TS_MediaSvr.lib" |
|
299 * |
|
300 * @xxxx |
|
301 * |
|
302 */ |
|
303 class CMediaSvrTest12 : public CTestStepMediaSvr |
|
304 { |
|
305 public: |
|
306 static CMediaSvrTest12* NewL(); |
|
307 virtual TVerdict DoTestStepPreambleL(); |
|
308 virtual TVerdict DoTestStepPostambleL(); |
|
309 virtual TVerdict DoTestStepL(); |
|
310 virtual TVerdict DoTestStepFbsL(); |
|
311 private: |
|
312 CMediaSvrTest12(); |
|
313 private: |
|
314 CArrayFixFlat<TTestImage>* iTestImages; |
|
315 }; |
|
316 |
|
317 /** |
|
318 * |
|
319 * MM-ICL-MEDIASVR-U-013. Save image testing failure of each individual memory allocation |
|
320 * |
|
321 * @lib "TS_MediaSvr.lib" |
|
322 * |
|
323 * @xxxx |
|
324 * |
|
325 */ |
|
326 class CMediaSvrTest13 : public CTestStepMediaSvr |
|
327 { |
|
328 public: |
|
329 static CMediaSvrTest13* NewL(); |
|
330 virtual TVerdict DoTestStepPreambleL(); |
|
331 virtual TVerdict DoTestStepPostambleL(); |
|
332 virtual TVerdict DoTestStepL(); |
|
333 private: |
|
334 CMediaSvrTest13(); |
|
335 private: |
|
336 CArrayFixFlat<TTestImage>* iTestImages; |
|
337 }; |
|
338 |
|
339 /** |
|
340 * |
|
341 * MM-ICL-MEDIASVR-U-014. Stream image testing failure of each individual memory allocation |
|
342 * |
|
343 * @lib "TS_MediaSvr.lib" |
|
344 * |
|
345 * @xxxx |
|
346 * |
|
347 */ |
|
348 class CMediaSvrTest14 : public CTestStepMediaSvr |
|
349 { |
|
350 public: |
|
351 static CMediaSvrTest14* NewL(); |
|
352 virtual TVerdict DoTestStepPreambleL(); |
|
353 virtual TVerdict DoTestStepPostambleL(); |
|
354 virtual TVerdict DoTestStepL(); |
|
355 private: |
|
356 CMediaSvrTest14(); |
|
357 private: |
|
358 CArrayFixFlat<TTestImage>* iTestImages; |
|
359 }; |
|
360 |
|
361 /** |
|
362 * |
|
363 * MM-ICL-MEDIASVR-U-015. Load image, cancelling and restarting decoding |
|
364 * |
|
365 * @lib "TS_MediaSvr.lib" |
|
366 * |
|
367 * @xxxx |
|
368 * |
|
369 */ |
|
370 class CMediaSvrTest15 : public CTestStepMediaSvr |
|
371 { |
|
372 public: |
|
373 static CMediaSvrTest15* NewL(); |
|
374 virtual TVerdict DoTestStepPreambleL(); |
|
375 virtual TVerdict DoTestStepPostambleL(); |
|
376 virtual TVerdict DoTestStepL(); |
|
377 private: |
|
378 CMediaSvrTest15(); |
|
379 private: |
|
380 CArrayFixFlat<TTestImage>* iTestImages; |
|
381 }; |
|
382 |
|
383 /** |
|
384 * |
|
385 * MM-ICL-MEDIASVR-U-016. Save image, cancelling and restarting decoding |
|
386 * |
|
387 * @lib "TS_MediaSvr.lib" |
|
388 * |
|
389 * @xxxx |
|
390 * |
|
391 */ |
|
392 class CMediaSvrTest16 : public CTestStepMediaSvr |
|
393 { |
|
394 public: |
|
395 static CMediaSvrTest16* NewL(); |
|
396 virtual TVerdict DoTestStepPreambleL(); |
|
397 virtual TVerdict DoTestStepPostambleL(); |
|
398 virtual TVerdict DoTestStepL(); |
|
399 private: |
|
400 CMediaSvrTest16(); |
|
401 private: |
|
402 TTestImage iInitialImage; |
|
403 TTestImage iOutputImage; |
|
404 }; |
|
405 |
|
406 /** |
|
407 * |
|
408 * MM-ICL-MEDIASVR-U-017. Check FrameInfo explicitly |
|
409 * |
|
410 * @lib "TS_MediaSvr.lib" |
|
411 * |
|
412 * @xxxx |
|
413 * |
|
414 */ |
|
415 class CMediaSvrTest17 : public CTestStepMediaSvr |
|
416 { |
|
417 public: |
|
418 static CMediaSvrTest17* NewL(); |
|
419 virtual TVerdict DoTestStepPreambleL(); |
|
420 virtual TVerdict DoTestStepPostambleL(); |
|
421 virtual TVerdict DoTestStepL(); |
|
422 private: |
|
423 CMediaSvrTest17(); |
|
424 private: |
|
425 TTestImage iTestImage; |
|
426 TFrameInfo iExpectedFrameInfo; |
|
427 }; |
|
428 |
|
429 /** |
|
430 * |
|
431 * MM-ICL-MEDIASVR-U-018. Check convert with mask |
|
432 * |
|
433 * @lib "TS_MediaSvr.lib" |
|
434 * |
|
435 * @xxxx |
|
436 * |
|
437 */ |
|
438 class CMediaSvrTest18 : public CTestStepMediaSvr |
|
439 { |
|
440 public: |
|
441 static CMediaSvrTest18* NewL(); |
|
442 virtual TVerdict DoTestStepPreambleL(); |
|
443 virtual TVerdict DoTestStepPostambleL(); |
|
444 virtual TVerdict DoTestStepL(); |
|
445 private: |
|
446 CMediaSvrTest18(); |
|
447 private: |
|
448 TTestImage iTestImage; |
|
449 }; |
|
450 |
|
451 /** |
|
452 * |
|
453 * MM-ICL-MEDIASVR-U-019. Check ConvertL fails correctly when the bitmaps passed to it |
|
454 * are the incorrect format |
|
455 * |
|
456 * @lib "TS_MediaSvr.lib" |
|
457 * |
|
458 * @xxxx |
|
459 * |
|
460 */ |
|
461 class CMediaSvrTest19 : public CTestStepMediaSvr |
|
462 { |
|
463 public: |
|
464 static CMediaSvrTest19* NewL(); |
|
465 virtual TVerdict DoTestStepPreambleL(); |
|
466 virtual TVerdict DoTestStepPostambleL(); |
|
467 virtual TVerdict DoTestStepL(); |
|
468 private: |
|
469 CMediaSvrTest19(); |
|
470 private: |
|
471 TTestImage iTestImage; |
|
472 }; |
|
473 |
|
474 /** |
|
475 * |
|
476 * MM-ICL-MEDIASVR-U-020. |
|
477 * Test re-using CMdaImageDescToBitmapUtility after a previous ConvertL() |
|
478 * returned KErrUnderflow (Defect INC011980). |
|
479 * |
|
480 * @lib "TS_MediaSvr.lib" |
|
481 * |
|
482 * @xxxx |
|
483 * |
|
484 */ |
|
485 class CMediaSvrTest20 : public CTestStepMediaSvr |
|
486 { |
|
487 public: |
|
488 static CMediaSvrTest20* NewL(); |
|
489 virtual TVerdict DoTestStepPreambleL(); |
|
490 virtual TVerdict DoTestStepPostambleL(); |
|
491 virtual TVerdict DoTestStepL(); |
|
492 private: |
|
493 CMediaSvrTest20(); |
|
494 private: |
|
495 CArrayFixFlat<TTestImage>* iTestImages; |
|
496 }; |
|
497 |
|
498 /** |
|
499 * |
|
500 * MM-ICL-MEDIASVR-U-021. |
|
501 * Test CMdaImageDecoder::FrameCommentL() |
|
502 * |
|
503 * @lib "TS_MediaSvr.lib" |
|
504 * |
|
505 * @xxxx |
|
506 * |
|
507 */ |
|
508 class CMediaSvrTest21 : public CTestStepMediaSvr |
|
509 { |
|
510 public: |
|
511 static CMediaSvrTest21* NewL(); |
|
512 virtual TVerdict DoTestStepPreambleL(); |
|
513 virtual TVerdict DoTestStepL(); |
|
514 private: |
|
515 CMediaSvrTest21(); |
|
516 private: |
|
517 TFileName iSourceFile; |
|
518 }; |
|
519 |
|
520 /* |
|
521 * MM-ICL-MEDIASVR-U-22 |
|
522 * Variation on test step 3 that uses a small descriptor and expects KErrArgument result |
|
523 * |
|
524 */ |
|
525 |
|
526 class CMediaSvrTest22 : public CMediaSvrTest3 |
|
527 { |
|
528 public: |
|
529 static CMediaSvrTest22* NewL(); |
|
530 private: |
|
531 CMediaSvrTest22(); |
|
532 protected: |
|
533 // from CMediaSvrTest3 |
|
534 virtual TInt DescriptorSize() { return 10; } // use very small descriptor - bound to overflow |
|
535 virtual TInt ExpectedResult() { return KErrArgument; } |
|
536 }; |
|
537 |
|
538 #endif //__MEDIASVRTEST_H__ |