43 _LIT( KmpxplaybackutilitytestLogFile, "mpxplaybackutilitytest.txt" ); |
40 _LIT( KmpxplaybackutilitytestLogFile, "mpxplaybackutilitytest.txt" ); |
44 _LIT( KmpxplaybackutilitytestLogFileWithTitle, "mpxplaybackutilitytest_[%S].txt" ); |
41 _LIT( KmpxplaybackutilitytestLogFileWithTitle, "mpxplaybackutilitytest_[%S].txt" ); |
45 // data file |
42 // data file |
46 _LIT( KmpxplaybackutilityTestFilePath, "C:\\testing\\data\\" ); |
43 _LIT( KmpxplaybackutilityTestFilePath, "C:\\testing\\data\\" ); |
47 #else |
44 #else |
48 _LIT( KmpxplaybackutilitytestLogPath, "\\logs\\testframework\\mpxplaybackutilitytest\\" ); |
45 _LIT( KmpxplaybackutilitytestLogPath, "f:\\logs\\testframework\\mpxplaybackutilitytest\\" ); |
49 // Log file |
46 // Log file |
50 _LIT( KmpxplaybackutilitytestLogFile, "mpxplaybackutilitytest.txt" ); |
47 _LIT( KmpxplaybackutilitytestLogFile, "mpxplaybackutilitytest.txt" ); |
51 _LIT( KmpxplaybackutilitytestLogFileWithTitle, "mpxplaybackutilitytest_[%S].txt" ); |
48 _LIT( KmpxplaybackutilitytestLogFileWithTitle, "mpxplaybackutilitytest_[%S].txt" ); |
52 // data file |
49 // data file |
53 _LIT( KmpxplaybackutilityTestFilePath, "e:\\testing\\data\\" ); |
50 _LIT( KmpxplaybackutilityTestFilePath, "f:\\testing\\data\\" ); |
54 #endif |
51 #endif |
|
52 |
55 // FUNCTION PROTOTYPES |
53 // FUNCTION PROTOTYPES |
56 //?type ?function_name(?arg_list); |
54 //?type ?function_name(?arg_list); |
57 |
55 |
58 // FORWARD DECLARATIONS |
56 // FORWARD DECLARATIONS |
59 //class ?FORWARD_CLASSNAME; |
57 //class ?FORWARD_CLASSNAME; |
60 class Cmpxplaybackutilitytest; |
58 |
61 |
|
62 class MMPXPlaybackUtility; |
|
63 class MMPXPlaybackObserver; |
|
64 // DATA TYPES |
59 // DATA TYPES |
65 //enum ?declaration |
60 typedef struct |
66 //typedef ?declaration |
61 { |
67 //extern ?data_type; |
62 TInt iEvent; |
|
63 TInt iType; |
|
64 TInt iData; |
|
65 } TMpxPlaybackTestEvent; |
|
66 |
|
67 typedef CArrayPtrFlat<TMpxPlaybackTestEvent> CMpxPlaybackTestEventArray; |
68 |
68 |
69 // CLASS DECLARATION |
69 // CLASS DECLARATION |
70 |
70 |
71 /** |
71 /** |
72 * Cmpxplaybackutilitytest test class for STIF Test Framework TestScripter. |
72 * Cmpxplaybackutilitytest test class for STIF Test Framework TestScripter. |
74 * |
74 * |
75 * @lib ?library |
75 * @lib ?library |
76 * @since ?Series60_version |
76 * @since ?Series60_version |
77 */ |
77 */ |
78 NONSHARABLE_CLASS(Cmpxplaybackutilitytest) : public CScriptBase, |
78 NONSHARABLE_CLASS(Cmpxplaybackutilitytest) : public CScriptBase, |
79 public MMPXPlaybackObserver |
79 public MMPXPlaybackObserver, |
|
80 public MMPXPlaybackCallback |
80 |
81 |
81 { |
82 { |
82 public: // Constructors and destructor |
83 public: // Constructors and destructor |
83 |
84 |
84 /** |
85 /** |
85 * Two-phased constructor. |
86 * Two-phased constructor. |
86 */ |
87 */ |
87 static Cmpxplaybackutilitytest* NewL( CTestModuleIf& aTestModuleIf ); |
88 static Cmpxplaybackutilitytest* NewL( CTestModuleIf& aTestModuleIf ); |
88 |
89 |
89 /** |
90 /** |
90 * Destructor. |
91 * Destructor. |
91 */ |
92 */ |
92 virtual ~Cmpxplaybackutilitytest(); |
93 virtual ~Cmpxplaybackutilitytest(); |
93 |
94 |
94 |
95 public: // Functions from base classes |
95 public: // Functions from base classes |
96 |
96 |
97 /** |
97 /** |
98 * From CScriptBase Runs a script line. |
98 * From CScriptBase Runs a script line. |
99 * @since ?Series60_version |
99 * @since ?Series60_version |
100 * @param aItem Script line containing method name and parameters |
100 * @param aItem Script line containing method name and parameters |
101 * @return Symbian OS error code |
101 * @return Symbian OS error code |
102 */ |
102 */ |
103 virtual TInt RunMethodL( CStifItemParser& aItem ); |
103 virtual TInt RunMethodL( CStifItemParser& aItem ); |
104 |
104 |
105 // From base class MMPXPlaybackObserver |
105 // From base class MMPXPlaybackObserver |
106 /** |
106 /** |
107 * Handle playback message |
107 * Handle playback message |
108 * |
108 * |
109 * @since 3.1 |
109 * @since 3.1 |
110 * @param aMessage playback message |
110 * @param aMessage playback message |
111 * @param aErr system error code. |
111 * @param aErr system error code. |
112 */ |
112 */ |
113 void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError ); |
113 void HandlePlaybackMessage( |
114 |
114 CMPXMessage* aMessage, TInt aError ); |
115 /** |
115 private: |
116 * Handle playback property. |
116 |
117 * |
117 /** |
118 * @since S60 3.2.3 |
118 * C++ default constructor. |
119 * @param aProperty the property |
119 */ |
120 * @param aValue the value of the property |
120 Cmpxplaybackutilitytest( CTestModuleIf& aTestModuleIf ); |
121 * @param aError error code |
121 /** |
122 */ |
122 * By default Symbian 2nd phase constructor is private. |
123 void HandlePropertyL(TMPXPlaybackProperty aProperty, TInt aValue, TInt aError); |
123 */ |
124 |
124 void ConstructL(); |
125 /** |
125 // Prohibit copy constructor if not deriving from CBase. |
126 * Method is called continously until aComplete=ETrue, signifying that |
126 // ?classname( const ?classname& ); |
127 * it is done and there will be no more callbacks. |
127 // Prohibit assigment operator if not deriving from CBase. |
128 * Only new items are passed each time. |
128 // ?classname& operator=( const ?classname& ); |
129 * |
129 /** |
130 * @since S60 3.2.3 |
130 * Frees all resources allocated from test methods. |
131 * @param aPlayer UID of the subplayer |
131 * @since ?Series60_version |
132 * @param aSubPlayers a list of sub players |
132 */ |
133 * @param aComplete ETrue no more sub players. EFalse more subplayer |
133 void Delete(); |
134 * expected |
134 /** |
135 * @param aError error code |
135 * Test methods are listed below. |
136 */ |
136 */ |
137 void HandleSubPlayerNamesL(TUid aPlayer, |
137 TInt MMPXPlaybackUtilityNewL(CStifItemParser& /*aItem*/); |
138 const MDesCArray* aSubPlayers, |
138 TInt MMPXPlaybackUtilityUtilityL(CStifItemParser& /*aItem*/); |
139 TBool aComplete, |
139 TInt MMPXPlaybackUtilityInit64L(CStifItemParser& /*aItem*/); |
140 TInt aError); |
140 TInt MMPXPlaybackUtilityInitStreaming64L(CStifItemParser& /*aItem*/); |
141 |
141 TInt MMPXPlaybackUtilityFile64L(CStifItemParser& /*aItem*/); |
142 /** |
142 |
143 * Call back of media request. |
143 /** |
144 * |
144 * Method used to log version of test class |
145 * @since S60 3.2.3 |
145 */ |
146 * @param aMedia media |
146 void SendTestClassVersion(); |
147 * @param aError error code |
147 //ADD NEW METHOD DEC HERE |
148 */ |
148 //[TestMethods] - Do not remove |
149 void HandleMediaL(const CMPXMedia& aProperties, TInt aError); |
149 private: // Friend classes |
150 |
150 //From mpxplaybackutility.h |
151 /** |
151 MMPXPlaybackUtility* iMPXPlaybackUtility; |
152 * Handle completion of a asynchronous command. |
152 RFs iFs; |
153 * Note: All clients should implement this callback. |
|
154 * |
|
155 * @since S60 3.2.3 |
|
156 * @param aCommandResult result of the command, NULL if error |
|
157 * @param aError error code |
|
158 */ |
|
159 void HandlePlaybackCommandComplete(CMPXCommand* aCommandResult, TInt aError); |
|
160 |
|
161 private: // functions |
|
162 |
|
163 /** |
|
164 * C++ default constructor. |
|
165 */ |
|
166 Cmpxplaybackutilitytest( CTestModuleIf& aTestModuleIf ); |
|
167 /** |
|
168 * By default Symbian 2nd phase constructor is private. |
|
169 */ |
|
170 void ConstructL(); |
|
171 // Prohibit copy constructor if not deriving from CBase. |
|
172 // ?classname( const ?classname& ); |
|
173 // Prohibit assigment operator if not deriving from CBase. |
|
174 // ?classname& operator=( const ?classname& ); |
|
175 /** |
|
176 * Frees all resources allocated from test methods. |
|
177 * @since ?Series60_version |
|
178 */ |
|
179 void Delete(); |
|
180 |
|
181 /* |
|
182 * Create resources |
|
183 */ |
|
184 void CreateL(); |
|
185 |
|
186 void AddExpectedEventL(TInt aEvent, TInt aType, TInt aData); |
|
187 void RemoveExpectedEventL(TInt aEvent, TInt aType, TInt aData); |
|
188 |
|
189 /** |
|
190 * Test methods are listed below. |
|
191 */ |
|
192 TInt MMPXPlaybackUtilityNewL(CStifItemParser& /*aItem*/); |
|
193 TInt MMPXPlaybackUtilityNewWithCatL(CStifItemParser& /*aItem*/); |
|
194 TInt MMPXPlaybackUtilityUtilityL(CStifItemParser& /*aItem*/); |
|
195 TInt MMPXPlaybackUtilityUtilityWithCatL(CStifItemParser& /*aItem*/); |
|
196 TInt MMPXPlaybackUtilityInitWithPlaylistL(CStifItemParser& /*aItem*/); |
|
197 TInt MMPXPlaybackUtilityInitWithUriL(CStifItemParser& /*aItem*/); |
|
198 TInt MMPXPlaybackUtilityInitWithRFileL(CStifItemParser& /*aItem*/); |
|
199 TInt MMPXPlaybackUtilityInitStreamingWithUriL(CStifItemParser& /*aItem*/); |
|
200 TInt MMPXPlaybackUtilityInitStreamingWithRFileL(CStifItemParser& /*aItem*/); |
|
201 TInt MMPXPlaybackUtilityInit64L(CStifItemParser& /*aItem*/); |
|
202 TInt MMPXPlaybackUtilityInitStreaming64L(CStifItemParser& /*aItem*/); |
|
203 TInt MMPXPlaybackUtilityFile64L(CStifItemParser& /*aItem*/); |
|
204 TInt MMPXPlaybackUtilityAddObserverL(CStifItemParser& /*aItem*/); |
|
205 TInt MMPXPlaybackUtilityRemoveObserverL(CStifItemParser& /*aItem*/); |
|
206 TInt MMPXPlaybackUtilityPlayerManagerSelectPlayerL(CStifItemParser& /*aItem*/); |
|
207 TInt EndTest(CStifItemParser& /*aItem*/); |
|
208 |
|
209 /** |
|
210 * Method used to log version of test class |
|
211 */ |
|
212 void SendTestClassVersion(); |
|
213 //ADD NEW METHOD DEC HERE |
|
214 //[TestMethods] - Do not remove |
|
215 |
|
216 private: // data |
|
217 MMPXPlaybackUtility* iMPXPlaybackUtility; |
|
218 CMpxPlaybackTestEventArray* iExpectedEventArray; |
|
219 RFs iFs; |
|
220 TInt iCallbackError; |
|
221 RFile iFile; |
153 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
222 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
154 RFile64 iFile64; |
223 RFile64 iFile64; |
155 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
224 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
156 }; |
225 }; |
157 |
226 |
158 #endif // MPXPLAYBACKUTILITYTEST_H |
227 #endif // MPXPLAYBACKUTILITYTEST_H |
159 |
228 |