branch | RCL_3 |
changeset 56 | 839377eedc2b |
parent 0 | 96612d01cf9f |
child 57 | befca0ec475f |
54:315810614048 | 56:839377eedc2b |
---|---|
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: ?Description* |
14 * Description: |
15 */ |
15 */ |
16 |
|
17 |
16 |
18 // INCLUDE FILES |
17 // INCLUDE FILES |
19 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroyPushL |
18 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroyPushL |
20 #include <e32svr.h> |
19 #include <e32svr.h> |
21 #include <StifParser.h> |
20 #include <StifParser.h> |
22 #include <Stiftestinterface.h> |
21 #include <Stiftestinterface.h> |
23 #include <centralrepository.h> |
22 #include <centralrepository.h> |
24 #include <collate.h> |
23 #include <collate.h> |
25 |
24 |
26 #include "VCXTestLog.h" |
25 #include "VCXTestLog.h" |
27 #include "VCXTestCommon.h" |
26 #include "VCXMyVideosTestUtils.h" |
28 #include "CIptvTestActiveWait.h" |
27 #include "CVcxTestActiveWait.h" |
29 #include "CIptvTestTimer.h" |
28 #include "CVcxTestTimer.h" |
30 #include "VCXTestStatsKeeper.h" |
|
31 |
29 |
32 #include "VCXMyVideosCollectionPluginTest.h" |
30 #include "VCXMyVideosCollectionPluginTest.h" |
33 #include "VCXMyVideosCollectionPluginTester.h" |
31 #include "VCXMyVideosCollectionPluginTester.h" |
32 #include "VCXMyVideosTestUtils.h" |
|
33 #include "VCXTestMdsDbModifier.h" |
|
34 #include "VCXMyVideosTestCommon.h" |
34 #include "VCXMyVideosTestCommon.h" |
35 #include "VCXMyVideosTestDlWatcher.h" |
|
36 #include "VCXMyVideosTestServiceEmu.h" |
|
37 #include "VCXTestMdsDbModifier.h" |
|
38 |
35 |
39 #include <mpxmedia.h> |
36 #include <mpxmedia.h> |
40 #include <mpxmediageneraldefs.h> |
37 #include <mpxmediageneraldefs.h> |
41 #include <mpxmediageneralextdefs.h> |
38 #include <mpxmediageneralextdefs.h> |
42 |
39 |
40 #include "vcxmyvideosdefs.h" |
|
43 #include "vcxmyvideosuids.h" |
41 #include "vcxmyvideosuids.h" |
44 |
42 |
45 // CONSTANTS |
43 // CONSTANTS |
46 |
44 |
47 const TInt KVcxTestFileSize3GB = -999; |
45 const TInt KVcxTestFileSize3GB = -999; |
48 |
46 |
47 _LIT(KAbout2050CharsString, "asdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjaiasdfiajsdfasdfiasdjfijasdifjisdfjisdjfiasdjfidjai"); |
|
48 _LIT(KVcxTestEmptyString, ""); |
|
49 |
|
50 _LIT(KStifScriptInvalidRequest, "InvalidRequest"); |
|
51 _LIT(KStifScriptEmptyString, "EmptyString"); |
|
52 _LIT(KStifScript2KString, "2KString"); |
|
53 |
|
49 // MACROS |
54 // MACROS |
50 #define VCXMVTEST_ERR(err) ( iStatsEnabled ) ? KErrNone : err |
|
51 |
55 |
52 // MODULE DATA STRUCTURES |
56 // MODULE DATA STRUCTURES |
53 |
57 |
54 // ============================ MEMBER FUNCTIONS =============================== |
58 // ============================ MEMBER FUNCTIONS =============================== |
55 |
59 |
104 } |
108 } |
105 } |
109 } |
106 |
110 |
107 iSideloadFolders.ResetAndDestroy(); |
111 iSideloadFolders.ResetAndDestroy(); |
108 |
112 |
109 delete iTestCommon; |
113 delete iTestUtils; |
110 iTestCommon = NULL; |
114 iTestUtils = NULL; |
111 |
115 |
112 #ifdef __WINSCW__ |
116 #ifdef __WINSCW__ |
113 iClient.Close(); |
117 iClient.Close(); |
114 #endif // __WINSCW__ |
118 #endif // __WINSCW__ |
115 |
119 |
142 } |
146 } |
143 |
147 |
144 delete iMpxMedia; |
148 delete iMpxMedia; |
145 iMpxMedia = NULL; |
149 iMpxMedia = NULL; |
146 |
150 |
147 delete iServiceEmu; |
|
148 iServiceEmu = NULL; |
|
149 |
|
150 delete iMdsDbModifier; |
151 delete iMdsDbModifier; |
151 iMdsDbModifier = NULL; |
152 iMdsDbModifier = NULL; |
152 |
153 |
153 delete iFileMan; |
154 delete iFileMan; |
154 iFileMan = NULL; |
155 iFileMan = NULL; |
155 |
156 |
156 iFs.Close(); |
157 iFs.Close(); |
157 |
|
158 delete iStats; |
|
159 iStats = NULL; |
|
160 |
158 |
161 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::Delete <----------"); |
159 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::Delete <----------"); |
162 } |
160 } |
163 |
161 |
164 // ----------------------------------------------------------------------------- |
162 // ----------------------------------------------------------------------------- |
175 // Copy this line for every implemented function. |
173 // Copy this line for every implemented function. |
176 // First string is the function name used in TestScripter script file. |
174 // First string is the function name used in TestScripter script file. |
177 // Second is the actual implementation member function. |
175 // Second is the actual implementation member function. |
178 ENTRY( "Create", CVCXMyVideosCollectionPluginTest::CreateL ), |
176 ENTRY( "Create", CVCXMyVideosCollectionPluginTest::CreateL ), |
179 |
177 |
180 ENTRY( "EnableStats", CVCXMyVideosCollectionPluginTest::EnableStatsL ), |
|
181 ENTRY( "SetPreferredMemory", CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL ), |
|
182 ENTRY( "SetSortingOrder", CVCXMyVideosCollectionPluginTest::SetSortingOrderL ), |
178 ENTRY( "SetSortingOrder", CVCXMyVideosCollectionPluginTest::SetSortingOrderL ), |
183 ENTRY( "SetAutomaticRefresh", CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh ), |
179 ENTRY( "SetAutomaticRefresh", CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh ), |
184 ENTRY( "SetQuietMode", CVCXMyVideosCollectionPluginTest::SetQuietMode ), |
180 ENTRY( "SetQuietMode", CVCXMyVideosCollectionPluginTest::SetQuietMode ), |
185 ENTRY( "CoolDown", CVCXMyVideosCollectionPluginTest::CoolDownL ), |
181 ENTRY( "CoolDown", CVCXMyVideosCollectionPluginTest::CoolDownL ), |
186 ENTRY( "DisableDownloadCheck", CVCXMyVideosCollectionPluginTest::DisableDownloadCheckL ), |
|
187 ENTRY( "SetFileCheck", CVCXMyVideosCollectionPluginTest::SetFileCheckL ), |
182 ENTRY( "SetFileCheck", CVCXMyVideosCollectionPluginTest::SetFileCheckL ), |
188 ENTRY( "SetAutoResume", CVCXMyVideosCollectionPluginTest::SetAutoResumeL ), |
183 ENTRY( "SetUseCopiedMedias", CVCXMyVideosCollectionPluginTest::SetUseCopiedMediasL ), |
189 |
184 |
190 ENTRY( "OpenCollection", CVCXMyVideosCollectionPluginTest::OpenCollectionL ), |
185 ENTRY( "OpenCollection", CVCXMyVideosCollectionPluginTest::OpenCollectionL ), |
191 ENTRY( "OpenLevel", CVCXMyVideosCollectionPluginTest::OpenLevelL ), |
186 ENTRY( "OpenLevel", CVCXMyVideosCollectionPluginTest::OpenLevelL ), |
187 ENTRY( "OpenLevelByIndex", CVCXMyVideosCollectionPluginTest::OpenLevelByIndexL ), |
|
192 ENTRY( "RefreshContents", CVCXMyVideosCollectionPluginTest::RefreshContentsL ), |
188 ENTRY( "RefreshContents", CVCXMyVideosCollectionPluginTest::RefreshContentsL ), |
193 ENTRY( "GetMediasByMpxId", CVCXMyVideosCollectionPluginTest::GetMediasByMpxIdL ), |
189 ENTRY( "GetMediasByMpxId", CVCXMyVideosCollectionPluginTest::GetMediasByMpxIdL ), |
194 ENTRY( "CloseLevel", CVCXMyVideosCollectionPluginTest::CloseLevelL ), |
190 ENTRY( "CloseLevel", CVCXMyVideosCollectionPluginTest::CloseLevelL ), |
195 |
191 |
196 ENTRY( "GetMediaFullDetails", CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL ), |
192 ENTRY( "GetMediaFullDetails", CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL ), |
197 ENTRY( "GetMediaFullDetailsByMpxId", CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL ), |
193 ENTRY( "GetMediaFullDetailsByMpxId", CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL ), |
198 ENTRY( "GetAllMediaFullDetails", CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL ), |
194 ENTRY( "GetAllMediaFullDetails", CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL ), |
199 ENTRY( "SetMediaDetail", CVCXMyVideosCollectionPluginTest::SetMediaDetailL ), |
195 ENTRY( "SetMediaDetail", CVCXMyVideosCollectionPluginTest::SetMediaDetailL ), |
200 ENTRY( "CheckMediaDetail", CVCXMyVideosCollectionPluginTest::CheckMediaDetailL ), |
196 ENTRY( "CheckMediaDetail", CVCXMyVideosCollectionPluginTest::CheckMediaDetailL ), |
197 ENTRY( "CheckAlbumCount", CVCXMyVideosCollectionPluginTest::CheckAlbumCountL ), |
|
201 ENTRY( "CheckMediaCount", CVCXMyVideosCollectionPluginTest::CheckMediaCountL ), |
198 ENTRY( "CheckMediaCount", CVCXMyVideosCollectionPluginTest::CheckMediaCountL ), |
202 ENTRY( "CheckMinimumMediaCount", CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL ), |
199 ENTRY( "CheckMinimumMediaCount", CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL ), |
203 ENTRY( "CheckMaximumMediaCount", CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL ), |
200 ENTRY( "CheckMaximumMediaCount", CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL ), |
204 ENTRY( "CheckDownloadCount", CVCXMyVideosCollectionPluginTest::CheckDownloadCountL ), |
|
205 |
201 |
206 ENTRY( "CreateCopyOfMedia", CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL ), |
202 ENTRY( "CreateCopyOfMedia", CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL ), |
207 ENTRY( "CreateEmptyMedia", CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL ), |
203 ENTRY( "CreateEmptyMedia", CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL ), |
208 ENTRY( "AddMedia", CVCXMyVideosCollectionPluginTest::AddMediaL ), |
204 ENTRY( "AddMedia", CVCXMyVideosCollectionPluginTest::AddMediaL ), |
209 ENTRY( "SetMedia", CVCXMyVideosCollectionPluginTest::SetMediaL ), |
205 ENTRY( "SetMedia", CVCXMyVideosCollectionPluginTest::SetMediaL ), |
210 ENTRY( "OutsideMediaUpdate", CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL ), |
206 ENTRY( "OutsideMediaUpdate", CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL ), |
211 ENTRY( "CancelNextOperation", CVCXMyVideosCollectionPluginTest::CancelNextOperationL ), |
207 ENTRY( "CancelNextOperation", CVCXMyVideosCollectionPluginTest::CancelNextOperationL ), |
212 |
208 |
213 ENTRY( "DeleteFileOfMedia", CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL ), |
209 ENTRY( "DeleteFileOfMedia", CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL ), |
214 ENTRY( "DeleteFilesOfAllMedias", CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL ), |
210 ENTRY( "DeleteFilesOfAllMedias", CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL ), |
211 ENTRY( "CreateAlbum", CVCXMyVideosCollectionPluginTest::CreateAlbumL ), |
|
215 ENTRY( "RemoveMedia", CVCXMyVideosCollectionPluginTest::RemoveMediaL ), |
212 ENTRY( "RemoveMedia", CVCXMyVideosCollectionPluginTest::RemoveMediaL ), |
216 ENTRY( "RemoveAllMedia", CVCXMyVideosCollectionPluginTest::RemoveAllMediaL ), |
213 ENTRY( "RemoveAllMedia", CVCXMyVideosCollectionPluginTest::RemoveAllMediaL ), |
217 ENTRY( "MoveMedia", CVCXMyVideosCollectionPluginTest::MoveMediaL ), |
214 ENTRY( "MoveMedia", CVCXMyVideosCollectionPluginTest::MoveMediaL ), |
218 ENTRY( "MoveMedias", CVCXMyVideosCollectionPluginTest::MoveMediasL ), |
215 ENTRY( "MoveMedias", CVCXMyVideosCollectionPluginTest::MoveMediasL ), |
219 ENTRY( "CancelMove", CVCXMyVideosCollectionPluginTest::CancelMoveL ), |
216 ENTRY( "CancelMove", CVCXMyVideosCollectionPluginTest::CancelMoveL ), |
222 ENTRY( "CancelCopy", CVCXMyVideosCollectionPluginTest::CancelCopyL ), |
219 ENTRY( "CancelCopy", CVCXMyVideosCollectionPluginTest::CancelCopyL ), |
223 ENTRY( "DeleteMedia", CVCXMyVideosCollectionPluginTest::DeleteMediaL ), |
220 ENTRY( "DeleteMedia", CVCXMyVideosCollectionPluginTest::DeleteMediaL ), |
224 ENTRY( "DeleteMedias", CVCXMyVideosCollectionPluginTest::DeleteMediasL ), |
221 ENTRY( "DeleteMedias", CVCXMyVideosCollectionPluginTest::DeleteMediasL ), |
225 ENTRY( "CancelDelete", CVCXMyVideosCollectionPluginTest::CancelDeleteL ), |
222 ENTRY( "CancelDelete", CVCXMyVideosCollectionPluginTest::CancelDeleteL ), |
226 |
223 |
224 ENTRY( "CreateAlbum", CVCXMyVideosCollectionPluginTest::CreateAlbumL ), |
|
225 ENTRY( "DeleteAlbums", CVCXMyVideosCollectionPluginTest::DeleteAlbumsL ), |
|
226 ENTRY( "DeleteAllAlbums", CVCXMyVideosCollectionPluginTest::DeleteAllAlbumsL ), |
|
227 ENTRY( "AddMediasToAlbum", CVCXMyVideosCollectionPluginTest::AddMediasToAlbumL ), |
|
228 ENTRY( "RemoveMediasFromAlbum", CVCXMyVideosCollectionPluginTest::RemoveMediasFromAlbumL ), |
|
229 ENTRY( "RenameAlbum", CVCXMyVideosCollectionPluginTest::RenameAlbumL ), |
|
230 ENTRY( "CheckAlbumExists", CVCXMyVideosCollectionPluginTest::CheckAlbumExistsL ), |
|
231 |
|
227 ENTRY( "CreateVideoFile", CVCXMyVideosCollectionPluginTest::CreateVideoFileL ), |
232 ENTRY( "CreateVideoFile", CVCXMyVideosCollectionPluginTest::CreateVideoFileL ), |
228 ENTRY( "CreateVideoFileNoWait", CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ), |
233 ENTRY( "CreateVideoFileNoWait", CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ), |
229 ENTRY( "EnsureDriveForVideos", CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL ), |
234 ENTRY( "EnsureDriveForVideos", CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL ), |
230 ENTRY( "EmptySideloadFolders", CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL ), |
235 ENTRY( "EmptySideloadFolders", CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL ), |
231 ENTRY( "SetDeleteSideloadedVideos", CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos ), |
236 ENTRY( "SetDeleteSideloadedVideos", CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos ), |
232 |
237 |
233 ENTRY( "Download", CVCXMyVideosCollectionPluginTest::DownloadL ), |
|
234 ENTRY( "ResumeDownload", CVCXMyVideosCollectionPluginTest::ResumeDownloadL ), |
|
235 ENTRY( "ResumeAllDownloads", CVCXMyVideosCollectionPluginTest::ResumeAllDownloadsL ), |
|
236 ENTRY( "DownloadUsingMedia", CVCXMyVideosCollectionPluginTest::DownloadUsingMediaL ), |
|
237 ENTRY( "ResumeDownloadUsingMedia", CVCXMyVideosCollectionPluginTest::ResumeDownloadUsingMediaL ), |
|
238 ENTRY( "DownloadUrl", CVCXMyVideosCollectionPluginTest::DownloadUrlL ), |
|
239 ENTRY( "CancelDownload", CVCXMyVideosCollectionPluginTest::CancelDownloadL ), |
|
240 ENTRY( "CancelDownloadById", CVCXMyVideosCollectionPluginTest::CancelDownloadByIdL ), |
|
241 ENTRY( "PauseDownload", CVCXMyVideosCollectionPluginTest::PauseDownloadL ), |
|
242 ENTRY( "PauseDownloadByUrl", CVCXMyVideosCollectionPluginTest::PauseDownloadByUrlL ), |
|
243 ENTRY( "CheckDownloadProgress", CVCXMyVideosCollectionPluginTest::CheckDownloadProgressL ), |
|
244 |
|
245 ENTRY( "WaitAllDownloads", CVCXMyVideosCollectionPluginTest::WaitAllDownloadsL ), |
|
246 ENTRY( "WaitForMessage", CVCXMyVideosCollectionPluginTest::WaitForMessageL ), |
238 ENTRY( "WaitForMessage", CVCXMyVideosCollectionPluginTest::WaitForMessageL ), |
247 ENTRY( "WaitForAnyMessage", CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL ), |
239 ENTRY( "WaitForAnyMessage", CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL ), |
248 ENTRY( "WaitForMessages", CVCXMyVideosCollectionPluginTest::WaitForMessagesL ), |
240 ENTRY( "WaitForMessages", CVCXMyVideosCollectionPluginTest::WaitForMessagesL ), |
249 |
241 |
250 }; |
242 }; |
255 return RunInternalL( KFunctions, count, aItem ); |
247 return RunInternalL( KFunctions, count, aItem ); |
256 |
248 |
257 } |
249 } |
258 |
250 |
259 // ----------------------------------------------------------------------------- |
251 // ----------------------------------------------------------------------------- |
260 // CVCXMyVideosCollectionPluginTest::EnableStatsL |
|
261 // ----------------------------------------------------------------------------- |
|
262 // |
|
263 TInt CVCXMyVideosCollectionPluginTest::EnableStatsL( CStifItemParser& aItem ) |
|
264 { |
|
265 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::EnableStatsL ---------->"); |
|
266 // Print to UI |
|
267 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
268 _LIT( KWhere, "In EnableStatsL" ); |
|
269 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
270 // Print to log file |
|
271 iLog->Log( KWhere ); |
|
272 |
|
273 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
274 |
|
275 TPtrC statsName; |
|
276 TPtrC fileName; |
|
277 User::LeaveIfError( aItem.GetNextString( statsName) ); |
|
278 User::LeaveIfError( aItem.GetNextString( fileName) ); |
|
279 |
|
280 TRAP_IGNORE( iStats->StartStatsKeepingL( statsName, fileName ) ); |
|
281 iStatsEnabled = ETrue; |
|
282 |
|
283 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EnableStatsL <----------"); |
|
284 return KErrNone; |
|
285 } |
|
286 |
|
287 // ----------------------------------------------------------------------------- |
|
288 // CVCXMyVideosCollectionPluginTest::CreateL |
252 // CVCXMyVideosCollectionPluginTest::CreateL |
289 // ----------------------------------------------------------------------------- |
253 // ----------------------------------------------------------------------------- |
290 // |
254 // |
291 TInt CVCXMyVideosCollectionPluginTest::CreateL( CStifItemParser& aItem ) |
255 TInt CVCXMyVideosCollectionPluginTest::CreateL( CStifItemParser& aItem ) |
292 { |
256 { |
301 User::LeaveIfError( iFs.Connect() ); |
265 User::LeaveIfError( iFs.Connect() ); |
302 iFileMan = CFileMan::NewL( iFs ); |
266 iFileMan = CFileMan::NewL( iFs ); |
303 |
267 |
304 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
268 aItem.SetParsingType(CStifItemParser::EQuoteStyleParsing); |
305 |
269 |
306 iTestCommon = CVCXTestCommon::NewL(); |
270 iTestUtils = CVCXMyVideosTestUtils::NewL(); |
307 iStats = CVCXTestStatsKeeper::NewL(); |
271 iTester = CVCXMyVideosCollectionPluginTester::NewL( this, iTestUtils ); |
308 iTester = CVCXMyVideosCollectionPluginTester::NewL( this, iTestCommon, iStats ); |
272 iActiveWait = CVcxTestActiveWait::NewL(); |
309 iActiveWait = CIptvTestActiveWait::NewL(); |
273 iActiveWaitBlocking = CVcxTestActiveWait::NewL(); |
310 iActiveWaitBlocking = CIptvTestActiveWait::NewL(); |
274 iTimeoutTimer = CVcxTestTimer::NewL(*this, 0); |
311 iTimeoutTimer = CIptvTestTimer::NewL(*this, 0); |
275 iCoolDownTimer = CVcxTestTimer::NewL(*this, 1); |
312 iCoolDownTimer = CIptvTestTimer::NewL(*this, 1); |
|
313 |
276 |
314 #ifdef __WINSCW__ |
277 #ifdef __WINSCW__ |
315 TInt err = iClient.Connect(); |
278 TInt err = iClient.Connect(); |
316 if( KErrNone != err ) |
279 if( KErrNone != err ) |
317 { |
280 { |
318 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Could not start MDS server session! Err: %d", err); |
281 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Could not start MDS server session! Err: %d", err); |
319 } |
282 } |
320 #endif // __WINSCW__ |
283 #endif // __WINSCW__ |
321 |
284 |
322 iAutoResume = ETrue; |
|
323 |
|
324 iTester->SetAutoResume( iAutoResume ); |
|
325 |
|
326 iServiceEmu = CVCXMyVideosTestServiceEmu::NewL(); |
|
327 |
|
328 iMdsDbModifier = CVCXTestMdsDbModifier::NewL(); |
285 iMdsDbModifier = CVCXTestMdsDbModifier::NewL(); |
329 |
286 |
330 iCurrentSortOrder = EVcxMyVideosSortingNone; |
287 iCurrentSortOrder = EVcxMyVideosSortingNone; |
331 |
288 |
332 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateL <----------"); |
289 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateL <----------"); |
333 return KErrNone; |
|
334 } |
|
335 |
|
336 // ----------------------------------------------------------------------------- |
|
337 // CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL |
|
338 // ----------------------------------------------------------------------------- |
|
339 // |
|
340 TInt CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL( CStifItemParser& aItem ) |
|
341 { |
|
342 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL ---------->"); |
|
343 // Print to UI |
|
344 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
345 _LIT( KWhere, "In SetPreferredMemoryL" ); |
|
346 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
347 // Print to log file |
|
348 iLog->Log( KWhere ); |
|
349 |
|
350 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
351 |
|
352 TInt drive(0); |
|
353 User::LeaveIfError( GetDriveParam( aItem, drive ) ); |
|
354 |
|
355 // These were defined in CVcxMyVideosDownloadUtil::PreferredMemoryDesL() |
|
356 const TInt KVcxCenRepUid = 0x102750E2; // same as KIptvCenRepUid in CIptvUtil.h |
|
357 const TInt KVcxCenRepPreferredMemoryKey = 0x01; // same as KIptvCenRepPreferredMemoryKey in CIptvUtil.h |
|
358 |
|
359 TUid uid; |
|
360 uid.iUid = KVcxCenRepUid; |
|
361 |
|
362 CRepository* cenRep = CRepository::NewLC( uid ); |
|
363 User::LeaveIfError( cenRep->Set( KVcxCenRepPreferredMemoryKey, drive ) ); |
|
364 CleanupStack::PopAndDestroy( cenRep ); |
|
365 |
|
366 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetPreferredMemoryL <----------"); |
|
367 return KErrNone; |
290 return KErrNone; |
368 } |
291 } |
369 |
292 |
370 // ----------------------------------------------------------------------------- |
293 // ----------------------------------------------------------------------------- |
371 // CVCXMyVideosCollectionPluginTest::SetSortingOrderL |
294 // CVCXMyVideosCollectionPluginTest::SetSortingOrderL |
395 TRAP( err, DoTotalRefreshL() ); |
318 TRAP( err, DoTotalRefreshL() ); |
396 |
319 |
397 iCurrentSortOrder = value; |
320 iCurrentSortOrder = value; |
398 |
321 |
399 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetSortingOrderL <----------"); |
322 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetSortingOrderL <----------"); |
400 return VCXMVTEST_ERR( err ); |
323 return err; |
401 } |
324 } |
402 |
325 |
403 // ----------------------------------------------------------------------------- |
326 // ----------------------------------------------------------------------------- |
404 // CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh |
327 // CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh |
405 // ----------------------------------------------------------------------------- |
328 // ----------------------------------------------------------------------------- |
421 { |
344 { |
422 iTester->SetAutomaticRefresh( static_cast<TBool>(value) ); |
345 iTester->SetAutomaticRefresh( static_cast<TBool>(value) ); |
423 } |
346 } |
424 |
347 |
425 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh <----------"); |
348 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetAutomaticRefresh <----------"); |
426 return VCXMVTEST_ERR( err ); |
349 return err; |
427 } |
350 } |
428 |
351 |
429 // ----------------------------------------------------------------------------- |
352 // ----------------------------------------------------------------------------- |
430 // CVCXMyVideosCollectionPluginTest::SetQuietMode |
353 // CVCXMyVideosCollectionPluginTest::SetQuietMode |
431 // ----------------------------------------------------------------------------- |
354 // ----------------------------------------------------------------------------- |
447 { |
370 { |
448 iTester->SetQuietMode( static_cast<TBool>(value) ); |
371 iTester->SetQuietMode( static_cast<TBool>(value) ); |
449 } |
372 } |
450 |
373 |
451 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetQuietMode <----------"); |
374 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetQuietMode <----------"); |
452 return VCXMVTEST_ERR( err ); |
375 return err; |
453 } |
376 } |
454 |
377 |
455 // ----------------------------------------------------------------------------- |
378 // ----------------------------------------------------------------------------- |
456 // CIptvMyVideosApiTest::CoolDownL |
379 // CVcxMyVideosApiTest::CoolDownL |
457 // ----------------------------------------------------------------------------- |
380 // ----------------------------------------------------------------------------- |
458 // |
381 // |
459 TInt CVCXMyVideosCollectionPluginTest::CoolDownL( CStifItemParser& /* aItem */ ) |
382 TInt CVCXMyVideosCollectionPluginTest::CoolDownL( CStifItemParser& /* aItem */ ) |
460 { |
383 { |
461 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CoolDownL ---------->"); |
384 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CoolDownL ---------->"); |
480 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CoolDownL <----------"); |
403 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CoolDownL <----------"); |
481 return KErrNone; |
404 return KErrNone; |
482 } |
405 } |
483 |
406 |
484 // ----------------------------------------------------------------------------- |
407 // ----------------------------------------------------------------------------- |
485 // CIptvMyVideosApiTest::DisableDownloadCheckL |
408 // CVcxMyVideosApiTest::SetFileCheckL |
486 // ----------------------------------------------------------------------------- |
|
487 // |
|
488 TInt CVCXMyVideosCollectionPluginTest::DisableDownloadCheckL( CStifItemParser& /* aItem */ ) |
|
489 { |
|
490 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DisableDownloadCheckL"); |
|
491 if( iTester ) |
|
492 { |
|
493 iTester->GetDownloadWatcher()->DisableDownloadCheck(); |
|
494 } |
|
495 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DisableDownloadCheckL"); |
|
496 return KErrNone; |
|
497 } |
|
498 |
|
499 // ----------------------------------------------------------------------------- |
|
500 // CIptvMyVideosApiTest::SetFileCheckL |
|
501 // ----------------------------------------------------------------------------- |
409 // ----------------------------------------------------------------------------- |
502 // |
410 // |
503 TInt CVCXMyVideosCollectionPluginTest::SetFileCheckL( CStifItemParser& aItem ) |
411 TInt CVCXMyVideosCollectionPluginTest::SetFileCheckL( CStifItemParser& aItem ) |
504 { |
412 { |
505 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetFileCheckL"); |
413 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetFileCheckL"); |
511 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetFileCheckL"); |
419 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetFileCheckL"); |
512 return KErrNone; |
420 return KErrNone; |
513 } |
421 } |
514 |
422 |
515 // ----------------------------------------------------------------------------- |
423 // ----------------------------------------------------------------------------- |
516 // CIptvMyVideosApiTest::SetAutoResumeL |
424 // CVcxMyVideosApiTest::SetUseCopiedMediasL |
517 // ----------------------------------------------------------------------------- |
425 // ----------------------------------------------------------------------------- |
518 // |
426 // |
519 TInt CVCXMyVideosCollectionPluginTest::SetAutoResumeL( CStifItemParser& aItem ) |
427 TInt CVCXMyVideosCollectionPluginTest::SetUseCopiedMediasL( CStifItemParser& aItem ) |
520 { |
428 { |
521 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetAutoResumeL ---------->"); |
429 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetUseCopiedMediasL"); |
522 // Print to UI |
430 |
523 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
431 TInt value(0); |
524 _LIT( KWhere, "In SetAutoResumeL" ); |
432 User::LeaveIfError( aItem.GetNextInt( value ) ); |
525 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
433 TBool set = static_cast<TBool>(value); |
526 // Print to log file |
434 iTester->SetUseCopiedMediasL( set ); |
527 iLog->Log( KWhere ); |
435 |
528 |
436 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetUseCopiedMediasL"); |
529 TInt autoResume(0); |
|
530 User::LeaveIfError( aItem.GetNextInt( autoResume ) ); |
|
531 iAutoResume = autoResume; |
|
532 if( iTester ) |
|
533 { |
|
534 iTester->SetAutoResume( iAutoResume ); |
|
535 } |
|
536 |
|
537 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetAutoResumeL <----------"); |
|
538 return KErrNone; |
437 return KErrNone; |
539 } |
438 } |
540 |
439 |
541 // ----------------------------------------------------------------------------- |
440 // ----------------------------------------------------------------------------- |
542 // CVCXMyVideosCollectionPluginTest::OpenCollectionL |
441 // CVCXMyVideosCollectionPluginTest::OpenCollectionL |
577 |
476 |
578 if( err != KErrNone ) |
477 if( err != KErrNone ) |
579 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
478 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
580 |
479 |
581 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OpenCollectionL <----------"); |
480 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OpenCollectionL <----------"); |
582 return VCXMVTEST_ERR( err ); |
481 return err; |
583 } |
482 } |
584 |
483 |
585 // ----------------------------------------------------------------------------- |
484 // ----------------------------------------------------------------------------- |
586 // CVCXMyVideosCollectionPluginTest::OpenLevelL |
485 // CVCXMyVideosCollectionPluginTest::OpenLevelL |
587 // ----------------------------------------------------------------------------- |
486 // ----------------------------------------------------------------------------- |
588 // |
487 // |
589 TInt CVCXMyVideosCollectionPluginTest::OpenLevelL( CStifItemParser& aItem ) |
488 TInt CVCXMyVideosCollectionPluginTest::OpenLevelL( CStifItemParser& aItem ) |
590 { |
489 { |
591 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::OpenLevelL ---------->"); |
490 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::OpenLevelL ---------->"); |
491 // Print to UI |
|
492 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
493 _LIT( KWhere, "In OpenLevelL" ); |
|
494 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
495 // Print to log file |
|
496 iLog->Log( KWhere ); |
|
497 |
|
498 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
499 |
|
500 TPtrC name; |
|
501 User::LeaveIfError( aItem.GetNextString( name ) ); |
|
502 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: levelName: %S", &name); |
|
503 |
|
504 iLastReceivedMessage = -1; |
|
505 |
|
506 TInt err( KErrNotReady ); |
|
507 if( iTester ) |
|
508 { |
|
509 TRAP( err, iTester->OpenLevelL( name ) ); |
|
510 } |
|
511 |
|
512 if( err != KErrNone ) |
|
513 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
|
514 |
|
515 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OpenLevelL <----------"); |
|
516 return err; |
|
517 } |
|
518 |
|
519 // ----------------------------------------------------------------------------- |
|
520 // CVCXMyVideosCollectionPluginTest::OpenLevelByIndexL |
|
521 // ----------------------------------------------------------------------------- |
|
522 // |
|
523 TInt CVCXMyVideosCollectionPluginTest::OpenLevelByIndexL( CStifItemParser& aItem ) |
|
524 { |
|
525 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::OpenLevelByIndexL ---------->"); |
|
592 // Print to UI |
526 // Print to UI |
593 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
527 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
594 _LIT( KWhere, "In OpenLevelL" ); |
528 _LIT( KWhere, "In OpenLevelL" ); |
595 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
529 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
596 // Print to log file |
530 // Print to log file |
610 } |
544 } |
611 |
545 |
612 if( err != KErrNone ) |
546 if( err != KErrNone ) |
613 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
547 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
614 |
548 |
615 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OpenLevelL <----------"); |
549 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OpenLevelByIndexL <----------"); |
616 return VCXMVTEST_ERR( err ); |
550 return err; |
617 } |
551 } |
618 |
552 |
619 // ----------------------------------------------------------------------------- |
553 // ----------------------------------------------------------------------------- |
620 // CVCXMyVideosCollectionPluginTest::CloseLevelL |
554 // CVCXMyVideosCollectionPluginTest::CloseLevelL |
621 // ----------------------------------------------------------------------------- |
555 // ----------------------------------------------------------------------------- |
640 |
574 |
641 if( err != KErrNone ) |
575 if( err != KErrNone ) |
642 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
576 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
643 |
577 |
644 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CloseLevelL <----------"); |
578 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CloseLevelL <----------"); |
645 return VCXMVTEST_ERR( err ); |
579 return err; |
646 } |
580 } |
647 |
581 |
648 // ----------------------------------------------------------------------------- |
582 // ----------------------------------------------------------------------------- |
649 // CVCXMyVideosCollectionPluginTest::RefreshContentsL |
583 // CVCXMyVideosCollectionPluginTest::RefreshContentsL |
650 // ----------------------------------------------------------------------------- |
584 // ----------------------------------------------------------------------------- |
671 |
605 |
672 if( err != KErrNone ) |
606 if( err != KErrNone ) |
673 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
607 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
674 |
608 |
675 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RefreshContentsL <----------"); |
609 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RefreshContentsL <----------"); |
676 return VCXMVTEST_ERR( err ); |
610 return err; |
677 } |
611 } |
678 |
612 |
679 // ----------------------------------------------------------------------------- |
613 // ----------------------------------------------------------------------------- |
680 // CVCXMyVideosCollectionPluginTest::RefreshContentsL |
614 // CVCXMyVideosCollectionPluginTest::RefreshContentsL |
681 // ----------------------------------------------------------------------------- |
615 // ----------------------------------------------------------------------------- |
718 |
652 |
719 if( err != KErrNone ) |
653 if( err != KErrNone ) |
720 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
654 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
721 |
655 |
722 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediasByMpxIdL <----------"); |
656 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediasByMpxIdL <----------"); |
723 return VCXMVTEST_ERR( err ); |
657 return err; |
724 } |
658 } |
725 |
659 |
726 // ----------------------------------------------------------------------------- |
660 // ----------------------------------------------------------------------------- |
727 // CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL |
661 // CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL |
728 // ----------------------------------------------------------------------------- |
662 // ----------------------------------------------------------------------------- |
774 } |
708 } |
775 |
709 |
776 messages.Reset(); |
710 messages.Reset(); |
777 |
711 |
778 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL <----------"); |
712 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsL <----------"); |
779 return VCXMVTEST_ERR( err ); |
713 return err; |
780 } |
714 } |
781 |
715 |
782 // ----------------------------------------------------------------------------- |
716 // ----------------------------------------------------------------------------- |
783 // CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL |
717 // CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL |
784 // ----------------------------------------------------------------------------- |
718 // ----------------------------------------------------------------------------- |
841 } |
775 } |
842 |
776 |
843 messages.Reset(); |
777 messages.Reset(); |
844 |
778 |
845 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL <----------"); |
779 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediaFullDetailsByMpxIdL <----------"); |
846 return VCXMVTEST_ERR( err ); |
780 return err; |
847 } |
781 } |
848 |
782 |
849 // ----------------------------------------------------------------------------- |
783 // ----------------------------------------------------------------------------- |
850 // CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL |
784 // CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL |
851 // ----------------------------------------------------------------------------- |
785 // ----------------------------------------------------------------------------- |
874 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
808 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
875 |
809 |
876 iLastReceivedMessage = -1; |
810 iLastReceivedMessage = -1; |
877 |
811 |
878 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL <----------"); |
812 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetAllMediaFullDetailsL <----------"); |
879 return VCXMVTEST_ERR( err ); |
813 return err; |
880 } |
814 } |
881 |
815 |
882 // ----------------------------------------------------------------------------- |
816 // ----------------------------------------------------------------------------- |
883 // CVCXMyVideosCollectionPluginTest::CheckMediaDetailL |
817 // CVCXMyVideosCollectionPluginTest::CheckMediaDetailL |
884 // ----------------------------------------------------------------------------- |
818 // ----------------------------------------------------------------------------- |
901 |
835 |
902 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
836 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
903 |
837 |
904 TInt drive(0); |
838 TInt drive(0); |
905 User::LeaveIfError( GetDriveParam( aItem, drive ) ); |
839 User::LeaveIfError( GetDriveParam( aItem, drive ) ); |
906 |
840 |
907 TInt itemIndex(0); |
841 // Get the media object to be checked. |
908 User::LeaveIfError( aItem.GetNextInt( itemIndex ) ); |
842 |
909 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: item index: %d", itemIndex); |
843 TPtrC itemIndexOrName; |
910 |
844 User::LeaveIfError( aItem.GetNextString( itemIndexOrName ) ); |
911 if( itemIndex < 0 || itemIndex >= iTester->GetMediaCount() ) |
845 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: item index or name: %S", &itemIndexOrName); |
912 { |
846 |
913 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Error. Index (%d) out of bounds.", itemIndex); |
847 TLex lex( itemIndexOrName ); |
848 TInt itemIndex( -1 ); |
|
849 if( lex.Val( itemIndex ) == KErrNone ) |
|
850 { |
|
851 if( itemIndex < 0 || itemIndex >= iTester->GetMediaCount() ) |
|
852 { |
|
853 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Error. Index (%d) out of bounds.", itemIndex); |
|
854 User::Leave( KErrArgument ); |
|
855 } |
|
856 } |
|
857 else |
|
858 { |
|
859 itemIndex = iTester->GetIndexOfMediaWithNameL( itemIndexOrName ); |
|
860 } |
|
861 |
|
862 if( itemIndex == KErrNotFound ) |
|
863 { |
|
914 User::Leave( KErrArgument ); |
864 User::Leave( KErrArgument ); |
915 } |
865 } |
916 |
866 |
867 // Attribute to be checked |
|
868 |
|
917 TInt mpxAttributeMappingId(0); |
869 TInt mpxAttributeMappingId(0); |
918 User::LeaveIfError( aItem.GetNextInt( mpxAttributeMappingId ) ); |
870 User::LeaveIfError( aItem.GetNextInt( mpxAttributeMappingId ) ); |
919 |
871 |
872 // It's type. |
|
873 |
|
920 TVcxTestMediaAttributeType type; |
874 TVcxTestMediaAttributeType type; |
921 TMPXAttributeData mpxMediaAttribute; |
875 TMPXAttributeData mpxMediaAttribute; |
922 User::LeaveIfError( MapMpxMediaAttribute( |
876 User::LeaveIfError( MapMpxMediaAttribute( |
923 static_cast<TVcxTestMediaAttributeIdMapping>(mpxAttributeMappingId), |
877 static_cast<TVcxTestMediaAttributeIdMapping>(mpxAttributeMappingId), |
924 mpxMediaAttribute, type ) ); |
878 mpxMediaAttribute, type ) ); |
925 |
879 |
926 |
880 // Get the media to be checked. |
927 CMPXMedia* media( NULL ); |
881 |
882 CMPXMedia* media( NULL ); |
|
928 TRAP( err, media = iTester->GetMediaL( drive, itemIndex ) ); |
883 TRAP( err, media = iTester->GetMediaL( drive, itemIndex ) ); |
929 |
884 |
930 // If attribute is not supported, fetch full media details. |
885 // If attribute is not supported, fetch full media details. |
931 if( media && !media->IsSupported( mpxMediaAttribute ) ) |
886 if( media && !media->IsSupported( mpxMediaAttribute ) ) |
932 { |
887 { |
943 } |
898 } |
944 |
899 |
945 if( err != KErrNone ) |
900 if( err != KErrNone ) |
946 { |
901 { |
947 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <----------"); |
902 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <----------"); |
948 return VCXMVTEST_ERR( err ); |
903 return err; |
949 } |
904 } |
950 |
905 |
951 if( !media->IsSupported( mpxMediaAttribute ) ) |
906 if( !media->IsSupported( mpxMediaAttribute ) ) |
952 { |
907 { |
953 VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error: iAttributeId: %d, iContentId: %d is not supported.", |
908 VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: error: iAttributeId: %d, iContentId: %d is not supported.", |
954 mpxMediaAttribute.iAttributeId == 0, mpxMediaAttribute.iContentId); |
909 mpxMediaAttribute.iAttributeId == 0, mpxMediaAttribute.iContentId); |
955 |
910 |
956 iTester->PrintMPXMediaL( *media, ETrue ); |
911 iTester->PrintMPXMediaL( *media, ETrue ); |
957 |
912 |
958 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <---------"); |
913 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <---------"); |
959 return VCXMVTEST_ERR( KErrNotSupported ); |
914 return KErrNotSupported; |
960 } |
915 } |
961 |
916 |
962 if( type == EVcxTestMediaAttributeTypeString ) |
917 if( type == EVcxTestMediaAttributeTypeString ) |
963 { |
918 { |
964 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type text"); |
919 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Getting attribute of type text"); |
1244 { |
1199 { |
1245 TRAP_IGNORE( iTester->PrintMediasL( NULL, EFalse, _L("Videos") ) ); |
1200 TRAP_IGNORE( iTester->PrintMediasL( NULL, EFalse, _L("Videos") ) ); |
1246 } |
1201 } |
1247 |
1202 |
1248 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <----------"); |
1203 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaDetailL <----------"); |
1249 return VCXMVTEST_ERR( err ); |
1204 return err; |
1250 } |
1205 } |
1251 |
1206 |
1252 // ----------------------------------------------------------------------------- |
1207 // ----------------------------------------------------------------------------- |
1253 // CVCXMyVideosCollectionPluginTest::SetItemDetailsL |
1208 // CVCXMyVideosCollectionPluginTest::SetItemDetailsL |
1254 // ----------------------------------------------------------------------------- |
1209 // ----------------------------------------------------------------------------- |
1444 iMpxMedia->SetTObjectValueL<TUint32>( mpxMediaAttribute, value ); |
1399 iMpxMedia->SetTObjectValueL<TUint32>( mpxMediaAttribute, value ); |
1445 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value); |
1400 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Set to %d", value); |
1446 } |
1401 } |
1447 |
1402 |
1448 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetMediaDetailL <----------"); |
1403 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetMediaDetailL <----------"); |
1449 return VCXMVTEST_ERR( err ); |
1404 return err; |
1450 } |
1405 } |
1451 |
1406 |
1452 // ----------------------------------------------------------------------------- |
1407 // ----------------------------------------------------------------------------- |
1453 // CIptvMyVideosApiTest::CheckMediaCountL |
1408 // CVcxMyVideosApiTest::CheckAlbumCountL |
1409 // ----------------------------------------------------------------------------- |
|
1410 // |
|
1411 TInt CVCXMyVideosCollectionPluginTest::CheckAlbumCountL( CStifItemParser& aItem ) |
|
1412 { |
|
1413 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckAlbumCountL ---------->"); |
|
1414 // Print to UI |
|
1415 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
1416 _LIT( KWhere, "In CheckAlbumCountL" ); |
|
1417 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
1418 // Print to log file |
|
1419 iLog->Log( KWhere ); |
|
1420 |
|
1421 WaitForRefreshL( EFalse ); // Wait for possible refresh to finish. |
|
1422 |
|
1423 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
1424 |
|
1425 TInt expectedCount(0); |
|
1426 User::LeaveIfError(aItem.GetNextInt(expectedCount)); |
|
1427 |
|
1428 // File check |
|
1429 TInt videoCount = iTester->GetMediaCount(); |
|
1430 |
|
1431 // attribute check that they are in allowed values |
|
1432 |
|
1433 int err(KErrNone); |
|
1434 int actualCount(0); |
|
1435 |
|
1436 for( TInt i = videoCount-1; i >= 0; i-- ) |
|
1437 { |
|
1438 CMPXMedia* media = iTester->GetMediaL( -1, i ); |
|
1439 |
|
1440 // Skip categories with empty names, they are for photos. |
|
1441 if( !media->IsSupported( KMPXMediaGeneralTitle ) ) |
|
1442 { |
|
1443 continue; |
|
1444 } |
|
1445 |
|
1446 TMPXItemId itemId = *( media->Value<TMPXItemId>( KMPXMediaGeneralId ) ); |
|
1447 |
|
1448 if(itemId.iId2 == KVcxMvcMediaTypeAlbum) |
|
1449 { |
|
1450 actualCount++; |
|
1451 } |
|
1452 } |
|
1453 |
|
1454 if ( actualCount != expectedCount ) |
|
1455 { |
|
1456 VCXLOGLO2("CVCXMyVideosCollectionPluginTest: Error! Count of albums is wrong: %d", actualCount ); |
|
1457 err = KErrCorrupt; |
|
1458 } |
|
1459 |
|
1460 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckAlbumCountL <----------"); |
|
1461 return err; |
|
1462 } |
|
1463 |
|
1464 // ----------------------------------------------------------------------------- |
|
1465 // CVcxMyVideosApiTest::CheckMediaCountL |
|
1454 // ----------------------------------------------------------------------------- |
1466 // ----------------------------------------------------------------------------- |
1455 // |
1467 // |
1456 TInt CVCXMyVideosCollectionPluginTest::CheckMediaCountL( CStifItemParser& aItem ) |
1468 TInt CVCXMyVideosCollectionPluginTest::CheckMediaCountL( CStifItemParser& aItem ) |
1457 { |
1469 { |
1458 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMediaCountL ---------->"); |
1470 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMediaCountL ---------->"); |
1479 { |
1491 { |
1480 iTester->PrintMediasL( NULL, EFalse, _L("Videos") ); |
1492 iTester->PrintMediasL( NULL, EFalse, _L("Videos") ); |
1481 } |
1493 } |
1482 |
1494 |
1483 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaCountL <----------"); |
1495 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediaCountL <----------"); |
1484 return VCXMVTEST_ERR( err ); |
1496 return err; |
1485 } |
1497 } |
1486 |
1498 |
1487 // ----------------------------------------------------------------------------- |
1499 // ----------------------------------------------------------------------------- |
1488 // CIptvMyVideosApiTest::CheckMinimumMediaCountL |
1500 // CVcxMyVideosApiTest::CheckMinimumMediaCountL |
1489 // ----------------------------------------------------------------------------- |
1501 // ----------------------------------------------------------------------------- |
1490 // |
1502 // |
1491 TInt CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL( CStifItemParser& aItem ) |
1503 TInt CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL( CStifItemParser& aItem ) |
1492 { |
1504 { |
1493 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL ---------->"); |
1505 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL ---------->"); |
1511 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: drive: %d", drive); |
1523 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: drive: %d", drive); |
1512 |
1524 |
1513 TRAPD( err, CheckMediasL( expectedCount, drive, -1 ) ); |
1525 TRAPD( err, CheckMediasL( expectedCount, drive, -1 ) ); |
1514 |
1526 |
1515 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL <----------"); |
1527 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMinimumMediaCountL <----------"); |
1516 return VCXMVTEST_ERR( err ); |
1528 return err; |
1517 } |
1529 } |
1518 |
1530 |
1519 // ----------------------------------------------------------------------------- |
1531 // ----------------------------------------------------------------------------- |
1520 // CIptvMyVideosApiTest::CheckMaximumMediaCountL |
1532 // CVcxMyVideosApiTest::CheckMaximumMediaCountL |
1521 // ----------------------------------------------------------------------------- |
1533 // ----------------------------------------------------------------------------- |
1522 // |
1534 // |
1523 TInt CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL( CStifItemParser& aItem ) |
1535 TInt CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL( CStifItemParser& aItem ) |
1524 { |
1536 { |
1525 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL ---------->"); |
1537 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL ---------->"); |
1543 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: drive: %d", drive); |
1555 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: drive: %d", drive); |
1544 |
1556 |
1545 TRAPD( err, CheckMediasL( expectedCount, drive, 1 ) ); |
1557 TRAPD( err, CheckMediasL( expectedCount, drive, 1 ) ); |
1546 |
1558 |
1547 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL <----------"); |
1559 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMaximumMediaCountL <----------"); |
1548 return VCXMVTEST_ERR( err ); |
1560 return err; |
1549 } |
|
1550 |
|
1551 // ----------------------------------------------------------------------------- |
|
1552 // CIptvMyVideosApiTest::CheckDownloadCountL |
|
1553 // ----------------------------------------------------------------------------- |
|
1554 // |
|
1555 TInt CVCXMyVideosCollectionPluginTest::CheckDownloadCountL( CStifItemParser& aItem ) |
|
1556 { |
|
1557 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckDownloadCountL ---------->"); |
|
1558 // Print to UI |
|
1559 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
1560 _LIT( KWhere, "In CheckMediaCountL" ); |
|
1561 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
1562 // Print to log file |
|
1563 iLog->Log( KWhere ); |
|
1564 |
|
1565 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
1566 |
|
1567 WaitForRefreshL( EFalse ); // Wait for possible refresh to finish. |
|
1568 |
|
1569 TInt expectedCount(0); |
|
1570 User::LeaveIfError(aItem.GetNextInt(expectedCount)); |
|
1571 |
|
1572 TInt err( KErrNotReady ); |
|
1573 if( iTester ) |
|
1574 { |
|
1575 err = KErrNone; |
|
1576 if( iTester->GetDownloadWatcher()->GetDownloadCount() != expectedCount ) |
|
1577 { |
|
1578 err = KErrCorrupt; |
|
1579 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ERROR: Not expected count of downloads!"); |
|
1580 } |
|
1581 } |
|
1582 |
|
1583 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckDownloadCountL <----------"); |
|
1584 return VCXMVTEST_ERR( err ); |
|
1585 } |
1561 } |
1586 |
1562 |
1587 // ----------------------------------------------------------------------------- |
1563 // ----------------------------------------------------------------------------- |
1588 // CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL |
1564 // CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL |
1589 // ----------------------------------------------------------------------------- |
1565 // ----------------------------------------------------------------------------- |
1620 |
1596 |
1621 if( iTester->GetMediaCount() <= 0 ) |
1597 if( iTester->GetMediaCount() <= 0 ) |
1622 { |
1598 { |
1623 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ERROR: There's zero medias!"); |
1599 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ERROR: There's zero medias!"); |
1624 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL <----------"); |
1600 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL <----------"); |
1625 return VCXMVTEST_ERR( KErrArgument ); |
1601 return KErrArgument; |
1626 } |
1602 } |
1627 |
1603 |
1628 if( iMpxMedia ) |
1604 if( iMpxMedia ) |
1629 { |
1605 { |
1630 delete iMpxMedia; |
1606 delete iMpxMedia; |
1677 { |
1653 { |
1678 VCXLOGLO2("<<<CVCXMyVideosCollectionPluginTest:: err: %d", err); |
1654 VCXLOGLO2("<<<CVCXMyVideosCollectionPluginTest:: err: %d", err); |
1679 } |
1655 } |
1680 |
1656 |
1681 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL <----------"); |
1657 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateCopyOfMediaL <----------"); |
1682 return VCXMVTEST_ERR( err ); |
1658 return err; |
1683 } |
1659 } |
1684 |
1660 |
1685 // ----------------------------------------------------------------------------- |
1661 // ----------------------------------------------------------------------------- |
1686 // CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL |
1662 // CVCXMyVideosCollectionPluginTest::CreateEmptyMediaL |
1687 // ----------------------------------------------------------------------------- |
1663 // ----------------------------------------------------------------------------- |
1783 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Open plugin binary failed: %d", err2); |
1759 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Open plugin binary failed: %d", err2); |
1784 } |
1760 } |
1785 } |
1761 } |
1786 #endif // __WINSCW__ |
1762 #endif // __WINSCW__ |
1787 |
1763 |
1788 |
|
1789 if( err != KErrNone ) |
1764 if( err != KErrNone ) |
1790 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
1765 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
1791 |
1766 |
1792 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::AddMediaL <----------"); |
1767 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::AddMediaL <----------"); |
1793 return VCXMVTEST_ERR( err ); |
1768 return err; |
1794 } |
1769 } |
1795 |
1770 |
1796 // ----------------------------------------------------------------------------- |
1771 // ----------------------------------------------------------------------------- |
1797 // CVCXMyVideosCollectionPluginTest::SetMediaL |
1772 // CVCXMyVideosCollectionPluginTest::SetMediaL |
1798 // ----------------------------------------------------------------------------- |
1773 // ----------------------------------------------------------------------------- |
1830 |
1805 |
1831 if( err != KErrNone ) |
1806 if( err != KErrNone ) |
1832 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
1807 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
1833 |
1808 |
1834 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetMediaL <----------"); |
1809 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetMediaL <----------"); |
1835 return VCXMVTEST_ERR( err ); |
1810 return err; |
1836 } |
1811 } |
1837 |
1812 |
1838 // ----------------------------------------------------------------------------- |
1813 // ----------------------------------------------------------------------------- |
1839 // CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL |
1814 // CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL |
1840 // ----------------------------------------------------------------------------- |
1815 // ----------------------------------------------------------------------------- |
1863 |
1838 |
1864 if( err != KErrNone ) |
1839 if( err != KErrNone ) |
1865 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
1840 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
1866 |
1841 |
1867 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL <----------"); |
1842 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::OutsideMediaUpdateL <----------"); |
1868 return VCXMVTEST_ERR( err ); |
1843 return err; |
1869 } |
1844 } |
1870 |
1845 |
1871 // ----------------------------------------------------------------------------- |
1846 // ----------------------------------------------------------------------------- |
1872 // CIptvMyVideosApiTest::RemoveMediaL |
1847 // CVcxMyVideosApiTest::RemoveMediaL |
1873 // ----------------------------------------------------------------------------- |
1848 // ----------------------------------------------------------------------------- |
1874 // |
1849 // |
1875 TInt CVCXMyVideosCollectionPluginTest::RemoveMediaL( CStifItemParser& aItem ) |
1850 TInt CVCXMyVideosCollectionPluginTest::RemoveMediaL( CStifItemParser& aItem ) |
1876 { |
1851 { |
1877 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RemoveMediaL ---------->"); |
1852 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RemoveMediaL ---------->"); |
1905 { |
1880 { |
1906 TRAP( err, iTester->RemoveMediaL( drive, index, syncCall ) ); |
1881 TRAP( err, iTester->RemoveMediaL( drive, index, syncCall ) ); |
1907 } |
1882 } |
1908 |
1883 |
1909 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveMediaL <----------"); |
1884 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveMediaL <----------"); |
1910 return VCXMVTEST_ERR( err ); |
1885 return err; |
1911 } |
1886 } |
1912 |
1887 |
1913 // ----------------------------------------------------------------------------- |
1888 // ----------------------------------------------------------------------------- |
1914 // CIptvMyVideosApiTest::RemoveAllMediaL |
1889 // CVcxMyVideosApiTest::RemoveAllMediaL |
1915 // ----------------------------------------------------------------------------- |
1890 // ----------------------------------------------------------------------------- |
1916 // |
1891 // |
1917 TInt CVCXMyVideosCollectionPluginTest::RemoveAllMediaL( CStifItemParser& aItem ) |
1892 TInt CVCXMyVideosCollectionPluginTest::RemoveAllMediaL( CStifItemParser& aItem ) |
1918 { |
1893 { |
1919 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RemoveAllMediaL ---------->"); |
1894 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RemoveAllMediaL ---------->"); |
1929 iLastReceivedMessage = -1; |
1904 iLastReceivedMessage = -1; |
1930 |
1905 |
1931 TRAP_IGNORE( iTester->EnsureMediaFilesAreNotInUseL() ); |
1906 TRAP_IGNORE( iTester->EnsureMediaFilesAreNotInUseL() ); |
1932 |
1907 |
1933 TInt error( KErrNone ); |
1908 TInt error( KErrNone ); |
1934 |
|
1935 TInt mediaCount = iTester->GetMediaCount(); |
|
1936 |
|
1937 // Store info about the mpx items. |
|
1938 RArray<TUint> mpxIds; |
|
1939 CleanupClosePushL( mpxIds ); |
|
1940 |
|
1941 RArray<TUint> downloadIds; |
|
1942 CleanupClosePushL( downloadIds ); |
|
1943 |
|
1944 RArray<TInt> downloadStates; |
|
1945 CleanupClosePushL( downloadStates ); |
|
1946 |
|
1947 RPointerArray<HBufC> filePaths; |
|
1948 CleanupResetAndDestroyPushL( filePaths ); |
|
1949 |
|
1950 // Get ids and other needed details. |
|
1951 |
|
1952 for( TInt i=0; i<mediaCount; i++ ) |
|
1953 { |
|
1954 CMPXMedia* media( NULL ); |
|
1955 VCXLOGLO2("CVCXMyVideosCollectionPluginTest::RemoveAllMediaL: GetMedia %d", i); |
|
1956 TRAP( error, media = iTester->GetMediaL( -1, i ) ); |
|
1957 |
|
1958 if( error != KErrNone ) |
|
1959 { |
|
1960 CleanupStack::PopAndDestroy( &filePaths ); |
|
1961 CleanupStack::PopAndDestroy( &downloadStates ); |
|
1962 CleanupStack::PopAndDestroy( &downloadIds ); |
|
1963 CleanupStack::PopAndDestroy( &mpxIds ); |
|
1964 |
|
1965 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveAllMediaL <----------"); |
|
1966 return VCXMVTEST_ERR( error ); |
|
1967 } |
|
1968 |
|
1969 if( media && media->IsSupported( KMPXMediaGeneralUri ) ) |
|
1970 { |
|
1971 TUint32 downloadId = 0; |
|
1972 if( media->IsSupported( KVcxMediaMyVideosDownloadId ) ) |
|
1973 { |
|
1974 downloadId = media->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId ); |
|
1975 } |
|
1976 |
|
1977 TInt state = -1; |
|
1978 if( media->IsSupported( KVcxMediaMyVideosDownloadState ) ) |
|
1979 { |
|
1980 state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState ); |
|
1981 } |
|
1982 |
|
1983 HBufC* path( NULL ); |
|
1984 if( media->IsSupported( KMPXMediaGeneralUri ) ) |
|
1985 { |
|
1986 path = media->ValueText( KMPXMediaGeneralUri ).AllocL(); |
|
1987 } |
|
1988 else |
|
1989 { |
|
1990 path = HBufC::NewL( 32 ); |
|
1991 } |
|
1992 |
|
1993 TMPXItemId itemId = *(media->Value<TMPXItemId>( KMPXMediaGeneralId )); |
|
1994 |
|
1995 filePaths.Append( path ); |
|
1996 downloadIds.Append( downloadId ); |
|
1997 downloadStates.Append( state ); |
|
1998 mpxIds.Append( itemId.iId1 ); |
|
1999 } |
|
2000 } |
|
2001 |
|
2002 // Cancel downloads. |
|
2003 |
|
2004 for( TInt i = mpxIds.Count()-1; i >= 0; i-- ) |
|
2005 { |
|
2006 if( downloadIds[i] != 0 || downloadStates[i] != -1 ) |
|
2007 { |
|
2008 // Cancel the download. |
|
2009 RArray<TInt> messages; |
|
2010 if( BaflUtils::FileExists( iFs, filePaths[i]->Des() ) ) |
|
2011 { |
|
2012 messages.Append( KVCXMYVideosTestMessageMpxItemDeleted ); |
|
2013 } |
|
2014 messages.Append( KVCXMYVideosTestMessageCommandComplete ); |
|
2015 messages.Append( KVCXMYVideosTestMessageCollectionOpened ); |
|
2016 TRAP( error, iTester->CancelDownloadL( mpxIds[i], downloadIds[i], filePaths[i]->Des(), EFalse ) ); |
|
2017 if( error == KErrNone ) |
|
2018 { |
|
2019 TRAP( error, WaitForMessagesL( ETrue, messages, 30, ETrue ) ); |
|
2020 } |
|
2021 messages.Reset(); |
|
2022 // Error occured, lets hope deleting works. |
|
2023 if( error != KErrNone ) |
|
2024 { |
|
2025 downloadIds[i] = 0; |
|
2026 downloadStates[i] = -1; |
|
2027 } |
|
2028 } |
|
2029 } |
|
2030 |
1909 |
2031 // Get current list of medias. |
1910 // Get current list of medias. |
2032 |
1911 |
2033 CMPXMediaArray* medias( NULL ); |
1912 CMPXMediaArray* medias( NULL ); |
2034 medias = iTester->SelectMediasL( -1, 0, iTester->GetMediaCount() ); |
1913 medias = iTester->SelectMediasL( -1, 0, iTester->GetMediaCount() ); |
2080 |
1959 |
2081 CleanupStack::PopAndDestroy( medias ); |
1960 CleanupStack::PopAndDestroy( medias ); |
2082 |
1961 |
2083 iLastReceivedMessage = -1; |
1962 iLastReceivedMessage = -1; |
2084 |
1963 |
2085 CleanupStack::PopAndDestroy( &filePaths ); |
|
2086 CleanupStack::PopAndDestroy( &downloadStates ); |
|
2087 CleanupStack::PopAndDestroy( &downloadIds ); |
|
2088 CleanupStack::PopAndDestroy( &mpxIds ); |
|
2089 |
|
2090 if( iTester && iTester->GetDownloadWatcher() ) |
|
2091 { |
|
2092 iTester->GetDownloadWatcher()->Reset(); |
|
2093 } |
|
2094 |
|
2095 if( iTester->GetMediaCount() > 0 ) |
1964 if( iTester->GetMediaCount() > 0 ) |
2096 { |
1965 { |
2097 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: All medias could not be removed."); |
1966 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: All medias could not be removed."); |
2098 error = KErrCorrupt; |
1967 error = KErrCorrupt; |
2099 } |
1968 } |
2100 |
1969 |
2101 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveAllMediaL <----------"); |
1970 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveAllMediaL <----------"); |
2102 return VCXMVTEST_ERR( error ); |
1971 return error; |
2103 } |
1972 } |
2104 |
1973 |
2105 // ----------------------------------------------------------------------------- |
1974 // ----------------------------------------------------------------------------- |
2106 // CIptvMyVideosApiTest::MoveMediaL |
1975 // CVcxMyVideosApiTest::MoveMediaL |
2107 // ----------------------------------------------------------------------------- |
1976 // ----------------------------------------------------------------------------- |
2108 // |
1977 // |
2109 TInt CVCXMyVideosCollectionPluginTest::MoveMediaL( CStifItemParser& aItem ) |
1978 TInt CVCXMyVideosCollectionPluginTest::MoveMediaL( CStifItemParser& aItem ) |
2110 { |
1979 { |
2111 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::MoveMediaL ---------->"); |
1980 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::MoveMediaL ---------->"); |
2139 |
2008 |
2140 TInt err( KErrNotReady ); |
2009 TInt err( KErrNotReady ); |
2141 if( iTester ) |
2010 if( iTester ) |
2142 { |
2011 { |
2143 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2012 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2144 err = VCXMVTEST_ERR( err ); |
2013 err = err; |
2145 if( err == KErrNone ) |
2014 if( err == KErrNone ) |
2146 { |
2015 { |
2147 TRAP( err, iTester->MoveMediasL( sourceDrive, index, index+1, destDrive, syncCall ) ); |
2016 TRAP( err, iTester->MoveMediasL( sourceDrive, index, index+1, destDrive, syncCall ) ); |
2148 } |
2017 } |
2149 } |
2018 } |
2150 |
2019 |
2151 if( err != KErrNone ) |
2020 if( err != KErrNone ) |
2152 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2021 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2153 |
2022 |
2154 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MoveMediaL <----------"); |
2023 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MoveMediaL <----------"); |
2155 return VCXMVTEST_ERR( err ); |
2024 return err; |
2156 } |
2025 } |
2157 |
2026 |
2158 // ----------------------------------------------------------------------------- |
2027 // ----------------------------------------------------------------------------- |
2159 // CIptvMyVideosApiTest::MoveMediasL |
2028 // CVcxMyVideosApiTest::MoveMediasL |
2160 // ----------------------------------------------------------------------------- |
2029 // ----------------------------------------------------------------------------- |
2161 // |
2030 // |
2162 TInt CVCXMyVideosCollectionPluginTest::MoveMediasL( CStifItemParser& aItem ) |
2031 TInt CVCXMyVideosCollectionPluginTest::MoveMediasL( CStifItemParser& aItem ) |
2163 { |
2032 { |
2164 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::MoveMediasL ---------->"); |
2033 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::MoveMediasL ---------->"); |
2195 |
2064 |
2196 TInt err( KErrNotReady ); |
2065 TInt err( KErrNotReady ); |
2197 if( iTester ) |
2066 if( iTester ) |
2198 { |
2067 { |
2199 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2068 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2200 err = VCXMVTEST_ERR( err ); |
2069 err = err; |
2201 if( err == KErrNone ) |
2070 if( err == KErrNone ) |
2202 { |
2071 { |
2203 TRAP( err, iTester->MoveMediasL( sourceDrive, index, endIndex, destDrive, syncCall ) ); |
2072 TRAP( err, iTester->MoveMediasL( sourceDrive, index, endIndex, destDrive, syncCall ) ); |
2204 } |
2073 } |
2205 } |
2074 } |
2206 |
2075 |
2207 if( err != KErrNone ) |
2076 if( err != KErrNone ) |
2208 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2077 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2209 |
2078 |
2210 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MoveMediasL <----------"); |
2079 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MoveMediasL <----------"); |
2211 return VCXMVTEST_ERR( err ); |
2080 return err; |
2212 } |
2081 } |
2213 |
2082 |
2214 // ----------------------------------------------------------------------------- |
2083 // ----------------------------------------------------------------------------- |
2215 // CIptvMyVideosApiTest::CancelMoveL |
2084 // CVcxMyVideosApiTest::CancelMoveL |
2216 // ----------------------------------------------------------------------------- |
2085 // ----------------------------------------------------------------------------- |
2217 // |
2086 // |
2218 TInt CVCXMyVideosCollectionPluginTest::CancelMoveL( CStifItemParser& aItem ) |
2087 TInt CVCXMyVideosCollectionPluginTest::CancelMoveL( CStifItemParser& aItem ) |
2219 { |
2088 { |
2220 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelMoveL ---------->"); |
2089 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelMoveL ---------->"); |
2245 |
2114 |
2246 if( err != KErrNone ) |
2115 if( err != KErrNone ) |
2247 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2116 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2248 |
2117 |
2249 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelMoveL <----------"); |
2118 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelMoveL <----------"); |
2250 return VCXMVTEST_ERR( err ); |
2119 return err; |
2251 } |
2120 } |
2252 |
2121 |
2253 // ----------------------------------------------------------------------------- |
2122 // ----------------------------------------------------------------------------- |
2254 // CIptvMyVideosApiTest::CopyMediaL |
2123 // CVcxMyVideosApiTest::CopyMediaL |
2255 // ----------------------------------------------------------------------------- |
2124 // ----------------------------------------------------------------------------- |
2256 // |
2125 // |
2257 TInt CVCXMyVideosCollectionPluginTest::CopyMediaL( CStifItemParser& aItem ) |
2126 TInt CVCXMyVideosCollectionPluginTest::CopyMediaL( CStifItemParser& aItem ) |
2258 { |
2127 { |
2259 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CopyMediaL ---------->"); |
2128 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CopyMediaL ---------->"); |
2293 |
2162 |
2294 if( err != KErrNone ) |
2163 if( err != KErrNone ) |
2295 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2164 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2296 |
2165 |
2297 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CopyMediaL <----------"); |
2166 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CopyMediaL <----------"); |
2298 return VCXMVTEST_ERR( err ); |
2167 return err; |
2299 } |
2168 } |
2300 |
2169 |
2301 // ----------------------------------------------------------------------------- |
2170 // ----------------------------------------------------------------------------- |
2302 // CIptvMyVideosApiTest::CopyMediasL |
2171 // CVcxMyVideosApiTest::CopyMediasL |
2303 // ----------------------------------------------------------------------------- |
2172 // ----------------------------------------------------------------------------- |
2304 // |
2173 // |
2305 TInt CVCXMyVideosCollectionPluginTest::CopyMediasL( CStifItemParser& aItem ) |
2174 TInt CVCXMyVideosCollectionPluginTest::CopyMediasL( CStifItemParser& aItem ) |
2306 { |
2175 { |
2307 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CopyMediasL ---------->"); |
2176 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CopyMediasL ---------->"); |
2344 |
2213 |
2345 if( err != KErrNone ) |
2214 if( err != KErrNone ) |
2346 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2215 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2347 |
2216 |
2348 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CopyMediasL <----------"); |
2217 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CopyMediasL <----------"); |
2349 return VCXMVTEST_ERR( err ); |
2218 return err; |
2350 } |
2219 } |
2351 |
2220 |
2352 // ----------------------------------------------------------------------------- |
2221 // ----------------------------------------------------------------------------- |
2353 // CIptvMyVideosApiTest::CancelCopyL |
2222 // CVcxMyVideosApiTest::CancelCopyL |
2354 // ----------------------------------------------------------------------------- |
2223 // ----------------------------------------------------------------------------- |
2355 // |
2224 // |
2356 TInt CVCXMyVideosCollectionPluginTest::CancelCopyL( CStifItemParser& aItem ) |
2225 TInt CVCXMyVideosCollectionPluginTest::CancelCopyL( CStifItemParser& aItem ) |
2357 { |
2226 { |
2358 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelCopyL ---------->"); |
2227 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelCopyL ---------->"); |
2383 |
2252 |
2384 if( err != KErrNone ) |
2253 if( err != KErrNone ) |
2385 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2254 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2386 |
2255 |
2387 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelCopyL <----------"); |
2256 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelCopyL <----------"); |
2388 return VCXMVTEST_ERR( err ); |
2257 return err; |
2389 } |
2258 } |
2390 |
2259 |
2391 // ----------------------------------------------------------------------------- |
2260 // ----------------------------------------------------------------------------- |
2392 // CIptvMyVideosApiTest::DeleteMediaL |
2261 // CVcxMyVideosApiTest::DeleteMediaL |
2393 // ----------------------------------------------------------------------------- |
2262 // ----------------------------------------------------------------------------- |
2394 // |
2263 // |
2395 TInt CVCXMyVideosCollectionPluginTest::DeleteMediaL( CStifItemParser& aItem ) |
2264 TInt CVCXMyVideosCollectionPluginTest::DeleteMediaL( CStifItemParser& aItem ) |
2396 { |
2265 { |
2397 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteMediaL ---------->"); |
2266 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteMediaL ---------->"); |
2422 |
2291 |
2423 TInt err( KErrNotReady ); |
2292 TInt err( KErrNotReady ); |
2424 if( iTester ) |
2293 if( iTester ) |
2425 { |
2294 { |
2426 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2295 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2427 err = VCXMVTEST_ERR( err ); |
2296 err = err; |
2428 if( err == KErrNone ) |
2297 if( err == KErrNone ) |
2429 { |
2298 { |
2430 TRAP( err, iTester->DeleteMediasL( sourceDrive, index, index+1, syncCall ) ); |
2299 TRAP( err, iTester->DeleteMediasL( sourceDrive, index, index+1, syncCall ) ); |
2431 } |
2300 } |
2432 } |
2301 } |
2433 |
2302 |
2434 if( err != KErrNone ) |
2303 if( err != KErrNone ) |
2435 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2304 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2436 |
2305 |
2437 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteMediaL <----------"); |
2306 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteMediaL <----------"); |
2438 return VCXMVTEST_ERR( err ); |
2307 return err; |
2439 } |
2308 } |
2440 |
2309 |
2441 // ----------------------------------------------------------------------------- |
2310 // ----------------------------------------------------------------------------- |
2442 // CIptvMyVideosApiTest::DeleteMediasL |
2311 // CVcxMyVideosApiTest::DeleteMediasL |
2443 // ----------------------------------------------------------------------------- |
2312 // ----------------------------------------------------------------------------- |
2444 // |
2313 // |
2445 TInt CVCXMyVideosCollectionPluginTest::DeleteMediasL( CStifItemParser& aItem ) |
2314 TInt CVCXMyVideosCollectionPluginTest::DeleteMediasL( CStifItemParser& aItem ) |
2446 { |
2315 { |
2447 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteMediasL ---------->"); |
2316 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteMediasL ---------->"); |
2475 |
2344 |
2476 TInt err( KErrNotReady ); |
2345 TInt err( KErrNotReady ); |
2477 if( iTester ) |
2346 if( iTester ) |
2478 { |
2347 { |
2479 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2348 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2480 err = VCXMVTEST_ERR( err ); |
2349 err = err; |
2481 if( err == KErrNone ) |
2350 if( err == KErrNone ) |
2482 { |
2351 { |
2483 TRAP( err, iTester->DeleteMediasL( sourceDrive, index, endIndex, syncCall ) ); |
2352 TRAP( err, iTester->DeleteMediasL( sourceDrive, index, endIndex, syncCall ) ); |
2484 } |
2353 } |
2485 } |
2354 } |
2488 { |
2357 { |
2489 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2358 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2490 } |
2359 } |
2491 |
2360 |
2492 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteMediasL <----------"); |
2361 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteMediasL <----------"); |
2493 return VCXMVTEST_ERR( err ); |
2362 return err; |
2494 } |
2363 } |
2495 |
2364 |
2496 // ----------------------------------------------------------------------------- |
2365 // ----------------------------------------------------------------------------- |
2497 // CIptvMyVideosApiTest::CancelDeleteL |
2366 // CVcxMyVideosApiTest::CancelDeleteL |
2498 // ----------------------------------------------------------------------------- |
2367 // ----------------------------------------------------------------------------- |
2499 // |
2368 // |
2500 TInt CVCXMyVideosCollectionPluginTest::CancelDeleteL( CStifItemParser& aItem ) |
2369 TInt CVCXMyVideosCollectionPluginTest::CancelDeleteL( CStifItemParser& aItem ) |
2501 { |
2370 { |
2502 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelDeleteL ---------->"); |
2371 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelDeleteL ---------->"); |
2527 |
2396 |
2528 if( err != KErrNone ) |
2397 if( err != KErrNone ) |
2529 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2398 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2530 |
2399 |
2531 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelDeleteL <----------"); |
2400 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelDeleteL <----------"); |
2532 return VCXMVTEST_ERR( err ); |
2401 return err; |
2533 } |
2402 } |
2534 |
2403 |
2535 //---------------------------------------------------------------------------- |
2404 //---------------------------------------------------------------------------- |
2536 // CIptvMyVideosApiTest::CancelNextOperationL |
2405 // CVcxMyVideosApiTest::CancelNextOperationL |
2537 // ----------------------------------------------------------------------------- |
2406 // ----------------------------------------------------------------------------- |
2538 // |
2407 // |
2539 TInt CVCXMyVideosCollectionPluginTest::CancelNextOperationL( CStifItemParser& /* aItem */ ) |
2408 TInt CVCXMyVideosCollectionPluginTest::CancelNextOperationL( CStifItemParser& /* aItem */ ) |
2540 { |
2409 { |
2541 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelNextOperationL ---------->"); |
2410 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelNextOperationL ---------->"); |
2551 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelNextOperationL <----------"); |
2420 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelNextOperationL <----------"); |
2552 return KErrNone; |
2421 return KErrNone; |
2553 } |
2422 } |
2554 |
2423 |
2555 // ----------------------------------------------------------------------------- |
2424 // ----------------------------------------------------------------------------- |
2556 // CIptvMyVideosApiTest::DeleteFileOfMediaL |
2425 // CVcxMyVideosApiTest::DeleteFileOfMediaL |
2557 // ----------------------------------------------------------------------------- |
2426 // ----------------------------------------------------------------------------- |
2558 // |
2427 // |
2559 TInt CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL( CStifItemParser& aItem ) |
2428 TInt CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL( CStifItemParser& aItem ) |
2560 { |
2429 { |
2561 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL ---------->"); |
2430 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL ---------->"); |
2588 { |
2457 { |
2589 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2458 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
2590 } |
2459 } |
2591 |
2460 |
2592 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL <----------"); |
2461 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteFileOfMediaL <----------"); |
2593 return VCXMVTEST_ERR( err ); |
2462 return err; |
2594 } |
2463 } |
2595 |
2464 |
2596 // ----------------------------------------------------------------------------- |
2465 // ----------------------------------------------------------------------------- |
2597 // CIptvMyVideosApiTest::DeleteFilesOfAllMediasL |
2466 // CVcxMyVideosApiTest::DeleteFilesOfAllMediasL |
2598 // ----------------------------------------------------------------------------- |
2467 // ----------------------------------------------------------------------------- |
2599 // |
2468 // |
2600 TInt CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL( CStifItemParser& /* aItem */ ) |
2469 TInt CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL( CStifItemParser& /* aItem */ ) |
2601 { |
2470 { |
2602 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL ---------->"); |
2471 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL ---------->"); |
2611 |
2480 |
2612 TInt err( KErrNotReady ); |
2481 TInt err( KErrNotReady ); |
2613 if( iTester ) |
2482 if( iTester ) |
2614 { |
2483 { |
2615 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2484 TRAP( err, iTester->EnsureMediaFilesAreNotInUseL() ); |
2616 err = VCXMVTEST_ERR( err ); |
2485 err = err; |
2617 if( err == KErrNone ) |
2486 if( err == KErrNone ) |
2618 { |
2487 { |
2619 TRAP( err, iTester->DeleteAllMediaFilesL() ); |
2488 TRAP( err, iTester->DeleteAllMediaFilesL() ); |
2620 } |
2489 } |
2621 } |
2490 } |
2622 |
2491 |
2623 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL <----------"); |
2492 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteFilesOfAllMediasL <----------"); |
2624 return VCXMVTEST_ERR( err ); |
2493 return err; |
2625 } |
2494 } |
2626 |
2495 |
2627 // ----------------------------------------------------------------------------- |
2496 // ----------------------------------------------------------------------------- |
2628 // CIptvMyVideosApiTest::CreateVideoFileL |
2497 // CVcxMyVideosApiTest::CreateAlbumL |
2498 // ----------------------------------------------------------------------------- |
|
2499 // |
|
2500 TInt CVCXMyVideosCollectionPluginTest::CreateAlbumL( CStifItemParser& aItem ) |
|
2501 { |
|
2502 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateAlbumL ---------->"); |
|
2503 // Print to UI |
|
2504 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
2505 _LIT( KWhere, "In CreateAlbumL" ); |
|
2506 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
2507 // Print to log file |
|
2508 iLog->Log( KWhere ); |
|
2509 |
|
2510 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
2511 |
|
2512 iLastReceivedMessage = -1; |
|
2513 |
|
2514 TInt err( KErrNotReady ); |
|
2515 if( iTester ) |
|
2516 { |
|
2517 TPtrC albumName; |
|
2518 User::LeaveIfError( aItem.GetNextString( albumName ) ); |
|
2519 |
|
2520 TInt sync; |
|
2521 if( aItem.GetNextInt( sync ) != KErrNone ) |
|
2522 { |
|
2523 sync = EFalse; |
|
2524 } |
|
2525 |
|
2526 if( albumName.Compare( KStifScript2KString ) == KErrNone ) |
|
2527 { |
|
2528 TRAP( err, iTester->CreateAlbumL( KAbout2050CharsString, sync ) ); |
|
2529 } |
|
2530 else if( albumName.Compare( KStifScriptEmptyString ) == KErrNone ) |
|
2531 { |
|
2532 TRAP( err, iTester->CreateAlbumL( KVcxTestEmptyString, sync ) ); |
|
2533 } |
|
2534 else if( albumName.Compare( KStifScriptInvalidRequest ) == KErrNone ) |
|
2535 { |
|
2536 TRAP( err, iTester->CreateAlbumL( KVcxTestEmptyString, sync, ETrue ) ); |
|
2537 } |
|
2538 else |
|
2539 { |
|
2540 TRAP( err, iTester->CreateAlbumL( albumName, sync ) ); |
|
2541 } |
|
2542 } |
|
2543 |
|
2544 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateAlbumL <----------"); |
|
2545 return err; |
|
2546 } |
|
2547 |
|
2548 // ----------------------------------------------------------------------------- |
|
2549 // CVcxMyVideosApiTest::DeleteAlbumsL |
|
2550 // ----------------------------------------------------------------------------- |
|
2551 // |
|
2552 TInt CVCXMyVideosCollectionPluginTest::DeleteAlbumsL( CStifItemParser& aItem ) |
|
2553 { |
|
2554 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteAlbumsL ---------->"); |
|
2555 // Print to UI |
|
2556 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
2557 _LIT( KWhere, "In DeleteAlbumsL" ); |
|
2558 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
2559 // Print to log file |
|
2560 iLog->Log( KWhere ); |
|
2561 |
|
2562 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
2563 |
|
2564 iLastReceivedMessage = -1; |
|
2565 |
|
2566 TInt err( KErrNotReady ); |
|
2567 |
|
2568 if( iTester ) |
|
2569 { |
|
2570 TPtrC albumName; |
|
2571 RArray<TPtrC> albumNames; |
|
2572 |
|
2573 while( aItem.GetNextString( albumName ) == KErrNone ) |
|
2574 { |
|
2575 albumNames.Append( albumName ); |
|
2576 } |
|
2577 |
|
2578 if( albumNames.Count() < 1 ) |
|
2579 { |
|
2580 VCXLOGLO1("CVCXMyVideosCollectionPluginTest::DeleteAlbumsL: No albums specified!"); |
|
2581 err = KErrArgument; |
|
2582 } |
|
2583 else |
|
2584 { |
|
2585 TRAP( err, iTester->DeleteAlbumsL( albumNames ) ); |
|
2586 } |
|
2587 } |
|
2588 |
|
2589 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteAlbumsL <----------"); |
|
2590 return err; |
|
2591 } |
|
2592 |
|
2593 // ----------------------------------------------------------------------------- |
|
2594 // CVcxMyVideosApiTest::DeleteAllAlbumsL |
|
2595 // ----------------------------------------------------------------------------- |
|
2596 // |
|
2597 TInt CVCXMyVideosCollectionPluginTest::DeleteAllAlbumsL( CStifItemParser& aItem ) |
|
2598 { |
|
2599 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DeleteAllAlbumsL ---------->"); |
|
2600 // Print to UI |
|
2601 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
2602 _LIT( KWhere, "In DeleteAllAlbumsL" ); |
|
2603 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
2604 // Print to log file |
|
2605 iLog->Log( KWhere ); |
|
2606 |
|
2607 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
2608 |
|
2609 iLastReceivedMessage = -1; |
|
2610 |
|
2611 TInt err( KErrNotReady ); |
|
2612 |
|
2613 if( iTester ) |
|
2614 { |
|
2615 TRAP( err, iTester->DeleteAllAlbumsL() ); |
|
2616 } |
|
2617 |
|
2618 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteAllAlbumsL <----------"); |
|
2619 return err; |
|
2620 } |
|
2621 |
|
2622 // ----------------------------------------------------------------------------- |
|
2623 // CVcxMyVideosApiTest::AddMediasToAlbumL |
|
2624 // ----------------------------------------------------------------------------- |
|
2625 // |
|
2626 TInt CVCXMyVideosCollectionPluginTest::AddMediasToAlbumL( CStifItemParser& aItem ) |
|
2627 { |
|
2628 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::AddMediasToAlbumL ---------->"); |
|
2629 // Print to UI |
|
2630 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
2631 _LIT( KWhere, "In AddMediasToAlbumL" ); |
|
2632 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
2633 // Print to log file |
|
2634 iLog->Log( KWhere ); |
|
2635 |
|
2636 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
2637 |
|
2638 iLastReceivedMessage = -1; |
|
2639 |
|
2640 TInt err( KErrNotReady ); |
|
2641 |
|
2642 if( iTester ) |
|
2643 { |
|
2644 TPtrC albumName; |
|
2645 User::LeaveIfError( aItem.GetNextString( albumName ) ); |
|
2646 |
|
2647 TInt sourceDrive(0); |
|
2648 User::LeaveIfError( GetDriveParam( aItem, sourceDrive ) ); |
|
2649 |
|
2650 TInt index(0); |
|
2651 User::LeaveIfError( aItem.GetNextInt( index ) ); |
|
2652 |
|
2653 TInt endIndex(0); |
|
2654 User::LeaveIfError( aItem.GetNextInt( endIndex ) ); |
|
2655 |
|
2656 TRAP( err, iTester->AddMediasToAlbumL( albumName, sourceDrive, index, endIndex ) ); |
|
2657 } |
|
2658 |
|
2659 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::AddMediasToAlbumL <----------"); |
|
2660 return err; |
|
2661 } |
|
2662 |
|
2663 // ----------------------------------------------------------------------------- |
|
2664 // CVcxMyVideosApiTest::RemoveMediasFromAlbumL |
|
2665 // ----------------------------------------------------------------------------- |
|
2666 // |
|
2667 TInt CVCXMyVideosCollectionPluginTest::RemoveMediasFromAlbumL( CStifItemParser& aItem ) |
|
2668 { |
|
2669 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RemoveMediasFromAlbumL ---------->"); |
|
2670 // Print to UI |
|
2671 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
2672 _LIT( KWhere, "In RemoveMediasFromAlbumL" ); |
|
2673 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
2674 // Print to log file |
|
2675 iLog->Log( KWhere ); |
|
2676 |
|
2677 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
2678 |
|
2679 iLastReceivedMessage = -1; |
|
2680 |
|
2681 TInt err( KErrNotReady ); |
|
2682 |
|
2683 if( iTester ) |
|
2684 { |
|
2685 TPtrC albumName; |
|
2686 User::LeaveIfError( aItem.GetNextString( albumName ) ); |
|
2687 |
|
2688 TInt sourceDrive(0); |
|
2689 User::LeaveIfError( GetDriveParam( aItem, sourceDrive ) ); |
|
2690 |
|
2691 TInt index(0); |
|
2692 User::LeaveIfError( aItem.GetNextInt( index ) ); |
|
2693 |
|
2694 TInt endIndex(0); |
|
2695 User::LeaveIfError( aItem.GetNextInt( endIndex ) ); |
|
2696 |
|
2697 TRAP( err, iTester->RemoveMediasFromAlbumL( albumName, sourceDrive, index, endIndex ) ); |
|
2698 } |
|
2699 |
|
2700 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RemoveMediasFromAlbumL <----------"); |
|
2701 return err; |
|
2702 } |
|
2703 |
|
2704 // ----------------------------------------------------------------------------- |
|
2705 // CVcxMyVideosApiTest::RenameAlbumL |
|
2706 // ----------------------------------------------------------------------------- |
|
2707 // |
|
2708 TInt CVCXMyVideosCollectionPluginTest::RenameAlbumL( CStifItemParser& aItem ) |
|
2709 { |
|
2710 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::RenameAlbumL ---------->"); |
|
2711 // Print to UI |
|
2712 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
2713 _LIT( KWhere, "In RenameAlbumL" ); |
|
2714 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
2715 // Print to log file |
|
2716 iLog->Log( KWhere ); |
|
2717 |
|
2718 WaitForRefreshL( EFalse ); // Wait for possible refresh to finish. |
|
2719 |
|
2720 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
2721 |
|
2722 int err( KErrNotReady ); |
|
2723 |
|
2724 if( iTester ) |
|
2725 { |
|
2726 TPtrC albumName; |
|
2727 User::LeaveIfError( aItem.GetNextString( albumName ) ); |
|
2728 |
|
2729 TPtrC newAlbumName; |
|
2730 User::LeaveIfError( aItem.GetNextString( newAlbumName ) ); |
|
2731 |
|
2732 if( newAlbumName.Compare( KStifScript2KString ) == KErrNone ) |
|
2733 { |
|
2734 TRAP( err, iTester->RenameAlbumL( albumName, KAbout2050CharsString ) ); |
|
2735 } |
|
2736 else if( newAlbumName.Compare( KStifScriptEmptyString ) == KErrNone ) |
|
2737 { |
|
2738 TRAP( err, iTester->RenameAlbumL( albumName, KVcxTestEmptyString ) ); |
|
2739 } |
|
2740 else |
|
2741 { |
|
2742 TRAP( err, iTester->RenameAlbumL( albumName, newAlbumName ) ); |
|
2743 } |
|
2744 } |
|
2745 |
|
2746 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::RenameAlbumL <----------"); |
|
2747 return err; |
|
2748 } |
|
2749 |
|
2750 // ----------------------------------------------------------------------------- |
|
2751 // CVcxMyVideosApiTest::CheckAlbumExistsL |
|
2752 // ----------------------------------------------------------------------------- |
|
2753 // |
|
2754 TInt CVCXMyVideosCollectionPluginTest::CheckAlbumExistsL( CStifItemParser& aItem ) |
|
2755 { |
|
2756 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckAlbumExistsL ---------->"); |
|
2757 // Print to UI |
|
2758 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
2759 _LIT( KWhere, "In CheckAlbumExistsL" ); |
|
2760 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
2761 // Print to log file |
|
2762 iLog->Log( KWhere ); |
|
2763 |
|
2764 WaitForRefreshL( EFalse ); // Wait for possible refresh to finish. |
|
2765 |
|
2766 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
2767 |
|
2768 int err( KErrNotReady ); |
|
2769 |
|
2770 if( iTester ) |
|
2771 { |
|
2772 TPtrC albumName; |
|
2773 User::LeaveIfError( aItem.GetNextString( albumName ) ); |
|
2774 |
|
2775 TRAP( err, iTester->GetAlbumIdL(albumName) ); |
|
2776 } |
|
2777 |
|
2778 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckAlbumExistsL <----------"); |
|
2779 return err; |
|
2780 } |
|
2781 |
|
2782 // ----------------------------------------------------------------------------- |
|
2783 // CVcxMyVideosApiTest::CreateVideoFileL |
|
2629 // ----------------------------------------------------------------------------- |
2784 // ----------------------------------------------------------------------------- |
2630 // |
2785 // |
2631 TInt CVCXMyVideosCollectionPluginTest::CreateVideoFileL( CStifItemParser& aItem ) |
2786 TInt CVCXMyVideosCollectionPluginTest::CreateVideoFileL( CStifItemParser& aItem ) |
2632 { |
2787 { |
2633 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateVideoFileL ---------->"); |
2788 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateVideoFileL ---------->"); |
2641 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
2796 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
2642 |
2797 |
2643 TInt temp(0); |
2798 TInt temp(0); |
2644 |
2799 |
2645 // Parameter video type |
2800 // Parameter video type |
2646 CIptvTestVideoCreator::TIptvTestVideoType videoType; |
2801 CVCXMyVideosTestUtils::TVcxTestVideoType videoType; |
2647 User::LeaveIfError( aItem.GetNextInt(temp) ); |
2802 User::LeaveIfError( aItem.GetNextInt(temp) ); |
2648 videoType = static_cast<CIptvTestVideoCreator::TIptvTestVideoType>(temp); |
2803 videoType = static_cast<CVCXMyVideosTestUtils::TVcxTestVideoType>(temp); |
2649 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: videoType: %d", videoType); |
2804 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: videoType: %d", videoType); |
2650 |
2805 |
2651 // Parameter drive letter |
2806 // Parameter drive letter |
2652 TPtrC driveLetter; |
2807 TPtrC driveLetter; |
2653 User::LeaveIfError(aItem.GetNextString(driveLetter)); |
2808 User::LeaveIfError(aItem.GetNextString(driveLetter)); |
2654 #ifdef __WINSCW__ |
|
2655 driveLetter.Set(_L("C")); |
|
2656 #endif |
|
2657 |
2809 |
2658 // Parameter path and filename |
2810 // Parameter path and filename |
2659 TPtrC filename; |
2811 TPtrC filename; |
2660 User::LeaveIfError(aItem.GetNextString(filename)); |
2812 User::LeaveIfError(aItem.GetNextString(filename)); |
2661 if(filename.Length() < 64) |
2813 if(filename.Length() < 64) |
2678 } |
2830 } |
2679 |
2831 |
2680 TRAPD( err, CreateVideoFileL( videoType, driveLetter, filename, size, count, ETrue ) ); |
2832 TRAPD( err, CreateVideoFileL( videoType, driveLetter, filename, size, count, ETrue ) ); |
2681 |
2833 |
2682 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateVideoFileL <----------"); |
2834 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateVideoFileL <----------"); |
2683 return VCXMVTEST_ERR( err ); |
2835 return err; |
2684 } |
2836 } |
2685 |
2837 |
2686 // ----------------------------------------------------------------------------- |
2838 // ----------------------------------------------------------------------------- |
2687 // CIptvMyVideosApiTest::CreateVideoFileNoWaitL |
2839 // CVcxMyVideosApiTest::CreateVideoFileNoWaitL |
2688 // ----------------------------------------------------------------------------- |
2840 // ----------------------------------------------------------------------------- |
2689 // |
2841 // |
2690 TInt CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL( CStifItemParser& aItem ) |
2842 TInt CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL( CStifItemParser& aItem ) |
2691 { |
2843 { |
2692 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ---------->"); |
2844 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ---------->"); |
2700 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
2852 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
2701 |
2853 |
2702 TInt temp(0); |
2854 TInt temp(0); |
2703 |
2855 |
2704 // Parameter video type |
2856 // Parameter video type |
2705 CIptvTestVideoCreator::TIptvTestVideoType videoType; |
2857 CVCXMyVideosTestUtils::TVcxTestVideoType videoType; |
2706 User::LeaveIfError( aItem.GetNextInt(temp) ); |
2858 User::LeaveIfError( aItem.GetNextInt(temp) ); |
2707 videoType = static_cast<CIptvTestVideoCreator::TIptvTestVideoType>(temp); |
2859 videoType = static_cast<CVCXMyVideosTestUtils::TVcxTestVideoType>(temp); |
2708 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: videoType: %d", videoType); |
2860 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: videoType: %d", videoType); |
2709 |
2861 |
2710 // Parameter drive letter |
2862 // Parameter drive letter |
2711 TPtrC driveLetter; |
2863 TPtrC driveLetter; |
2712 User::LeaveIfError(aItem.GetNextString(driveLetter)); |
2864 User::LeaveIfError(aItem.GetNextString(driveLetter)); |
2713 #ifdef __WINSCW__ |
|
2714 driveLetter.Set(_L("C")); |
|
2715 #endif |
|
2716 |
2865 |
2717 // Parameter path and filename |
2866 // Parameter path and filename |
2718 TPtrC filename; |
2867 TPtrC filename; |
2719 User::LeaveIfError(aItem.GetNextString(filename)); |
2868 User::LeaveIfError(aItem.GetNextString(filename)); |
2720 if(filename.Length() < 64) |
2869 if(filename.Length() < 64) |
2739 } |
2888 } |
2740 |
2889 |
2741 TRAPD( err, CreateVideoFileL( videoType, driveLetter, filename, size, count, EFalse ) ); |
2890 TRAPD( err, CreateVideoFileL( videoType, driveLetter, filename, size, count, EFalse ) ); |
2742 |
2891 |
2743 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ---------->"); |
2892 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CreateVideoFileNoWaitL ---------->"); |
2744 return VCXMVTEST_ERR( err ); |
2893 return err; |
2745 } |
2894 } |
2746 |
2895 |
2747 // ----------------------------------------------------------------------------- |
2896 // ----------------------------------------------------------------------------- |
2748 // CIptvMyVideosApiTest::CreateVideoFileL |
2897 // CVcxMyVideosApiTest::CreateVideoFileL |
2749 // ----------------------------------------------------------------------------- |
2898 // ----------------------------------------------------------------------------- |
2750 // |
2899 // |
2751 void CVCXMyVideosCollectionPluginTest::CreateVideoFileL( CIptvTestVideoCreator::TIptvTestVideoType aType, const TDesC& aDriveLetter, const TDesC& aFileName, TInt aSize, TInt aVideoCount, TBool aDoSync ) |
2900 void CVCXMyVideosCollectionPluginTest::CreateVideoFileL( CVCXMyVideosTestUtils::TVcxTestVideoType aType, const TDesC& aDriveLetter, const TDesC& aFileName, TInt aSize, TInt aVideoCount, TBool aDoSync ) |
2752 { |
2901 { |
2753 HBufC* path = HBufC::NewL( 2048 ); |
2902 HBufC* path = HBufC::NewL( 2048 ); |
2754 CleanupStack::PushL(path); |
2903 CleanupStack::PushL(path); |
2755 |
2904 |
2756 // Make sure path exists and resolve path + filename |
2905 // Make sure path exists and resolve path + filename |
2819 |
2968 |
2820 // Create file(s) |
2969 // Create file(s) |
2821 TInt err( KErrNone ); |
2970 TInt err( KErrNone ); |
2822 |
2971 |
2823 iLastReceivedMessage = -1; |
2972 iLastReceivedMessage = -1; |
2824 |
2973 |
2974 if(aDoSync) |
|
2975 { |
|
2976 // Disable automatic refresh. |
|
2977 iTester->SetAutomaticRefresh( EFalse ); |
|
2978 } |
|
2979 |
|
2980 RArray<TInt> messages; |
|
2981 |
|
2982 for(int i = 0; i < aVideoCount; i++) |
|
2983 { |
|
2984 // Create the video. |
|
2985 TRAP( err, iTestUtils->CreateVideoFileL( aType, *path, aSize, ETrue ) ); |
|
2986 if(err != KErrNone) |
|
2987 { |
|
2988 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: CreateVideoFileL returned error: %d:", err); |
|
2989 } |
|
2990 |
|
2991 if( aDoSync && iTester->GetCurrentLevel() == 3 ) |
|
2992 { |
|
2993 // Wait for insertion event. |
|
2994 messages.Append( KVCXMYVideosTestMessageMpxVideoInserted ); |
|
2995 WaitForMessagesL( ETrue, messages, 60, ETrue ); |
|
2996 messages.Reset(); |
|
2997 } |
|
2998 } |
|
2999 |
|
3000 if( aDoSync ) |
|
3001 { |
|
3002 // Refresh. |
|
3003 messages.Reset(); |
|
3004 iTester->RefreshContentsL(); |
|
3005 messages.Append( KVCXMYVideosTestMessageCollectionOpened ); |
|
3006 CleanupClosePushL( messages ); |
|
3007 WaitForMessagesL( ETrue, messages, 30, ETrue ); |
|
3008 CleanupStack::PopAndDestroy( &messages ); |
|
3009 iTester->SetAutomaticRefresh( ETrue ); |
|
3010 } |
|
3011 |
|
3012 CleanupStack::PopAndDestroy( path ); |
|
3013 |
|
3014 #if 0 |
|
2825 if( aVideoCount == 1 ) |
3015 if( aVideoCount == 1 ) |
2826 { |
3016 { |
2827 // Save the path for later use. |
3017 // Save the path for later use. |
2828 CleanupStack::Pop( path ); |
3018 CleanupStack::Pop( path ); |
2829 iSideloadedFiles.Append( path ); |
3019 iSideloadedFiles.Append( path ); |
2830 |
3020 |
2831 // Create the video. |
3021 // Create the video. |
2832 TRAP( err, iTestCommon->CreateVideoFileL( aType, *path, aSize ) ); |
3022 TRAP( err, iTestUtils->CreateVideoFileL( aType, *path, aSize ) ); |
2833 if(err != KErrNone) |
3023 if(err != KErrNone) |
2834 { |
3024 { |
2835 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: CreateVideoFileL returned error: %d:", err); |
3025 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: CreateVideoFileL returned error: %d:", err); |
2836 } |
3026 } |
2837 TRAP_IGNORE( iStats->ActionStartL( KSideloadVideoActionId, _L("Sideload video") ) ); |
|
2838 } |
3027 } |
2839 else |
3028 else |
2840 { |
3029 { |
2841 TRAP( err, iTestCommon->CreateVideoFilesL( aType, *path, aVideoCount, iSideloadedFiles ) ); |
3030 TRAP( err, iTestUtils->CreateVideoFilesL( aType, *path, aVideoCount, iSideloadedFiles ) ); |
2842 if(err != KErrNone) |
3031 if(err != KErrNone) |
2843 { |
3032 { |
2844 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: CreateVideoFilesL returned error: %d:", err); |
3033 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: CreateVideoFilesL returned error: %d:", err); |
2845 } |
|
2846 for( TInt i = 0; i < aVideoCount; i++ ) |
|
2847 { |
|
2848 TRAP_IGNORE( iStats->ActionStartL( KSideloadVideoActionId, _L("Sideload video") ) ); |
|
2849 } |
3034 } |
2850 CleanupStack::PopAndDestroy( path ); |
3035 CleanupStack::PopAndDestroy( path ); |
2851 } |
3036 } |
2852 |
3037 |
2853 if( iTester ) |
3038 if( iTester ) |
2864 |
3049 |
2865 // Wait for insertion events. |
3050 // Wait for insertion events. |
2866 RArray<TInt> messages; |
3051 RArray<TInt> messages; |
2867 for( TInt i=0; i<aVideoCount; i++ ) |
3052 for( TInt i=0; i<aVideoCount; i++ ) |
2868 { |
3053 { |
2869 messages.Append( KVCXMYVideosTestMessageMpxItemInserted ); |
3054 messages.Append( KVCXMYVideosTestMessageMpxVideoInserted ); |
2870 } |
3055 } |
2871 // Only one video added, refresh is automatic. |
3056 // Only one video added, refresh is automatic. |
2872 if( aVideoCount <= 1 ) |
3057 if( aVideoCount <= 1 ) |
2873 { |
3058 { |
2874 messages.Append( KVCXMYVideosTestMessageCollectionOpened ); |
3059 messages.Append( KVCXMYVideosTestMessageCollectionOpened ); |
2889 CleanupStack::PopAndDestroy( &messages ); |
3074 CleanupStack::PopAndDestroy( &messages ); |
2890 iTester->SetAutomaticRefresh( ETrue ); |
3075 iTester->SetAutomaticRefresh( ETrue ); |
2891 } |
3076 } |
2892 } |
3077 } |
2893 } |
3078 } |
3079 #endif |
|
2894 } |
3080 } |
2895 |
3081 |
2896 // ----------------------------------------------------------------------------- |
3082 // ----------------------------------------------------------------------------- |
2897 // CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL |
3083 // CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL |
2898 // Delete everything from sideloading folders. |
3084 // Delete everything from sideloading folders. |
2945 } |
3131 } |
2946 |
3132 |
2947 TInt createCount = amount - videoCount; |
3133 TInt createCount = amount - videoCount; |
2948 |
3134 |
2949 TRAP( err, CreateVideoFileL( |
3135 TRAP( err, CreateVideoFileL( |
2950 CIptvTestVideoCreator::IptvTestVideoMpeg4, driveLetter, filename, -1, createCount, ETrue ) ); |
3136 CVCXMyVideosTestUtils::VcxTestVideoMpeg4, driveLetter, filename, -1, createCount, ETrue ) ); |
2951 } |
3137 } |
2952 else |
3138 else |
2953 if( videoCount > amount ) |
3139 if( videoCount > amount ) |
2954 { |
3140 { |
2955 VCXLOGLO2("CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL: drive has more than %d videos.", amount); |
3141 VCXLOGLO2("CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL: drive has more than %d videos.", amount); |
2978 { |
3164 { |
2979 VCXLOGLO2("CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL: drive already has %d videos.", amount); |
3165 VCXLOGLO2("CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL: drive already has %d videos.", amount); |
2980 } |
3166 } |
2981 |
3167 |
2982 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL <----------"); |
3168 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EnsureDriveForVideosL <----------"); |
2983 return VCXMVTEST_ERR( err ); |
3169 return err; |
2984 } |
3170 } |
2985 |
3171 |
2986 // ----------------------------------------------------------------------------- |
3172 // ----------------------------------------------------------------------------- |
2987 // CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL |
3173 // CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL |
2988 // Delete everything from sideloading folders. |
3174 // Delete everything from sideloading folders. |
3041 HBufC16* path = filesInUse[i]; |
3227 HBufC16* path = filesInUse[i]; |
3042 CleanupStack::PushL( path ); |
3228 CleanupStack::PushL( path ); |
3043 filesInUse.Remove( i ); |
3229 filesInUse.Remove( i ); |
3044 |
3230 |
3045 // Delete file |
3231 // Delete file |
3046 iTestCommon->EnsureFileIsNotInUse( *path ); |
3232 iTestUtils->EnsureFileIsNotInUse( *path ); |
3047 TInt err = iFs.Delete( path->Des() ); |
3233 TInt err = iFs.Delete( path->Des() ); |
3048 if( err != KErrNone ) |
3234 if( err != KErrNone ) |
3049 { |
3235 { |
3050 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: delete 2nd error: %d", err); |
3236 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: delete 2nd error: %d", err); |
3051 } |
3237 } |
3058 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL <----------"); |
3244 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::EmptySideloadFoldersL <----------"); |
3059 return KErrNone; |
3245 return KErrNone; |
3060 } |
3246 } |
3061 |
3247 |
3062 // ----------------------------------------------------------------------------- |
3248 // ----------------------------------------------------------------------------- |
3063 // CIptvMyVideosApiTest::SetDeleteSideloadedVideos |
3249 // CVcxMyVideosApiTest::SetDeleteSideloadedVideos |
3064 // ----------------------------------------------------------------------------- |
3250 // ----------------------------------------------------------------------------- |
3065 // |
3251 // |
3066 TInt CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos( CStifItemParser& /* aItem */ ) |
3252 TInt CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos( CStifItemParser& /* aItem */ ) |
3067 { |
3253 { |
3068 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos ---------->"); |
3254 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos ---------->"); |
3070 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos <----------"); |
3256 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::SetDeleteSideloadedVideos <----------"); |
3071 return KErrNone; |
3257 return KErrNone; |
3072 } |
3258 } |
3073 |
3259 |
3074 // ----------------------------------------------------------------------------- |
3260 // ----------------------------------------------------------------------------- |
3075 // CIptvMyVideosApiTest::DownloadL |
3261 // CVcxMyVideosApiTest::WaitForMessageL |
3076 // ----------------------------------------------------------------------------- |
|
3077 // |
|
3078 TInt CVCXMyVideosCollectionPluginTest::DownloadL( CStifItemParser& aItem ) |
|
3079 { |
|
3080 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DownloadL ---------->"); |
|
3081 iLastReceivedMessage = -1; |
|
3082 TRAPD( err, DownloadOrResumeL( aItem, EFalse, EFalse ) ); |
|
3083 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DownloadL <----------"); |
|
3084 return VCXMVTEST_ERR( err ); |
|
3085 } |
|
3086 |
|
3087 // ----------------------------------------------------------------------------- |
|
3088 // CIptvMyVideosApiTest::ResumeDownloadL |
|
3089 // ----------------------------------------------------------------------------- |
|
3090 // |
|
3091 TInt CVCXMyVideosCollectionPluginTest::ResumeDownloadL( CStifItemParser& aItem ) |
|
3092 { |
|
3093 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::ResumeDownloadL ---------->"); |
|
3094 iLastReceivedMessage = -1; |
|
3095 TRAPD( err, DownloadOrResumeL( aItem, EFalse, ETrue ) ); |
|
3096 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::ResumeDownloadL <----------"); |
|
3097 return VCXMVTEST_ERR( err ); |
|
3098 } |
|
3099 |
|
3100 // ----------------------------------------------------------------------------- |
|
3101 // CIptvMyVideosApiTest::ResumeAllDownloadsL |
|
3102 // ----------------------------------------------------------------------------- |
|
3103 // |
|
3104 TInt CVCXMyVideosCollectionPluginTest::ResumeAllDownloadsL( CStifItemParser& /* aItem */ ) |
|
3105 { |
|
3106 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::ResumeAllDownloadsL ---------->"); |
|
3107 // Print to UI |
|
3108 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3109 _LIT( KWhere, "In ResumeAllDownloadsL" ); |
|
3110 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3111 // Print to log file |
|
3112 iLog->Log( KWhere ); |
|
3113 |
|
3114 TRAPD( err, iTester->ResumeAllDownloadsL() ); |
|
3115 |
|
3116 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::ResumeAllDownloadsL <----------"); |
|
3117 return VCXMVTEST_ERR( err ); |
|
3118 } |
|
3119 |
|
3120 // ----------------------------------------------------------------------------- |
|
3121 // CIptvMyVideosApiTest::DownloadUsingMediaL |
|
3122 // ----------------------------------------------------------------------------- |
|
3123 // |
|
3124 TInt CVCXMyVideosCollectionPluginTest::DownloadUsingMediaL( CStifItemParser& aItem ) |
|
3125 { |
|
3126 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DownloadUsingMediaL ---------->"); |
|
3127 |
|
3128 if( !iMpxMedia ) |
|
3129 { |
|
3130 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error. iMpxMedia not set!"); |
|
3131 User::Leave( KErrArgument ); |
|
3132 } |
|
3133 |
|
3134 iLastReceivedMessage = -1; |
|
3135 |
|
3136 TRAPD( err, DownloadOrResumeL( aItem, ETrue, EFalse ) ); |
|
3137 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DownloadUsingMediaL <----------"); |
|
3138 return VCXMVTEST_ERR( err ); |
|
3139 } |
|
3140 |
|
3141 // ----------------------------------------------------------------------------- |
|
3142 // CIptvMyVideosApiTest::ResumeDownloadUsingMediaL |
|
3143 // ----------------------------------------------------------------------------- |
|
3144 // |
|
3145 TInt CVCXMyVideosCollectionPluginTest::ResumeDownloadUsingMediaL( CStifItemParser& aItem ) |
|
3146 { |
|
3147 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::ResumeDownloadUsingMediaL ---------->"); |
|
3148 |
|
3149 if( !iMpxMedia ) |
|
3150 { |
|
3151 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Error. iMpxMedia not set!"); |
|
3152 User::Leave( KErrArgument ); |
|
3153 } |
|
3154 |
|
3155 iLastReceivedMessage = -1; |
|
3156 |
|
3157 TRAPD( err, DownloadOrResumeL( aItem, ETrue, ETrue ) ); |
|
3158 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::ResumeDownloadUsingMediaL <----------"); |
|
3159 return VCXMVTEST_ERR( err ); |
|
3160 } |
|
3161 |
|
3162 // ----------------------------------------------------------------------------- |
|
3163 // CIptvMyVideosApiTest::DownloadOrResumeL |
|
3164 // ----------------------------------------------------------------------------- |
|
3165 // |
|
3166 void CVCXMyVideosCollectionPluginTest::DownloadOrResumeL( CStifItemParser& aItem, TBool aUseCurrentMedia, TBool aResume ) |
|
3167 { |
|
3168 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DownloadOrResumeL"); |
|
3169 // Print to UI |
|
3170 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3171 _LIT( KWhere, "In DownloadOrResumeL" ); |
|
3172 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3173 // Print to log file |
|
3174 iLog->Log( KWhere ); |
|
3175 |
|
3176 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
3177 |
|
3178 iLastReceivedMessage = -1; |
|
3179 |
|
3180 TUint32 iapId(0); |
|
3181 TPtrC iapName; |
|
3182 User::LeaveIfError( aItem.GetNextString( iapName ) ); |
|
3183 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: iapName: %S", &iapName); |
|
3184 |
|
3185 if( iapName == KVCXTestZeroIap ) |
|
3186 { |
|
3187 iapId = 0; |
|
3188 } |
|
3189 else |
|
3190 if( iapName == KVCXTestInvalidIap ) |
|
3191 { |
|
3192 iapId = 10001; |
|
3193 } |
|
3194 else |
|
3195 { |
|
3196 User::LeaveIfError( iTestCommon->GetIapIdL(iapName, iapId) ); |
|
3197 } |
|
3198 |
|
3199 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: iapId: %d", iapId); |
|
3200 |
|
3201 TPtrC serviceName; |
|
3202 User::LeaveIfError( aItem.GetNextString( serviceName ) ); |
|
3203 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceName: %S", &serviceName); |
|
3204 |
|
3205 TInt serviceId(0); |
|
3206 User::LeaveIfError( iServiceEmu->GetServiceIdL(serviceName, serviceId) ); |
|
3207 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceId: %d", serviceId); |
|
3208 |
|
3209 TInt contentId(0); |
|
3210 User::LeaveIfError( aItem.GetNextInt( contentId ) ); |
|
3211 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: contentId: %d", contentId); |
|
3212 |
|
3213 TInt syncCallInt(0); |
|
3214 User::LeaveIfError( aItem.GetNextInt( syncCallInt ) ); |
|
3215 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt); |
|
3216 TBool syncCall = static_cast<TBool>(syncCallInt); |
|
3217 |
|
3218 TPtrC userName; |
|
3219 if( KErrNone == aItem.GetNextString( userName ) ) |
|
3220 { |
|
3221 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: userName: %S", &userName); |
|
3222 } |
|
3223 else |
|
3224 { |
|
3225 userName.Set( _L("") ); |
|
3226 } |
|
3227 |
|
3228 TPtrC password; |
|
3229 if( KErrNone == aItem.GetNextString( password ) ) |
|
3230 { |
|
3231 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: password: %S", &password); |
|
3232 } |
|
3233 else |
|
3234 { |
|
3235 password.Set( _L("") ); |
|
3236 } |
|
3237 |
|
3238 const TPtrC url = iServiceEmu->GetContentUrlL( serviceId, contentId ); |
|
3239 const TPtrC title = iServiceEmu->GetContentTitleL( serviceId, contentId ); |
|
3240 |
|
3241 TInt err(0); |
|
3242 if( !aUseCurrentMedia ) |
|
3243 { |
|
3244 if( !aResume ) |
|
3245 { |
|
3246 TRAP( err, iTester->StartDownloadL( title, iapId, serviceId, contentId, url, syncCall, userName, password, NULL ) ); |
|
3247 } |
|
3248 else |
|
3249 { |
|
3250 TRAP( err, iTester->ResumeDownloadL( title, iapId, serviceId, contentId, url, syncCall, userName, password, NULL ) ); |
|
3251 } |
|
3252 } |
|
3253 else |
|
3254 { |
|
3255 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: passing current media to MPX plugin."); |
|
3256 if( !aResume ) |
|
3257 { |
|
3258 TRAP( err, iTester->StartDownloadL( title, iapId, serviceId, contentId, url, syncCall, userName, password, iMpxMedia ) ); |
|
3259 } |
|
3260 else |
|
3261 { |
|
3262 TRAP( err, iTester->ResumeDownloadL( title, iapId, serviceId, contentId, url, syncCall, userName, password, iMpxMedia ) ); |
|
3263 } |
|
3264 } |
|
3265 |
|
3266 // Set autoresume on if there's only one paused download. |
|
3267 CVCXMyVideosTestDlWatcher* dlWatcher = iTester->GetDownloadWatcher(); |
|
3268 if( aResume && dlWatcher && !iAutoResume ) |
|
3269 { |
|
3270 TInt pausedDlCount = 0; |
|
3271 for( TInt i=0; i<dlWatcher->GetDownloadCount(); i++ ) |
|
3272 { |
|
3273 CVCXMyVideosTestDownload* dl = dlWatcher->GetDownloadByIndex( i ); |
|
3274 if( dl->iState == EVcxMyVideosDlStatePaused ) |
|
3275 { |
|
3276 pausedDlCount++; |
|
3277 } |
|
3278 } |
|
3279 if( pausedDlCount == 1 ) |
|
3280 { |
|
3281 iAutoResume = ETrue; |
|
3282 iTester->SetAutoResume( ETrue ); |
|
3283 } |
|
3284 } |
|
3285 |
|
3286 if( err != KErrNone ) |
|
3287 { |
|
3288 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
|
3289 User::Leave( err ); |
|
3290 } |
|
3291 |
|
3292 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DownloadOrResumeL"); |
|
3293 } |
|
3294 |
|
3295 // ----------------------------------------------------------------------------- |
|
3296 // CIptvMyVideosApiTest::DownloadUrlL |
|
3297 // ----------------------------------------------------------------------------- |
|
3298 // |
|
3299 TInt CVCXMyVideosCollectionPluginTest::DownloadUrlL( CStifItemParser& aItem ) |
|
3300 { |
|
3301 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::DownloadUrlL ---------->"); |
|
3302 // Print to UI |
|
3303 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3304 _LIT( KWhere, "In DownloadUrlL" ); |
|
3305 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3306 // Print to log file |
|
3307 iLog->Log( KWhere ); |
|
3308 |
|
3309 iLastReceivedMessage = -1; |
|
3310 |
|
3311 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
3312 |
|
3313 TUint32 iapId(0); |
|
3314 TPtrC iapName; |
|
3315 User::LeaveIfError( aItem.GetNextString( iapName ) ); |
|
3316 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: iapName: %S", &iapName); |
|
3317 User::LeaveIfError( iTestCommon->GetIapIdL(iapName, iapId) ); |
|
3318 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: iapId: %d", iapId); |
|
3319 |
|
3320 TPtrC url; |
|
3321 User::LeaveIfError( aItem.GetNextString( url ) ); |
|
3322 |
|
3323 TInt syncCallInt(0); |
|
3324 User::LeaveIfError( aItem.GetNextInt( syncCallInt ) ); |
|
3325 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt); |
|
3326 TBool syncCall = static_cast<TBool>(syncCallInt); |
|
3327 |
|
3328 TPtrC userName; |
|
3329 if( KErrNone == aItem.GetNextString( userName ) ) |
|
3330 { |
|
3331 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: userName: %S", &userName); |
|
3332 } |
|
3333 else |
|
3334 { |
|
3335 userName.Set( _L("") ); |
|
3336 } |
|
3337 |
|
3338 TPtrC password; |
|
3339 if( KErrNone == aItem.GetNextString( password ) ) |
|
3340 { |
|
3341 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: password: %S", &password); |
|
3342 } |
|
3343 else |
|
3344 { |
|
3345 password.Set( _L("") ); |
|
3346 } |
|
3347 |
|
3348 if( url == KVCXTestZeroUrl) |
|
3349 { |
|
3350 url.Set( _L("" ) ); |
|
3351 } |
|
3352 |
|
3353 TInt err( KErrNone ); |
|
3354 |
|
3355 if( iTester ) |
|
3356 { |
|
3357 if( url == KVCXMYVideosTest2kURLTag ) |
|
3358 { |
|
3359 TRAP( err, iTester->StartDownloadL( _L("2kcharsurl"), iapId, 0, 0, KVCXMYVideosTest2kURL, syncCall, userName, password, NULL ) ); |
|
3360 } |
|
3361 else |
|
3362 if( url == KVCXMYVideosTest1kURLTag ) |
|
3363 { |
|
3364 TRAP( err, iTester->StartDownloadL( _L("1kcharsurl"), iapId, 0, 0, KVCXMYVideosTest1kURL, syncCall, userName, password, NULL ) ); |
|
3365 } |
|
3366 else |
|
3367 { |
|
3368 TRAP( err, iTester->StartDownloadL( _L("urldl"), iapId, 0, 0, url, syncCall, userName, password, NULL ) ); |
|
3369 } |
|
3370 } |
|
3371 |
|
3372 if( err != KErrNone ) |
|
3373 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
|
3374 |
|
3375 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DownloadUrlL <----------"); |
|
3376 return VCXMVTEST_ERR( err ); |
|
3377 } |
|
3378 |
|
3379 // ----------------------------------------------------------------------------- |
|
3380 // CIptvMyVideosApiTest::CancelDownloadL |
|
3381 // ----------------------------------------------------------------------------- |
|
3382 // |
|
3383 TInt CVCXMyVideosCollectionPluginTest::CancelDownloadL( CStifItemParser& aItem ) |
|
3384 { |
|
3385 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelDownloadL ---------->"); |
|
3386 // Print to UI |
|
3387 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3388 _LIT( KWhere, "In CancelDownloadL" ); |
|
3389 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3390 // Print to log file |
|
3391 iLog->Log( KWhere ); |
|
3392 |
|
3393 iLastReceivedMessage = -1; |
|
3394 |
|
3395 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
3396 |
|
3397 TPtrC serviceName; |
|
3398 User::LeaveIfError( aItem.GetNextString( serviceName ) ); |
|
3399 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceName: %S", &serviceName); |
|
3400 |
|
3401 TInt serviceId(0); |
|
3402 User::LeaveIfError( iServiceEmu->GetServiceIdL(serviceName, serviceId) ); |
|
3403 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceId: %d", serviceId); |
|
3404 |
|
3405 TInt contentId(0); |
|
3406 User::LeaveIfError( aItem.GetNextInt( contentId ) ); |
|
3407 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: contentId: %d", contentId); |
|
3408 |
|
3409 TInt syncCallInt(0); |
|
3410 User::LeaveIfError( aItem.GetNextInt( syncCallInt ) ); |
|
3411 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt); |
|
3412 TBool syncCall = static_cast<TBool>(syncCallInt); |
|
3413 |
|
3414 const TPtrC url = iServiceEmu->GetContentUrlL( serviceId, contentId ); |
|
3415 |
|
3416 CVCXMyVideosTestDownload* dl = iTester->GetDownloadWatcher()->GetDownload( serviceId, contentId, url ); |
|
3417 |
|
3418 TInt err( KErrNotReady ); |
|
3419 if( !dl ) |
|
3420 { |
|
3421 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: Could not find download with specified params!"); |
|
3422 } |
|
3423 else |
|
3424 if( iTester ) |
|
3425 { |
|
3426 TRAP( err, iTester->CancelDownloadL( dl, syncCall ) ); |
|
3427 } |
|
3428 |
|
3429 if( err != KErrNone ) |
|
3430 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
|
3431 |
|
3432 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelDownloadL <----------"); |
|
3433 return VCXMVTEST_ERR( err ); |
|
3434 } |
|
3435 |
|
3436 // ----------------------------------------------------------------------------- |
|
3437 // CIptvMyVideosApiTest::CancelDownloadByIdL |
|
3438 // ----------------------------------------------------------------------------- |
|
3439 // |
|
3440 TInt CVCXMyVideosCollectionPluginTest::CancelDownloadByIdL( CStifItemParser& aItem ) |
|
3441 { |
|
3442 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CancelDownloadByIdL ---------->"); |
|
3443 // Print to UI |
|
3444 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3445 _LIT( KWhere, "In CancelDownloadByIdL" ); |
|
3446 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3447 // Print to log file |
|
3448 iLog->Log( KWhere ); |
|
3449 |
|
3450 iLastReceivedMessage = -1; |
|
3451 |
|
3452 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
3453 |
|
3454 TInt mpxId(0); |
|
3455 User::LeaveIfError( aItem.GetNextInt( mpxId ) ); |
|
3456 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: mpxId: %d", mpxId); |
|
3457 |
|
3458 TInt downloadId(0); |
|
3459 User::LeaveIfError( aItem.GetNextInt( downloadId ) ); |
|
3460 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: downloadId: %d", downloadId); |
|
3461 |
|
3462 TInt syncCallInt(0); |
|
3463 User::LeaveIfError( aItem.GetNextInt( syncCallInt ) ); |
|
3464 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt); |
|
3465 TBool syncCall = static_cast<TBool>(syncCallInt); |
|
3466 |
|
3467 _LIT(KVCxTestEmptyString, "NULL"); |
|
3468 TPtrC downloadPath; |
|
3469 if( aItem.GetNextString( downloadPath ) != KErrNone ) |
|
3470 { |
|
3471 downloadPath.Set( KVCxTestEmptyString ); |
|
3472 } |
|
3473 |
|
3474 TInt err( KErrNotReady ); |
|
3475 if( iTester ) |
|
3476 { |
|
3477 TRAP( err, iTester->CancelDownloadL( mpxId, downloadId, downloadPath, syncCall ) ); |
|
3478 } |
|
3479 |
|
3480 if( err != KErrNone ) |
|
3481 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
|
3482 |
|
3483 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CancelDownloadByIdL <----------"); |
|
3484 return VCXMVTEST_ERR( err ); |
|
3485 } |
|
3486 |
|
3487 // ----------------------------------------------------------------------------- |
|
3488 // CIptvMyVideosApiTest::PauseDownloadL |
|
3489 // ----------------------------------------------------------------------------- |
|
3490 // |
|
3491 TInt CVCXMyVideosCollectionPluginTest::PauseDownloadL( CStifItemParser& aItem ) |
|
3492 { |
|
3493 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::PauseDownloadL ---------->"); |
|
3494 // Print to UI |
|
3495 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3496 _LIT( KWhere, "In PauseDownloadL" ); |
|
3497 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3498 // Print to log file |
|
3499 iLog->Log( KWhere ); |
|
3500 |
|
3501 iLastReceivedMessage = -1; |
|
3502 |
|
3503 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
3504 |
|
3505 TPtrC serviceName; |
|
3506 User::LeaveIfError( aItem.GetNextString( serviceName ) ); |
|
3507 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceName: %S", &serviceName); |
|
3508 |
|
3509 TInt serviceId(0); |
|
3510 User::LeaveIfError( iServiceEmu->GetServiceIdL(serviceName, serviceId) ); |
|
3511 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceId: %d", serviceId); |
|
3512 |
|
3513 TInt contentId(0); |
|
3514 User::LeaveIfError( aItem.GetNextInt( contentId ) ); |
|
3515 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: contentId: %d", contentId); |
|
3516 |
|
3517 TInt syncCallInt(0); |
|
3518 User::LeaveIfError( aItem.GetNextInt( syncCallInt ) ); |
|
3519 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: callTypeInt: %d", syncCallInt); |
|
3520 TBool syncCall = static_cast<TBool>(syncCallInt); |
|
3521 |
|
3522 const TPtrC url = iServiceEmu->GetContentUrlL( serviceId, contentId ); |
|
3523 |
|
3524 TInt err( KErrNotReady ); |
|
3525 if( iTester ) |
|
3526 { |
|
3527 // Disable autoresume |
|
3528 iAutoResume = EFalse; |
|
3529 iTester->SetAutoResume( iAutoResume ); |
|
3530 |
|
3531 TRAP( err, iTester->PauseDownloadL( serviceId, contentId, url, syncCall ) ); |
|
3532 } |
|
3533 |
|
3534 if( err != KErrNone ) |
|
3535 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
|
3536 |
|
3537 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::PauseDownloadL <----------"); |
|
3538 return VCXMVTEST_ERR( err ); |
|
3539 } |
|
3540 |
|
3541 // ----------------------------------------------------------------------------- |
|
3542 // CIptvMyVideosApiTest::PauseDownloadByUrlL |
|
3543 // ----------------------------------------------------------------------------- |
|
3544 // |
|
3545 TInt CVCXMyVideosCollectionPluginTest::PauseDownloadByUrlL( CStifItemParser& aItem ) |
|
3546 { |
|
3547 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::PauseDownloadByUrlL ---------->"); |
|
3548 // Print to UI |
|
3549 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3550 _LIT( KWhere, "In PauseDownloadByUrlL" ); |
|
3551 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3552 // Print to log file |
|
3553 iLog->Log( KWhere ); |
|
3554 |
|
3555 iLastReceivedMessage = -1; |
|
3556 |
|
3557 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
3558 |
|
3559 TPtrC url; |
|
3560 User::LeaveIfError( aItem.GetNextString( url ) ); |
|
3561 |
|
3562 TInt err( KErrNotReady ); |
|
3563 if( iTester ) |
|
3564 { |
|
3565 // Disable autoresume |
|
3566 iAutoResume = EFalse; |
|
3567 iTester->SetAutoResume( iAutoResume ); |
|
3568 |
|
3569 TRAP( err, iTester->PauseDownloadL( url, EFalse ) ); |
|
3570 } |
|
3571 |
|
3572 if( err != KErrNone ) |
|
3573 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: err: %d", err); |
|
3574 |
|
3575 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::PauseDownloadL <----------"); |
|
3576 return VCXMVTEST_ERR( err ); |
|
3577 } |
|
3578 |
|
3579 // ----------------------------------------------------------------------------- |
|
3580 // CIptvMyVideosApiTest::CheckDownloadProgressL |
|
3581 // ----------------------------------------------------------------------------- |
|
3582 // |
|
3583 TInt CVCXMyVideosCollectionPluginTest::CheckDownloadProgressL( CStifItemParser& aItem ) |
|
3584 { |
|
3585 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckDownloadProgressL ---------->"); |
|
3586 // Print to UI |
|
3587 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3588 _LIT( KWhere, "In CheckDownloadProgressL" ); |
|
3589 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3590 // Print to log file |
|
3591 iLog->Log( KWhere ); |
|
3592 |
|
3593 iLastReceivedMessage = -1; |
|
3594 |
|
3595 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
|
3596 |
|
3597 TPtrC serviceName; |
|
3598 User::LeaveIfError( aItem.GetNextString( serviceName ) ); |
|
3599 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceName: %S", &serviceName); |
|
3600 |
|
3601 TInt serviceId(0); |
|
3602 User::LeaveIfError( iServiceEmu->GetServiceIdL(serviceName, serviceId) ); |
|
3603 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: serviceId: %d", serviceId); |
|
3604 |
|
3605 TInt contentId(0); |
|
3606 User::LeaveIfError( aItem.GetNextInt( contentId ) ); |
|
3607 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: contentId: %d", contentId); |
|
3608 |
|
3609 TInt minimumProgress( 0 ); |
|
3610 User::LeaveIfError( aItem.GetNextInt( minimumProgress ) ); |
|
3611 |
|
3612 const TPtrC url = iServiceEmu->GetContentUrlL( serviceId, contentId ); |
|
3613 |
|
3614 CVCXMyVideosTestDlWatcher* dlWatcher = iTester->GetDownloadWatcher(); |
|
3615 |
|
3616 TInt err( KErrNotReady ); |
|
3617 |
|
3618 if( dlWatcher ) |
|
3619 { |
|
3620 CVCXMyVideosTestDownload* dl = dlWatcher->GetDownload( serviceId, contentId, url ); |
|
3621 |
|
3622 if( dl ) |
|
3623 { |
|
3624 if( dl->iProgress < minimumProgress ) |
|
3625 { |
|
3626 err = KErrCorrupt; |
|
3627 } |
|
3628 else |
|
3629 { |
|
3630 err = KErrNone; |
|
3631 } |
|
3632 } |
|
3633 } |
|
3634 |
|
3635 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckDownloadProgressL <----------"); |
|
3636 return VCXMVTEST_ERR( err ); |
|
3637 } |
|
3638 |
|
3639 // ----------------------------------------------------------------------------- |
|
3640 // CIptvMyVideosApiTest::WaitAllDownloadsL |
|
3641 // ----------------------------------------------------------------------------- |
|
3642 // |
|
3643 TInt CVCXMyVideosCollectionPluginTest::WaitAllDownloadsL( CStifItemParser& aItem ) |
|
3644 { |
|
3645 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitAllDownloadsL ---------->"); |
|
3646 // Print to UI |
|
3647 _LIT( KVCXMyVideosCollectionPluginTest, "VCXMyVideosCollectionPluginTest" ); |
|
3648 _LIT( KWhere, "In WaitAllDownloadsL" ); |
|
3649 TestModuleIf().Printf( 0, KVCXMyVideosCollectionPluginTest, KWhere ); |
|
3650 // Print to log file |
|
3651 iLog->Log( KWhere ); |
|
3652 |
|
3653 TInt err( KErrNone ); |
|
3654 |
|
3655 TInt minutes(0); |
|
3656 if( aItem.GetNextInt( minutes ) != KErrNone ) |
|
3657 { |
|
3658 minutes = 10; |
|
3659 } |
|
3660 iTimeoutTimer->After( KTimeoutMinute * minutes ); |
|
3661 |
|
3662 iWaitingForAllDownloads = ETrue; |
|
3663 |
|
3664 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitAllDownloadsL <----------"); |
|
3665 return VCXMVTEST_ERR( err ); |
|
3666 } |
|
3667 |
|
3668 // ----------------------------------------------------------------------------- |
|
3669 // CIptvMyVideosApiTest::WaitForMessageL |
|
3670 // ----------------------------------------------------------------------------- |
3262 // ----------------------------------------------------------------------------- |
3671 // |
3263 // |
3672 TInt CVCXMyVideosCollectionPluginTest::WaitForMessageL( CStifItemParser& aItem ) |
3264 TInt CVCXMyVideosCollectionPluginTest::WaitForMessageL( CStifItemParser& aItem ) |
3673 { |
3265 { |
3674 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForMessageL ---------->"); |
3266 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForMessageL ---------->"); |
3705 TRAPD( err, WaitForMessagesL( EFalse, messages, timeout, ETrue ) ); |
3297 TRAPD( err, WaitForMessagesL( EFalse, messages, timeout, ETrue ) ); |
3706 |
3298 |
3707 messages.Reset(); |
3299 messages.Reset(); |
3708 |
3300 |
3709 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForMessageL <----------"); |
3301 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForMessageL <----------"); |
3710 return VCXMVTEST_ERR( err ); |
3302 return err; |
3711 } |
3303 } |
3712 |
3304 |
3713 // ----------------------------------------------------------------------------- |
3305 // ----------------------------------------------------------------------------- |
3714 // CIptvMyVideosApiTest::WaitForAnyMessageL |
3306 // CVcxMyVideosApiTest::WaitForAnyMessageL |
3715 // ----------------------------------------------------------------------------- |
3307 // ----------------------------------------------------------------------------- |
3716 // |
3308 // |
3717 TInt CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL( CStifItemParser& aItem ) |
3309 TInt CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL( CStifItemParser& aItem ) |
3718 { |
3310 { |
3719 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL ---------->"); |
3311 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL ---------->"); |
3752 } |
3344 } |
3753 |
3345 |
3754 messages.Reset(); |
3346 messages.Reset(); |
3755 |
3347 |
3756 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL <----------"); |
3348 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForAnyMessageL <----------"); |
3757 return VCXMVTEST_ERR( error ); |
3349 return error; |
3758 } |
3350 } |
3759 |
3351 |
3760 // ----------------------------------------------------------------------------- |
3352 // ----------------------------------------------------------------------------- |
3761 // CIptvMyVideosApiTest::WaitForMessagesL |
3353 // CVcxMyVideosApiTest::WaitForMessagesL |
3762 // ----------------------------------------------------------------------------- |
3354 // ----------------------------------------------------------------------------- |
3763 // |
3355 // |
3764 TInt CVCXMyVideosCollectionPluginTest::WaitForMessagesL( CStifItemParser& aItem ) |
3356 TInt CVCXMyVideosCollectionPluginTest::WaitForMessagesL( CStifItemParser& aItem ) |
3765 { |
3357 { |
3766 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForMessagesL ---------->"); |
3358 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::WaitForMessagesL ---------->"); |
3799 } |
3391 } |
3800 |
3392 |
3801 messages.Reset(); |
3393 messages.Reset(); |
3802 |
3394 |
3803 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForMessagesL <----------"); |
3395 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::WaitForMessagesL <----------"); |
3804 return VCXMVTEST_ERR( error ); |
3396 return error; |
3805 } |
3397 } |
3806 |
3398 |
3807 // ----------------------------------------------------------------------------- |
3399 // ----------------------------------------------------------------------------- |
3808 // CIptvMyVideosApiTest::WaitForMessagesL |
3400 // CVcxMyVideosApiTest::WaitForMessagesL |
3809 // ----------------------------------------------------------------------------- |
3401 // ----------------------------------------------------------------------------- |
3810 // |
3402 // |
3811 void CVCXMyVideosCollectionPluginTest::WaitForMessagesL( TBool aBlock, RArray<TInt>& aMessages, TInt aTimeout, |
3403 void CVCXMyVideosCollectionPluginTest::WaitForMessagesL( TBool aBlock, RArray<TInt>& aMessages, TInt aTimeout, |
3812 TBool aWaitAll ) |
3404 TBool aWaitAll ) |
3813 { |
3405 { |
3886 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteDirectoryIfEmpty"); |
3478 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::DeleteDirectoryIfEmpty"); |
3887 return KErrNone; |
3479 return KErrNone; |
3888 } |
3480 } |
3889 |
3481 |
3890 // ----------------------------------------------------------------------------- |
3482 // ----------------------------------------------------------------------------- |
3891 // CIptvMyVideosApiTest::MapMpxMediaAttribute |
3483 // CVcxMyVideosApiTest::MapMpxMediaAttribute |
3892 // ----------------------------------------------------------------------------- |
3484 // ----------------------------------------------------------------------------- |
3893 // |
3485 // |
3894 TInt CVCXMyVideosCollectionPluginTest::MapMpxMediaAttribute( |
3486 TInt CVCXMyVideosCollectionPluginTest::MapMpxMediaAttribute( |
3895 TVcxTestMediaAttributeIdMapping aMapping, TMPXAttributeData& aAttribute, TVcxTestMediaAttributeType& aType ) |
3487 TVcxTestMediaAttributeIdMapping aMapping, TMPXAttributeData& aAttribute, TVcxTestMediaAttributeType& aType ) |
3896 { |
3488 { |
4151 { |
3743 { |
4152 err = KErrNotFound; |
3744 err = KErrNotFound; |
4153 } |
3745 } |
4154 |
3746 |
4155 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MapMpxMediaAttribute"); |
3747 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::MapMpxMediaAttribute"); |
4156 return VCXMVTEST_ERR( err ); |
3748 return err; |
4157 } |
3749 } |
4158 |
3750 |
4159 // ----------------------------------------------------------------------------- |
3751 // ----------------------------------------------------------------------------- |
4160 // CIptvMyVideosApiTest::GetMessageDesc |
3752 // CVcxMyVideosApiTest::GetMessageDesc |
4161 // ----------------------------------------------------------------------------- |
3753 // ----------------------------------------------------------------------------- |
4162 // |
3754 // |
4163 void CVCXMyVideosCollectionPluginTest::GetMessageDesc( TInt aMessage, TDes& aMsgBuff ) |
3755 void CVCXMyVideosCollectionPluginTest::GetMessageDesc( TInt aMessage, TDes& aMsgBuff ) |
4164 { |
3756 { |
4165 switch( aMessage ) |
3757 switch( aMessage ) |
4268 case KVCXMYVideosTestMessageCollectionGeneral: |
3860 case KVCXMYVideosTestMessageCollectionGeneral: |
4269 { |
3861 { |
4270 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionGeneral") ); |
3862 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionGeneral") ); |
4271 } |
3863 } |
4272 break; |
3864 break; |
4273 case KVCXMYVideosTestMessageCollectionItemChanged: |
3865 case KVCXMYVideosTestMessageMpxVideoInserted: |
4274 { |
3866 { |
4275 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionItemChanged") ); |
3867 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxVideoInserted") ); |
4276 } |
3868 } |
4277 break; |
3869 break; |
4278 case KVCXMYVideosTestMessageCollectionCategoryChanged: |
3870 case KVCXMYVideosTestMessageMpxCategoryInserted: |
4279 { |
3871 { |
4280 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageCollectionCategoryChanged") ); |
3872 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxCategoryInserted") ); |
4281 } |
3873 } |
4282 break; |
3874 break; |
4283 case KVCXMYVideosTestMessageMpxItemInserted: |
3875 case KVCXMYVideosTestMessageMpxAlbumInserted: |
4284 { |
3876 { |
4285 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxItemInserted") ); |
3877 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxAlbumInserted") ); |
4286 } |
3878 } |
4287 break; |
3879 break; |
4288 case KVCXMYVideosTestMessageMpxItemDeleted: |
3880 case KVCXMYVideosTestMessageMpxVideoDeleted: |
4289 { |
3881 { |
4290 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxItemDeleted") ); |
3882 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxVideoDeleted") ); |
4291 } |
3883 } |
4292 break; |
3884 break; |
4293 case KVCXMYVideosTestMessageMpxItemModified: |
3885 case KVCXMYVideosTestMessageMpxCategoryDeleted: |
4294 { |
3886 { |
4295 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxItemModified") ); |
3887 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxCategoryDeleted") ); |
3888 } |
|
3889 break; |
|
3890 case KVCXMYVideosTestMessageMpxAlbumDeleted: |
|
3891 { |
|
3892 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxAlbumDeleted") ); |
|
3893 } |
|
3894 break; |
|
3895 case KVCXMYVideosTestMessageMpxVideoModified: |
|
3896 { |
|
3897 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxVideoModified") ); |
|
3898 } |
|
3899 break; |
|
3900 case KVCXMYVideosTestMessageMpxCategoryModified: |
|
3901 { |
|
3902 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxCategoryModified") ); |
|
3903 } |
|
3904 break; |
|
3905 case KVCXMYVideosTestMessageMpxAlbumModified: |
|
3906 { |
|
3907 aMsgBuff.Copy( _L("KVCXMYVideosTestMessageMpxAlbumModified") ); |
|
4296 } |
3908 } |
4297 break; |
3909 break; |
4298 case KVCXMyVideosTestMessageVideoListOrderChanged: |
3910 case KVCXMyVideosTestMessageVideoListOrderChanged: |
4299 { |
3911 { |
4300 aMsgBuff.Copy( _L("KVCXMyVideosTestMessageVideoListOrderChanged") ); |
3912 aMsgBuff.Copy( _L("KVCXMyVideosTestMessageVideoListOrderChanged") ); |
4319 |
3931 |
4320 } |
3932 } |
4321 } |
3933 } |
4322 |
3934 |
4323 // ----------------------------------------------------------------------------- |
3935 // ----------------------------------------------------------------------------- |
4324 // CIptvMyVideosApiTest::CheckMediasL |
3936 // CVcxMyVideosApiTest::CheckMediasL |
4325 // ----------------------------------------------------------------------------- |
3937 // ----------------------------------------------------------------------------- |
4326 // |
3938 // |
4327 void CVCXMyVideosCollectionPluginTest::CheckMediasL( TInt aExpectedVideoCount, TInt aDrive, TInt aCheckType ) |
3939 void CVCXMyVideosCollectionPluginTest::CheckMediasL( TInt aExpectedVideoCount, TInt aDrive, TInt aCheckType ) |
4328 { |
3940 { |
4329 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMediasL"); |
3941 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::CheckMediasL"); |
4330 |
3942 |
3943 WaitForRefreshL( false ); |
|
3944 |
|
4331 TInt actualVideoCount(0); |
3945 TInt actualVideoCount(0); |
4332 |
3946 |
4333 // File check |
3947 // File check |
4334 TInt videoCount = iTester->GetMediaCount(); |
3948 TInt videoCount = iTester->GetMediaCount(); |
4335 |
3949 |
4357 } |
3971 } |
4358 } |
3972 } |
4359 |
3973 |
4360 actualVideoCount++; |
3974 actualVideoCount++; |
4361 |
3975 |
4362 TInt state = -1; |
3976 if( !iFileCheckDisabled ) |
4363 if( media->IsSupported( KVcxMediaMyVideosDownloadState ) ) |
|
4364 { |
|
4365 state = media->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState ); |
|
4366 } |
|
4367 |
|
4368 TUint32 downloadId = 0; |
|
4369 if( media->IsSupported( KVcxMediaMyVideosDownloadId ) ) |
|
4370 { |
|
4371 downloadId = media->ValueTObjectL<TUint32>( KVcxMediaMyVideosDownloadId ); |
|
4372 } |
|
4373 |
|
4374 // No file check for ongoing downloads |
|
4375 if( !iFileCheckDisabled && ( downloadId == 0 || state == EVcxMyVideosDlStateDownloaded ) ) |
|
4376 { |
3977 { |
4377 if( !iFs.IsValidName( localFilePath ) ) |
3978 if( !iFs.IsValidName( localFilePath ) ) |
4378 { |
3979 { |
4379 VCXLOGLO1("CVCXMyVideosCollectionPluginTest: ERROR. File path is not valid."); |
3980 VCXLOGLO1("CVCXMyVideosCollectionPluginTest: ERROR. File path is not valid."); |
4380 VCXLOGLO2("Local file path: %S", &localFilePath); |
3981 VCXLOGLO2("Local file path: %S", &localFilePath); |
4447 |
4048 |
4448 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediasL"); |
4049 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::CheckMediasL"); |
4449 } |
4050 } |
4450 |
4051 |
4451 // ----------------------------------------------------------------------------- |
4052 // ----------------------------------------------------------------------------- |
4452 // CIptvMyVideosApiTest::GetDriveParam |
4053 // CVcxMyVideosApiTest::GetDriveParam |
4453 // ----------------------------------------------------------------------------- |
4054 // ----------------------------------------------------------------------------- |
4454 // |
4055 // |
4455 TInt CVCXMyVideosCollectionPluginTest::GetDriveParam( CStifItemParser& aItem, TInt& aDrive ) |
4056 TInt CVCXMyVideosCollectionPluginTest::GetDriveParam( CStifItemParser& aItem, TInt& aDrive ) |
4456 { |
4057 { |
4457 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
4058 aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); |
4469 err = iFs.CharToDrive( driveLetter[0], aDrive ); |
4070 err = iFs.CharToDrive( driveLetter[0], aDrive ); |
4470 VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: drive: %S = %d", &driveLetter, aDrive ); |
4071 VCXLOGLO3("CVCXMyVideosCollectionPluginTest:: drive: %S = %d", &driveLetter, aDrive ); |
4471 } |
4072 } |
4472 } |
4073 } |
4473 |
4074 |
4474 return VCXMVTEST_ERR( err ); |
4075 return err; |
4475 } |
4076 } |
4476 |
4077 |
4477 // ----------------------------------------------------------------------------- |
4078 // ----------------------------------------------------------------------------- |
4478 // CIptvMyVideosApiTest::DoTotalRefreshL |
4079 // CVcxMyVideosApiTest::DoTotalRefreshL |
4479 // ----------------------------------------------------------------------------- |
4080 // ----------------------------------------------------------------------------- |
4480 // |
4081 // |
4481 void CVCXMyVideosCollectionPluginTest::DoTotalRefreshL() |
4082 void CVCXMyVideosCollectionPluginTest::DoTotalRefreshL() |
4482 { |
4083 { |
4483 if( iTester && iTester->GetCurrentLevel() == 3 ) |
4084 if( iTester && iTester->GetCurrentLevel() == 3 ) |
4509 } |
4110 } |
4510 } |
4111 } |
4511 } |
4112 } |
4512 |
4113 |
4513 // ----------------------------------------------------------------------------- |
4114 // ----------------------------------------------------------------------------- |
4514 // CIptvMyVideosApiTest::WaitForRefreshL |
4115 // CVcxMyVideosApiTest::WaitForRefreshL |
4515 // ----------------------------------------------------------------------------- |
4116 // ----------------------------------------------------------------------------- |
4516 // |
4117 // |
4517 void CVCXMyVideosCollectionPluginTest::WaitForRefreshL( TBool aForcedWait ) |
4118 void CVCXMyVideosCollectionPluginTest::WaitForRefreshL( TBool aForcedWait ) |
4518 { |
4119 { |
4519 if( iTester && ( iTester->IsRefreshing() || aForcedWait ) ) |
4120 if( iTester && ( iTester->IsRefreshing() || aForcedWait ) ) |
4525 CleanupStack::PopAndDestroy( &messages ); |
4126 CleanupStack::PopAndDestroy( &messages ); |
4526 } |
4127 } |
4527 } |
4128 } |
4528 |
4129 |
4529 // ----------------------------------------------------------------------------- |
4130 // ----------------------------------------------------------------------------- |
4530 // CIptvMyVideosApiTest::GetMediasForLevelL |
4131 // CVcxMyVideosApiTest::GetMediasForLevelL |
4531 // ----------------------------------------------------------------------------- |
4132 // ----------------------------------------------------------------------------- |
4532 // |
4133 // |
4533 CMPXMediaArray* CVCXMyVideosCollectionPluginTest::GetMediasForLevelL( TInt aLevel, TUint aFlagsFilter ) |
4134 CMPXMediaArray* CVCXMyVideosCollectionPluginTest::GetMediasForLevelL( TInt aLevel, TUint aFlagsFilter ) |
4534 { |
4135 { |
4535 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::GetMediasForLevelL ---------->"); |
4136 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::GetMediasForLevelL ---------->"); |
4632 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediasForLevelL <----------"); |
4233 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::GetMediasForLevelL <----------"); |
4633 return medias; |
4234 return medias; |
4634 } |
4235 } |
4635 |
4236 |
4636 // ----------------------------------------------------------------------------- |
4237 // ----------------------------------------------------------------------------- |
4637 // CIptvMyVideosApiTest::HandleVcxMvTesterMessageL |
4238 // CVcxMyVideosApiTest::HandleVcxMvTesterMessageL |
4638 // ----------------------------------------------------------------------------- |
4239 // ----------------------------------------------------------------------------- |
4639 // |
4240 // |
4640 void CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL( TInt aMessage, TInt aError ) |
4241 void CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL( TInt aMessage, TInt aError ) |
4641 { |
4242 { |
4642 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL"); |
4243 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL"); |
4661 if( aMessage == KVCXMYVideosTestMessageCollectionOpened || |
4262 if( aMessage == KVCXMYVideosTestMessageCollectionOpened || |
4662 aMessage == KVCXMYVideosTestMessageListComplete || |
4263 aMessage == KVCXMYVideosTestMessageListComplete || |
4663 aMessage == KVCXMYVideosTestMessageCollectionOpened || |
4264 aMessage == KVCXMYVideosTestMessageCollectionOpened || |
4664 aMessage == KVCXMYVideosTestMessageGotMediasByKMpxId ) |
4265 aMessage == KVCXMYVideosTestMessageGotMediasByKMpxId ) |
4665 { |
4266 { |
4666 _LIT(KWhat, "VidCount"); |
|
4667 _LIT(KDesc, "%d"); |
|
4668 TInt videoCount = iTester->GetMediaCount(); |
4267 TInt videoCount = iTester->GetMediaCount(); |
4669 TestModuleIf().Printf( 0, KWhat, KDesc, videoCount ); |
4268 if( iTester->GetCurrentOpenLevelIndex() == -1 ) |
4670 } |
4269 { |
4671 |
4270 TestModuleIf().Printf( 0, _L("Mv"), _L("CatCount %d"), videoCount ); |
4271 } |
|
4272 else |
|
4273 { |
|
4274 TestModuleIf().Printf( 0, _L("Mv"), _L("VidCount %d"), videoCount ); |
|
4275 } |
|
4276 } |
|
4672 |
4277 |
4673 // Waiting for messages from mpx plugin to stop. |
4278 // Waiting for messages from mpx plugin to stop. |
4674 if( iCoolDownWait ) |
4279 if( iCoolDownWait ) |
4675 { |
4280 { |
4676 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: MsgQueue: Cooling down."); |
4281 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: MsgQueue: Cooling down."); |
4677 iCoolDownTimer->After( KTimeoutSecond * 5 ); |
4282 iCoolDownTimer->After( KTimeoutSecond * 5 ); |
4678 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL"); |
4283 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL"); |
4679 return; |
4284 return; |
4680 } |
4285 } |
4681 |
|
4682 if( aMessage == KVCXMYVideosTestMessageDlSucceeded || |
|
4683 aMessage == KVCXMYVideosTestMessageDlFailed || |
|
4684 aMessage == KVCXMYVideosTestMessageDlPaused || |
|
4685 aMessage == KVCXMYVideosTestMessageDlGeneral || |
|
4686 aMessage == KVCXMYVideosTestErrorDownloadNotFound ) |
|
4687 { |
|
4688 TInt activeDownloads = iTester->GetActiveDownloadCountL(); |
|
4689 TInt downloads = iTester->GetDownloadWatcher()->GetDownloadCount(); |
|
4690 _LIT(KWhat, "Downloads"); |
|
4691 _LIT(KDesc, "%d/%d"); |
|
4692 TestModuleIf().Printf( 0, KWhat, KDesc, activeDownloads, downloads ); |
|
4693 |
|
4694 if( aError != KErrNone ) |
|
4695 { |
|
4696 iLastDownloadError = aError; |
|
4697 } |
|
4698 } |
|
4699 |
|
4700 // Inform script of paused download when auto resume is off. |
|
4701 if( !iWaitingForAllDownloads && aMessage == KVCXMYVideosTestMessageDlPaused && !iAutoResume ) |
|
4702 { |
|
4703 // Add message to waited list and continue processing, check for signaling is done later. |
|
4704 iWaitedTestMessages.Reset(); |
|
4705 iWaitedTestMessages.AppendL( aMessage ); |
|
4706 } |
|
4707 |
|
4708 // Waiting for all downloads to complete. Check downloads and signal if needed. |
|
4709 if( iWaitingForAllDownloads ) |
|
4710 { |
|
4711 TInt activeDownloads = iTester->GetActiveDownloadCountL(); |
|
4712 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: Ongoing download count: %d", activeDownloads); |
|
4713 |
|
4714 if( activeDownloads <= 0 ) |
|
4715 { |
|
4716 iTimeoutTimer->CancelTimer(); |
|
4717 iWaitingForAllDownloads = EFalse; |
|
4718 |
|
4719 TInt downloadCount = iTester->GetDownloadWatcher()->GetDownloadCount(); |
|
4720 TInt maxFailsToSucceed = downloadCount / 3; |
|
4721 TInt fails = iTester->GetDownloadWatcher()->GetFailedDownloadCount(); |
|
4722 |
|
4723 if( maxFailsToSucceed <= 0 ) |
|
4724 { |
|
4725 maxFailsToSucceed = 0; |
|
4726 } |
|
4727 |
|
4728 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: download count: %d", downloadCount); |
|
4729 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: failed download count: %d", fails); |
|
4730 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: max allowed fails: %d", maxFailsToSucceed); |
|
4731 |
|
4732 if( fails > maxFailsToSucceed ) |
|
4733 { |
|
4734 if( iLastDownloadError != KErrNone ) |
|
4735 { |
|
4736 iEventError = iLastDownloadError; |
|
4737 } |
|
4738 else |
|
4739 { |
|
4740 iEventError = KVCXMYVideosTestMessageDlFailed; |
|
4741 } |
|
4742 } |
|
4743 else |
|
4744 { |
|
4745 iEventError = KErrNone; |
|
4746 } |
|
4747 |
|
4748 // Add message to waited list and continue processing, check for signaling is done later. |
|
4749 iWaitedTestMessages.Reset(); |
|
4750 iWaitedTestMessages.AppendL( aMessage ); |
|
4751 } |
|
4752 } |
|
4753 |
4286 |
4754 // See if there's cancel needed for move, copy or delete. |
4287 // See if there's cancel needed for move, copy or delete. |
4755 if( aError == KErrNone && iCancelNextOperation ) |
4288 if( aError == KErrNone && iCancelNextOperation ) |
4756 { |
4289 { |
4757 if( aMessage == KVCXMYVideosTestMessageCopyOrMoveStarted ) |
4290 if( aMessage == KVCXMYVideosTestMessageCopyOrMoveStarted ) |
4765 iCancelNextOperation = EFalse; |
4298 iCancelNextOperation = EFalse; |
4766 } |
4299 } |
4767 } |
4300 } |
4768 |
4301 |
4769 // Check for errors. |
4302 // Check for errors. |
4770 if( aError != KErrNone && !iWaitingForAllDownloads ) |
4303 if( aError != KErrNone ) |
4771 { |
4304 { |
4772 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); |
4305 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); |
4773 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Error: %d <----------", aError); |
4306 VCXLOGLO2("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Error: %d <----------", aError); |
4774 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); |
4307 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); |
4775 |
4308 |
4776 iLastReceivedMessage = 0; |
4309 iLastReceivedMessage = 0; |
4777 if( !iMessageWaitIsBlocking ) |
4310 if( !iMessageWaitIsBlocking ) |
4778 { |
4311 { |
4779 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Signaling <----------"); |
4312 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Signaling <----------"); |
4780 Signal( VCXMVTEST_ERR( aError ) ); |
4313 Signal( aError ); |
4781 TestModuleIf().Printf( 0, _L("Signal"), _L("%d"), aError ); |
4314 TestModuleIf().Printf( 0, _L("Signal"), _L("%d"), aError ); |
4782 iEventError = KErrNone; |
4315 iEventError = KErrNone; |
4783 } |
4316 } |
4784 else |
4317 else |
4785 { |
4318 { |
4844 } |
4377 } |
4845 |
4378 |
4846 if( !iMessageWaitIsBlocking ) |
4379 if( !iMessageWaitIsBlocking ) |
4847 { |
4380 { |
4848 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Signaling <----------"); |
4381 VCXLOGLO1("CVCXMyVideosCollectionPluginTest:: ----------> MsgQueue: Signaling <----------"); |
4849 Signal( VCXMVTEST_ERR( iEventError ) ); |
4382 Signal( iEventError ); |
4850 TestModuleIf().Printf( 0, _L("Signal"), _L("%d"), iEventError ); |
4383 TestModuleIf().Printf( 0, _L("Signal"), _L("%d"), iEventError ); |
4851 iEventError = KErrNone; |
4384 iEventError = KErrNone; |
4852 } |
4385 } |
4853 else |
4386 else |
4854 { |
4387 { |
4865 |
4398 |
4866 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL"); |
4399 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTest::HandleVcxMvTesterMessageL"); |
4867 } |
4400 } |
4868 |
4401 |
4869 // ----------------------------------------------------------------------------- |
4402 // ----------------------------------------------------------------------------- |
4870 // CIptvEpgEngineTest::TimerComplete |
4403 // CVcxEpgEngineTest::TimerComplete |
4871 // ----------------------------------------------------------------------------- |
4404 // ----------------------------------------------------------------------------- |
4872 // |
4405 // |
4873 void CVCXMyVideosCollectionPluginTest::TimerComplete(TInt aTimerId, TInt aError) |
4406 void CVCXMyVideosCollectionPluginTest::TimerComplete(TInt aTimerId, TInt aError) |
4874 { |
4407 { |
4875 if( aTimerId == 0 ) |
4408 if( aTimerId == 0 ) |
4886 |
4419 |
4887 // Script is waiting for signal. |
4420 // Script is waiting for signal. |
4888 if( !iMessageWaitIsBlocking ) |
4421 if( !iMessageWaitIsBlocking ) |
4889 { |
4422 { |
4890 VCXLOGLO2( "CVCXMyVideosCollectionPluginTest:: Signaling: %d", iEventError); |
4423 VCXLOGLO2( "CVCXMyVideosCollectionPluginTest:: Signaling: %d", iEventError); |
4891 Signal( VCXMVTEST_ERR( iEventError ) ); |
4424 Signal( iEventError ); |
4892 } |
4425 } |
4893 |
|
4894 TRAP_IGNORE( iStats->ActionEndL( 0, iEventError ) ); |
|
4895 |
|
4896 TestModuleIf().Printf( 0, _L("Timedout"), _L("%d"), iEventError ); |
4426 TestModuleIf().Printf( 0, _L("Timedout"), _L("%d"), iEventError ); |
4897 } |
4427 } |
4898 } |
4428 } |
4899 |
4429 |
4900 if( aTimerId == 1 ) |
4430 if( aTimerId == 1 ) |
4901 { |
4431 { |
4902 VCXLOGLO1("CVCXMyVideosCollectionPluginTest::TimerComplete: Cooldown done. ------->"); |
4432 VCXLOGLO1("CVCXMyVideosCollectionPluginTest::TimerComplete: Cooldown done. ------->"); |
4903 iActiveWait->Stop(); |
4433 iActiveWait->Stop(); |
4904 iCoolDownWait = EFalse; |
4434 iCoolDownWait = EFalse; |
4905 |
4435 |
4906 iWaitingForAllDownloads = EFalse; |
|
4907 iWaitedTestMessages.Reset(); |
4436 iWaitedTestMessages.Reset(); |
4908 iLastReceivedMessage = 0; |
4437 iLastReceivedMessage = 0; |
4909 } |
4438 } |
4910 } |
4439 } |
4911 |
4440 |