# HG changeset patch # User brendand # Date 1260186050 0 # Node ID 08dbc9b99fd28761364109486d416ba6b44ed09d # Parent a7d4e0bb1362bddfe8ebb1ce41dddb4615666893 Test: Add MediaMgmt smoke tests (not being built or run ATM) diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/Bmarm/MediaMgmtSmokeTestModuleU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/Bmarm/MediaMgmtSmokeTestModuleU.DEF Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/Bwins/MediaMgmtSmokeTestModuleU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/Bwins/MediaMgmtSmokeTestModuleU.DEF Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/EABI/MediaMgmtSmokeTestModuleU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/EABI/MediaMgmtSmokeTestModuleU.def Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/conf/MediaMgmtSmokeTestModule.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/conf/MediaMgmtSmokeTestModule.cfg Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,14 @@ +[Test] +title Fetch Images +run testscripter c:\smoketest\UI_MediaMgmtSmokeTestModule.cfg 1 +[Endtest] + +[Test] +title Fetch Audio +run testscripter c:\smoketest\UI_MediaMgmtSmokeTestModule.cfg 2 +[Endtest] + +[Test] +title Fetch Video +run testscripter c:\smoketest\UI_MediaMgmtSmokeTestModule.cfg 3 +[Endtest] diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/conf/UI_MediaMgmtSmokeTestModule.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/conf/UI_MediaMgmtSmokeTestModule.cfg Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,29 @@ +[Test] +title Fetch Images +create MediaMgmtSmoketestModule mediamgmt +bringtoforeground +mediamgmt ListMediaItems Images pa ra me ters +pause 7000 +presskey global EKeyDevice0 +delete mediamgmt +[Endtest] + +[Test] +title Fetch Audio +create MediaMgmtSmoketestModule mediamgmt +bringtoforeground +mediamgmt ListMediaItems Audio pa ra me ters +pause 7000 +presskey global EKeyDevice0 +delete mediamgmt +[Endtest] + +[Test] +title Fetch Video +create MediaMgmtSmoketestModule mediamgmt +bringtoforeground +mediamgmt ListMediaItems Video pa ra me ters +pause 7000 +presskey global EKeyDevice0 +delete mediamgmt +[Endtest] \ No newline at end of file diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/group/Bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/group/Bld.inf Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS MARM so you can ignore this if you just build these + + DEFAULT + +PRJ_TESTEXPORTS +// NOTE: If using ARS requirements all export operations should be done under this. +// 'abld test export' + + ../conf/MediaMgmtSmokeTestModule.cfg c:/smoketest/MediaMgmtSmokeTestModule.cfg + ../conf/UI_MediaMgmtSmokeTestModule.cfg c:/smoketest/UI_MediaMgmtSmokeTestModule.cfg + +PRJ_TESTMMPFILES + + MediaMgmtSmokeTestModule.mmp + +// Specify the .mmp files required for building the important component +// releasables. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released. Specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +\agnmodel\group\agnmodel.mmp +#if defined(MARM) +\agnmodel\group\agsvexe.mmp +#endif +*/ + +// End of File diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/group/MediaMgmtSmokeTestModule.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/group/MediaMgmtSmokeTestModule.mmp Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,74 @@ +/*TYPE TESTCLASS*/ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MMP file for STIF Test Framework's TestScripter +* testclass test module. +* +*/ + +#include + +TARGET MediaMgmtSmokeTestModule.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +/* Remove comments and replace 0x00000000 with correct vendor id */ +// VENDORID 0x00000000 +/* Remove comments and replace 0x00000000 with correct secure id */ +// SECUREID 0x00000000 + +//TARGETPATH ?target_path +DEFFILE MediaMgmtSmokeTestModule.def + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE MediaMgmtSmokeTestModule.cpp +SOURCE MediaMgmtSmokeTestModuleBlocks.cpp MediaMgmtObserver.cpp + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY MGFetch.lib + +LANG SC + +/* +START WINS +?wins_specific_information +END + +START MARM +?marm_specific_information +END +*/ +// Other possible keywords: + +// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) +/* +START BITMAP ?target +TARGETPATH ?emulated_path_on_target_machine +HEADER +SOURCE ?color_depth ?source_bitmap +END +*/ +// DEFFILE ?filename +// AIF ?filename + +// End of File diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/inc/MediaMgmtObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/inc/MediaMgmtObserver.h Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + +#ifndef MEDIAMGMTOBSERVER_H +#define MEDIAMGMTOBSERVER_H + +#include +#include + +class MediaMgmtObserver : public MMGFetchCanceler, public MMGFetchVerifier +{ +public: + TBool VerifySelectionL( const MDesCArray* /*aSelectedFiles*/ ); + void CancelFetcherL(); +}; + +#endif // MEDIAMGMTOBSERVER_H \ No newline at end of file diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/inc/MediaMgmtSmokeTestModule.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/inc/MediaMgmtSmokeTestModule.h Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: STIF testclass declaration +* +*/ + +#ifndef MEDIAMGMTSMOKETESTMODULE_H +#define MEDIAMGMTSMOKETESTMODULE_H + +// INCLUDES +#include +#include +#include +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +_LIT( KMediaMgmtSmokeTestModuleLogPath, "\\logs\\testframework\\MediaMgmtSmokeTestModule\\" ); +// Log file +_LIT( KMediaMgmtSmokeTestModuleLogFile, "MediaMgmtSmokeTestModule.txt" ); +_LIT( KMediaMgmtSmokeTestModuleLogFileWithTitle, "MediaMgmtSmokeTestModule_[%S].txt" ); + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class CMediaMgmtSmokeTestModule; + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CMediaMgmtSmokeTestModule test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CMediaMgmtSmokeTestModule) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMediaMgmtSmokeTestModule* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CMediaMgmtSmokeTestModule(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CMediaMgmtSmokeTestModule( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + + /** + * test method. + * @since ?Series60_version + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + virtual TInt ListMediaItemsL( CStifItemParser& aItem ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + //ADD NEW METHOD DEC HERE + //[TestMethods] - Do not remove + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + + // ?one_line_short_description_of_data + //?data_declaration; + + // Reserved pointer for future extension + //TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +#endif // MEDIAMGMTSMOKETESTMODULE_H + +// End of File diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/src/MediaMgmtObserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/src/MediaMgmtObserver.cpp Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "MediaMgmtObserver.h" + +TBool MediaMgmtObserver::VerifySelectionL( const MDesCArray* /*aSelectedFiles*/ ) + { + TBool ret=ETrue; + return ret; + } + +void MediaMgmtObserver::CancelFetcherL() {} diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/src/MediaMgmtSmokeTestModule.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/src/MediaMgmtSmokeTestModule.cpp Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// INCLUDE FILES +#include +#include "MediaMgmtSmokeTestModule.h" +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMediaMgmtSmokeTestModule::CMediaMgmtSmokeTestModule +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CMediaMgmtSmokeTestModule::CMediaMgmtSmokeTestModule( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CMediaMgmtSmokeTestModule::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMediaMgmtSmokeTestModule::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KMediaMgmtSmokeTestModuleLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KMediaMgmtSmokeTestModuleLogFile); + } + + iLog = CStifLogger::NewL( KMediaMgmtSmokeTestModuleLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + } + +// ----------------------------------------------------------------------------- +// CMediaMgmtSmokeTestModule::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMediaMgmtSmokeTestModule* CMediaMgmtSmokeTestModule::NewL( + CTestModuleIf& aTestModuleIf ) + { + CMediaMgmtSmokeTestModule* self = new (ELeave) CMediaMgmtSmokeTestModule( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CMediaMgmtSmokeTestModule::~CMediaMgmtSmokeTestModule() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +//----------------------------------------------------------------------------- +// CMediaMgmtSmokeTestModule::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CMediaMgmtSmokeTestModule::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("MediaMgmtSmokeTestModule.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CMediaMgmtSmokeTestModule::NewL( aTestModuleIf ); + + } + + +// End of File diff -r a7d4e0bb1362 -r 08dbc9b99fd2 common/tools/ats/smoketest/mediamgmt/src/MediaMgmtSmokeTestModuleBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/ats/smoketest/mediamgmt/src/MediaMgmtSmokeTestModuleBlocks.cpp Mon Dec 07 11:40:50 2009 +0000 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include +#include "MediaMgmtSmokeTestModule.h" +#include "MediaMgmtObserver.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; +_LIT(KTypeImage, "Images"); +_LIT(KTypeAudio, "Audio"); +_LIT(KTypeVideo, "Video"); +_LIT(KTypeAny, "Any"); + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMediaMgmtSmokeTestModule::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CMediaMgmtSmokeTestModule::Delete() + { + + } + +// ----------------------------------------------------------------------------- +// CMediaMgmtSmokeTestModule::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CMediaMgmtSmokeTestModule::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "ListMediaItems", CMediaMgmtSmokeTestModule::ListMediaItemsL ), + //ADD NEW ENTRY HERE + // [test cases entries] - Do not remove + + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// CMediaMgmtSmokeTestModule::ExampleL +// Example test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CMediaMgmtSmokeTestModule::ListMediaItemsL( CStifItemParser& aItem ) + { + CPtrCArray* expectedItems = new (ELeave) CPtrCArray(5); + CleanupArrayDeletePushL(expectedItems); + + // Print to UI + _LIT( KMediaMgmtSmokeTestModule, "MediaMgmtSmokeTestModule" ); + _LIT( KListImages, "In ListMediaItemsL" ); + TestModuleIf().Printf( 0, KMediaMgmtSmokeTestModule, KListImages ); + // Print to log file + iLog->Log( KListImages ); + + TInt i = 0; + TPtrC type; + _LIT( KParam, "Param[%i]: %S" ); + if ( aItem.GetNextString( type ) == KErrNone ) + { + TPtrC itemPath; + while ( aItem.GetNextString ( itemPath ) == KErrNone ) + { + TestModuleIf().Printf( i, KMediaMgmtSmokeTestModule, + KParam, i, &itemPath ); + expectedItems->AppendL( itemPath ); + i++; + } + + CDesCArrayFlat* media = new (ELeave) CDesCArrayFlat(5); + CleanupArrayDeletePushL(media); + + // work out the file type we are looking for + TMediaFileType mediaType; + if (type == KTypeImage) + { + mediaType = EImageFile; + } + else if (type == KTypeAudio) + { + mediaType = EAudioFile; + } + else if (type == KTypeVideo) + { + mediaType = EVideoFile; + } + else + { + User::Leave(KErrArgument); + } + + MediaMgmtObserver* observer = new (ELeave) MediaMgmtObserver; + + if (MGFetch::RunL(*media, mediaType, EFalse, observer)) + { + //compare the two + TInt total = media->Count(); + } + + CleanupStack::PopAndDestroy(media); + } + + CleanupStack::PopAndDestroy(expectedItems); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMediaMgmtSmokeTestModule::?member_function +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +/* +TInt CMediaMgmtSmokeTestModule::?member_function( + CItemParser& aItem ) + { + + ?code + + } +*/ + +// ========================== OTHER EXPORTED FUNCTIONS ========================= +// None + +// [End of File] - Do not remove