startupservices/startupanimation/tsrc/TSanimengine/inc/TSanimengine.h
changeset 77 b01c07dfcf84
equal deleted inserted replaced
74:1505405bc645 77:b01c07dfcf84
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: STIF testclass declaration
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef TSANIMENGINE_H
       
    19 #define TSANIMENGINE_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <StifLogger.h>
       
    23 #include <TestScripterInternal.h>
       
    24 #include <StifTestModule.h>
       
    25 #include <TestclassAssert.h>
       
    26 
       
    27 
       
    28 // CONSTANTS
       
    29 //const ?type ?constant_var = ?constant;
       
    30 
       
    31 // MACROS
       
    32 //#define ?macro ?macro_def
       
    33 #define TEST_CLASS_VERSION_MAJOR 0
       
    34 #define TEST_CLASS_VERSION_MINOR 0
       
    35 #define TEST_CLASS_VERSION_BUILD 0
       
    36 
       
    37 // Logging path
       
    38 _LIT( KTSanimengineLogPath, "\\logs\\testframework\\TSanimengine\\" ); 
       
    39 // Log file
       
    40 _LIT( KTSanimengineLogFile, "TSanimengine.txt" ); 
       
    41 _LIT( KTSanimengineLogFileWithTitle, "TSanimengine_[%S].txt" );
       
    42 
       
    43 
       
    44 #include <f32file.h>
       
    45 #include "sanimobserver.h"
       
    46 
       
    47 class CSAnimEngine;
       
    48 class CTestWaiter;
       
    49 
       
    50 class TMockAnimationObserver : public MSAnimObserver
       
    51     {
       
    52 public:
       
    53     TMockAnimationObserver() {}
       
    54     virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/, const CFbsBitmap& /*aMask*/ ) {}
       
    55     virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/ ) {}
       
    56     };
       
    57 
       
    58 class CTSanimengine;
       
    59 
       
    60 // DATA TYPES
       
    61 //enum ?declaration
       
    62 //typedef ?declaration
       
    63 //extern ?data_type;
       
    64 
       
    65 // CLASS DECLARATION
       
    66 
       
    67 /**
       
    68 *  CTSanimengine test class for STIF Test Framework TestScripter.
       
    69 *  ?other_description_lines
       
    70 *
       
    71 *  @lib ?library
       
    72 *  @since ?Series60_version
       
    73 */
       
    74 NONSHARABLE_CLASS(CTSanimengine) : public CScriptBase
       
    75     {
       
    76     public:  // Constructors and destructor
       
    77 
       
    78         /**
       
    79         * Two-phased constructor.
       
    80         */
       
    81         static CTSanimengine* NewL( CTestModuleIf& aTestModuleIf );
       
    82 
       
    83         /**
       
    84         * Destructor.
       
    85         */
       
    86         virtual ~CTSanimengine();
       
    87 
       
    88     public: // New functions
       
    89 
       
    90         /**
       
    91         * ?member_description.
       
    92         * @since ?Series60_version
       
    93         * @param ?arg1 ?description
       
    94         * @return ?description
       
    95         */
       
    96         //?type ?member_function( ?type ?arg1 );
       
    97 
       
    98     public: // Functions from base classes
       
    99 
       
   100         /**
       
   101         * From CScriptBase Runs a script line.
       
   102         * @since ?Series60_version
       
   103         * @param aItem Script line containing method name and parameters
       
   104         * @return Symbian OS error code
       
   105         */
       
   106         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   107 
       
   108     protected:  // New functions
       
   109 
       
   110         /**
       
   111         * ?member_description.
       
   112         * @since ?Series60_version
       
   113         * @param ?arg1 ?description
       
   114         * @return ?description
       
   115         */
       
   116         //?type ?member_function( ?type ?arg1 );
       
   117 
       
   118     protected:  // Functions from base classes
       
   119 
       
   120         /**
       
   121         * From ?base_class ?member_description
       
   122         */
       
   123         //?type ?member_function();
       
   124 
       
   125     private:
       
   126 
       
   127         /**
       
   128         * C++ default constructor.
       
   129         */
       
   130         CTSanimengine( CTestModuleIf& aTestModuleIf );
       
   131 
       
   132         /**
       
   133         * By default Symbian 2nd phase constructor is private.
       
   134         */
       
   135         void ConstructL();
       
   136 
       
   137         // Prohibit copy constructor if not deriving from CBase.
       
   138         // ?classname( const ?classname& );
       
   139         // Prohibit assigment operator if not deriving from CBase.
       
   140         // ?classname& operator=( const ?classname& );
       
   141 
       
   142         /**
       
   143         * Frees all resources allocated from test methods.
       
   144         * @since ?Series60_version
       
   145         */
       
   146         void Delete();
       
   147 
       
   148         /**
       
   149         * Test methods are listed below. 
       
   150         */
       
   151 
       
   152         /**
       
   153         * Example test method.
       
   154         * @since ?Series60_version
       
   155         * @param aItem Script line containing parameters.
       
   156         * @return Symbian OS error code.
       
   157         */
       
   158         virtual TInt ExampleL( CStifItemParser& aItem );
       
   159         
       
   160         /**
       
   161          * Method used to log version of test class
       
   162          */
       
   163         void SendTestClassVersion();
       
   164 
       
   165         //ADD NEW METHOD DEC HERE
       
   166         //[TestMethods] - Do not remove
       
   167 
       
   168     
       
   169     TInt SetupEmptyL();
       
   170     TInt SetupObjL();
       
   171     TInt SetupImagePluginL();
       
   172     TInt SetupTonePluginL();
       
   173     TInt SetupBothPluginsL();
       
   174     TInt SetupImagePluginFasterL();
       
   175     TInt SetupTonePluginFasterL();
       
   176     TInt SetupImagePluginReturnsErrorL();
       
   177     TInt SetupTonePluginReturnsErrorL();
       
   178     TInt SetupBothPluginsReturnErrorL();
       
   179     TInt LoadL();
       
   180     TInt SetupImageLoadedL();
       
   181     TInt SetupToneLoadedL();
       
   182     TInt SetupBothLoadedL();
       
   183     TInt SetupLoadFailedL();
       
   184     TInt SetupBothFinishedL();
       
   185     TInt Teardown();
       
   186 
       
   187     TBool CheckNoImagePluginOutputL();
       
   188     TBool CheckImagePluginOutputL(
       
   189         const TUint32 aPluginUid,
       
   190         const TDesC& aFileToLoad,
       
   191         const TInt aDisplayMode,
       
   192         const TSize& aSize,
       
   193         const TInt aFrameDelay );
       
   194     TBool CheckNoTonePluginOutputL();
       
   195     TBool CheckTonePluginOutputL(
       
   196         const TUint32 aPluginUid,
       
   197         const TDesC& aFileToLoad,
       
   198         const TInt aVolume,
       
   199         const TInt64& aVolumeRamp );
       
   200 
       
   201     TInt TestConstructorL();
       
   202     TInt TestConstructorNoMemoryL();
       
   203     TInt TestExtensionlessFileL();
       
   204     TInt TestTooLongExtensionL();
       
   205     TInt SetImagePropertiesUnknownExtensionL();
       
   206     TInt SetImagePropertiesUnknownExtensionNoMemoryL();
       
   207     TInt SetImagePropertiesKnownExtensionL();
       
   208     TInt SetImagePropertiesKnownExtensionNoMemoryL();
       
   209     TInt SetImagePropertiesManyPluginsL();
       
   210     TInt SetImagePropertiesManyPluginsNoMemoryL();
       
   211     TInt SetImagePropertiesWildcardMatchL();
       
   212     TInt SetImagePropertiesWildcardMatchNoMemoryL();
       
   213     TInt SetImagePropertiesManyExtensionsL();
       
   214     TInt SetImagePropertiesManyExtensionsNoMemoryL();
       
   215     TInt SetTonePropertiesUnknownExtensionL();
       
   216     TInt SetTonePropertiesUnknownExtensionNoMemoryL();
       
   217     TInt SetTonePropertiesKnownExtensionL();
       
   218     TInt SetTonePropertiesKnownExtensionNoMemoryL();
       
   219     TInt SetTonePropertiesManyPluginsL();
       
   220     TInt SetTonePropertiesManyPluginsNoMemoryL();
       
   221     TInt SetTonePropertiesWildcardMatchL();
       
   222     TInt SetTonePropertiesWildcardMatchNoMemoryL();
       
   223     TInt TestLoadEmptyL();
       
   224     TInt TestCancelLoadEmptyL();
       
   225     TInt TestLoadNoMemoryL();
       
   226     TInt TestCancelLoadL();
       
   227     TInt TestLoadImagePluginFasterL();
       
   228     TInt TestLoadTonePluginFasterL();
       
   229     TInt TestLoadImagePluginReturnsErrorL();
       
   230     TInt TestLoadTonePluginReturnsErrorL();
       
   231     TInt TestBackroundColourL();
       
   232     TInt TestCancelNotActiveL();
       
   233     TInt TestLoadWhenActiveL();
       
   234     TInt TestStartWhenActiveL();
       
   235     TInt TestStartL();
       
   236     TInt TestStartNotReadyL();
       
   237     TInt TestLoadAgainL();
       
   238     TInt TestStartAgainL();
       
   239     TInt TestLoadAndStartAnotherShowL();
       
   240     TInt TestLoadAndStartEmptyShowAfterAnotherShowL();
       
   241     TInt TestStartWhenLoadFailedL();
       
   242 
       
   243 private: // data
       
   244 
       
   245     /** File server session used in testing. */
       
   246     RFs iFs;
       
   247 
       
   248     /** Animation observer for testing. */
       
   249     TMockAnimationObserver iObserver;
       
   250 
       
   251     /** Instance of the class that this test suite is testing. */
       
   252     CSAnimEngine* iTestObj;
       
   253 
       
   254     /** For testing async calls. */
       
   255     CTestWaiter* iWaiter;
       
   256     CTestWaiter* iWaiter2;
       
   257 
       
   258     
       
   259 
       
   260     };
       
   261 
       
   262 #endif      // TSANIMENGINE_H
       
   263 
       
   264 // End of File