startupservices/startupanimation/tsrc/TSanimmif/inc/TSanimmif.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 TSANIMMIF_H
       
    19 #define TSANIMMIF_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <StifLogger.h>
       
    23 #include <TestScripterInternal.h>
       
    24 #include <StifTestModule.h>
       
    25 #include <TestclassAssert.h>
       
    26 #include <e32def.h>
       
    27 #include <f32file.h>
       
    28 #include "sanimobserver.h"
       
    29 
       
    30 
       
    31 // CONSTANTS
       
    32 //const ?type ?constant_var = ?constant;
       
    33 
       
    34 // MACROS
       
    35 //#define ?macro ?macro_def
       
    36 #define TEST_CLASS_VERSION_MAJOR 0
       
    37 #define TEST_CLASS_VERSION_MINOR 0
       
    38 #define TEST_CLASS_VERSION_BUILD 0
       
    39 
       
    40 // Logging path
       
    41 _LIT( KTSanimmifLogPath, "\\logs\\testframework\\TSanimmif\\" ); 
       
    42 // Log file
       
    43 _LIT( KTSanimmifLogFile, "TSanimmif.txt" ); 
       
    44 _LIT( KTSanimmifLogFileWithTitle, "TSanimmif_[%S].txt" );
       
    45 
       
    46 // FUNCTION PROTOTYPES
       
    47 //?type ?function_name(?arg_list);
       
    48 
       
    49 // FORWARD DECLARATIONS
       
    50 //class ?FORWARD_CLASSNAME;
       
    51 class CTSanimmif;
       
    52 class CSAnimImagePlugin;
       
    53 class CTestWaiter;
       
    54 
       
    55 NONSHARABLE_CLASS( TMockMifAnimationObserver ) : public MSAnimObserver
       
    56     {
       
    57 public:
       
    58     TMockMifAnimationObserver( CTSanimmif& aTestSuite ) : iTestSuite( aTestSuite ) {}
       
    59     virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/, const CFbsBitmap& /*aMask*/ );
       
    60     virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/ );
       
    61 private:
       
    62     CTSanimmif& iTestSuite;
       
    63     };
       
    64 
       
    65 
       
    66 /**
       
    67 *  CTSanimmif test class for STIF Test Framework TestScripter.
       
    68 *  ?other_description_lines
       
    69 *
       
    70 *  @lib ?library
       
    71 *  @since ?Series60_version
       
    72 */
       
    73 NONSHARABLE_CLASS(CTSanimmif) : public CScriptBase
       
    74     {
       
    75     public:  // Constructors and destructor
       
    76 
       
    77         /**
       
    78         * Two-phased constructor.
       
    79         */
       
    80         static CTSanimmif* NewL( CTestModuleIf& aTestModuleIf );
       
    81 
       
    82         /**
       
    83         * Destructor.
       
    84         */
       
    85         virtual ~CTSanimmif();
       
    86 
       
    87     public: // New functions
       
    88 
       
    89         /**
       
    90         * ?member_description.
       
    91         * @since ?Series60_version
       
    92         * @param ?arg1 ?description
       
    93         * @return ?description
       
    94         */
       
    95         //?type ?member_function( ?type ?arg1 );
       
    96 
       
    97     public: // Functions from base classes
       
    98 
       
    99         /**
       
   100         * From CScriptBase Runs a script line.
       
   101         * @since ?Series60_version
       
   102         * @param aItem Script line containing method name and parameters
       
   103         * @return Symbian OS error code
       
   104         */
       
   105         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   106 
       
   107     protected:  // New functions
       
   108 
       
   109         /**
       
   110         * ?member_description.
       
   111         * @since ?Series60_version
       
   112         * @param ?arg1 ?description
       
   113         * @return ?description
       
   114         */
       
   115         //?type ?member_function( ?type ?arg1 );
       
   116 
       
   117     protected:  // Functions from base classes
       
   118 
       
   119         /**
       
   120         * From ?base_class ?member_description
       
   121         */
       
   122         //?type ?member_function();
       
   123 
       
   124     private:
       
   125 
       
   126         /**
       
   127         * C++ default constructor.
       
   128         */
       
   129         CTSanimmif( CTestModuleIf& aTestModuleIf );
       
   130 
       
   131         /**
       
   132         * By default Symbian 2nd phase constructor is private.
       
   133         */
       
   134         void ConstructL();
       
   135 
       
   136         // Prohibit copy constructor if not deriving from CBase.
       
   137         // ?classname( const ?classname& );
       
   138         // Prohibit assigment operator if not deriving from CBase.
       
   139         // ?classname& operator=( const ?classname& );
       
   140 
       
   141         /**
       
   142         * Frees all resources allocated from test methods.
       
   143         * @since ?Series60_version
       
   144         */
       
   145         void Delete();
       
   146 
       
   147         /**
       
   148         * Test methods are listed below. 
       
   149         */
       
   150 
       
   151         /**
       
   152         * Example test method.
       
   153         * @since ?Series60_version
       
   154         * @param aItem Script line containing parameters.
       
   155         * @return Symbian OS error code.
       
   156         */
       
   157         virtual TInt ExampleL( CStifItemParser& aItem );
       
   158         
       
   159         /**
       
   160          * Method used to log version of test class
       
   161          */
       
   162         void SendTestClassVersion();
       
   163         TInt SetupEmptyL();
       
   164         TInt SetupObjL();
       
   165         TInt SetupFileL( const TDesC& aFileName );
       
   166         TInt SetupStillImageNoMaskL();
       
   167         TInt SetupStillImageL();
       
   168         TInt SetupScaledAnimationL();
       
   169         TInt SetupUnscaledAnimationL();
       
   170         TInt SetupFinishedL();
       
   171         TInt Teardown();
       
   172 
       
   173         TInt TestConstructorL();
       
   174         TInt TestConstructorNoMemoryL();
       
   175         TInt TestUnknownFileL();
       
   176         TInt TestCorruptFileL();
       
   177         TInt TestNoFramesFileL();
       
   178         TInt TestLoadStillImageL();
       
   179         TInt TestLoadScaledAnimationL();
       
   180         TInt TestLoadUnscaledAnimationL();
       
   181         TInt TestLoadNoMemoryL();
       
   182         TInt TestCancelLoadL();
       
   183         TInt TestShowStillImageL();
       
   184         TInt TestShowAnimationL();
       
   185         TInt TestCancelStillImageL();
       
   186         TInt TestCancelAnimationL();
       
   187         TInt TestCancelNotActiveL();
       
   188         TInt TestShowBeforeLoadL();
       
   189         TInt TestSetDisplayModeL();
       
   190         TInt TestSetSizeL();
       
   191         TInt TestSetFrameDelayL();
       
   192         TInt TestBackroundColourL();
       
   193            
       
   194 
       
   195     private: // data
       
   196         friend class TMockMifAnimationObserver;
       
   197 
       
   198         /** File server session used in testing. */
       
   199         RFs iFs;
       
   200 
       
   201         /** Instance of the class that this test suite is testing. */
       
   202         CSAnimImagePlugin* iTestObj;
       
   203 
       
   204         /** A 32 bit identifer returned by ECom to identify this instance to the framework. */
       
   205         TUid iDtorKey;
       
   206 
       
   207         /** For testing async calls. */
       
   208         CTestWaiter* iWaiter;
       
   209 
       
   210         /** For testing correct number of calls to animation observer. */
       
   211         TInt iFrameCounter;
       
   212 
       
   213         /** Animation observer for testing. */
       
   214         TMockMifAnimationObserver iObserver;
       
   215 
       
   216     };
       
   217 
       
   218 #endif      // TSANIMMIF_H
       
   219 
       
   220 // End of File