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: Unit tests for CMusSoundPlayer class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef UT_CMUSSOUNDPLAYER_H |
|
21 #define UT_CMUSSOUNDPLAYER_H |
|
22 |
|
23 |
|
24 #include "mussoundplayer.h" |
|
25 #include "mussoundplayerobserver.h" |
|
26 #include <digia/eunit/ceunittestsuiteclass.h> |
|
27 #include <e32def.h> |
|
28 |
|
29 |
|
30 #ifndef NONSHARABLE_CLASS |
|
31 #define NONSHARABLE_CLASS(x) class x |
|
32 #endif |
|
33 |
|
34 |
|
35 class CMusSoundPlayer; |
|
36 |
|
37 |
|
38 /** |
|
39 * Unit test class for CMusSoundPlayer class. |
|
40 * Implements unit tests for CMusSoundPlayer class. |
|
41 */ |
|
42 NONSHARABLE_CLASS( UT_CMusSoundPlayer ) |
|
43 : public CEUnitTestSuiteClass, MMusSoundPlayerObserver |
|
44 { |
|
45 public: |
|
46 |
|
47 static UT_CMusSoundPlayer* NewL(); |
|
48 static UT_CMusSoundPlayer* NewLC(); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~UT_CMusSoundPlayer(); |
|
54 |
|
55 // from base class MMusSoundPlayerObserver |
|
56 |
|
57 /** |
|
58 * From MMusSoundPlayerObserver. |
|
59 * Notifies of sound playing complete. |
|
60 * |
|
61 * @param aError Errorcode associated with playback. |
|
62 */ |
|
63 virtual void PlaySoundComplete( TInt aError ); |
|
64 |
|
65 private: |
|
66 |
|
67 UT_CMusSoundPlayer(); |
|
68 |
|
69 void ConstructL(); |
|
70 |
|
71 /** |
|
72 * Sets up a new test. |
|
73 */ |
|
74 void SetupL(); |
|
75 |
|
76 /** |
|
77 * Tears down a test. |
|
78 */ |
|
79 void Teardown(); |
|
80 |
|
81 /** |
|
82 * Actual unit test methods. |
|
83 */ |
|
84 void UT_CMusSoundPlayer_NewLL(); |
|
85 void UT_CMusSoundPlayer_NewLCL(); |
|
86 void UT_CMusSoundPlayer_PlayLL(); |
|
87 void UT_CMusSoundPlayer_StopL(); |
|
88 void UT_CMusSoundPlayer_MapcInitCompleteL(); |
|
89 void UT_CMusSoundPlayer_MapcPlayCompleteL(); |
|
90 void UT_CMusSoundPlayer_SoundFileNameLCL(); |
|
91 |
|
92 /* |
|
93 * Integration test methods |
|
94 */ |
|
95 void IT_CMusSoundPlayer_DeletePlayerWhenPlaying(); |
|
96 |
|
97 |
|
98 private: // data |
|
99 |
|
100 /** |
|
101 * Tested class. |
|
102 * Own. |
|
103 */ |
|
104 CMusSoundPlayer* iSoundPlayer; |
|
105 |
|
106 TInt iPlaySoundCompleteError; |
|
107 |
|
108 EUNIT_DECLARE_TEST_TABLE; |
|
109 |
|
110 }; |
|
111 |
|
112 #endif // UT_CMUSSOUNDPLAYER_H |
|