usbengines/usbremotepersonality/tsrc/USBRemotePersonalityTest/inc/USBRemotePersonalityTest.h
changeset 34 7858bc6ead78
parent 31 dfdd8240f7c8
child 35 9d8b04ca6939
equal deleted inserted replaced
31:dfdd8240f7c8 34:7858bc6ead78
     1 /*
       
     2 * Copyright (c) 2002 - 2007 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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef USBREMOTEPERSONALITYTEST_H
       
    22 #define USBREMOTEPERSONALITYTEST_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <StifLogger.h>
       
    26 #include <TestScripterInternal.h>
       
    27 #include <StifTestModule.h>
       
    28 #include <TestclassAssert.h>
       
    29 
       
    30 #include <d32usbc.h>
       
    31 #include <usbman.h>
       
    32 #include <usbwatcher.h>
       
    33 #include <usbpersonalityids.h>
       
    34 
       
    35 #include "cremotepersonalityhandler.h"
       
    36 
       
    37 // CONSTANTS
       
    38 //const ?type ?constant_var = ?constant;
       
    39 const TUint KRemotePersonalityPluginImpUid = 0x10283308;
       
    40 const TUint KSetupPacketLength = 8;
       
    41 
       
    42 // MACROS
       
    43 //#define ?macro ?macro_def
       
    44 #define TEST_CLASS_VERSION_MAJOR 0
       
    45 #define TEST_CLASS_VERSION_MINOR 0
       
    46 #define TEST_CLASS_VERSION_BUILD 0
       
    47 
       
    48 // Logging path
       
    49 _LIT( KUSBRemotePersonalityTestLogPath, "\\logs\\testframework\\USBRemotePersonalityTest\\" );
       
    50 
       
    51 // Logging path for ATS - for phone builds comment this line
       
    52 //_LIT( KUSBRemotePersonalityTestLogPath, "e:\\testing\\stiflogs\\" ); 
       
    53 
       
    54 // Log file
       
    55 _LIT( KUSBRemotePersonalityTestLogFile, "USBRemotePersonalityTest.txt" ); 
       
    56 _LIT( KUSBRemotePersonalityTestLogFileWithTitle, "USBRemotePersonalityTest_[%S].txt" );
       
    57 
       
    58 // FUNCTION PROTOTYPES
       
    59 //?type ?function_name(?arg_list);
       
    60 
       
    61 // FORWARD DECLARATIONS
       
    62 //class ?FORWARD_CLASSNAME;
       
    63 class CUSBRemotePersonalityTest;
       
    64 
       
    65 // DATA TYPES
       
    66 //enum ?declaration
       
    67 
       
    68 enum TUSBRemotePersonalityTestResult
       
    69     {
       
    70     ETestCasePassed,
       
    71     ETestCaseFailed
       
    72     };
       
    73 
       
    74 //typedef ?declaration
       
    75 //extern ?data_type;
       
    76 
       
    77 // CLASS DECLARATION
       
    78 
       
    79 /**
       
    80 *  CUSBRemotePersonalityTest test class for STIF Test Framework TestScripter.
       
    81 *  ?other_description_lines
       
    82 *
       
    83 *  @lib ?library
       
    84 *  @since ?Series60_version
       
    85 */
       
    86 NONSHARABLE_CLASS(CUSBRemotePersonalityTest) : public CScriptBase
       
    87     {
       
    88     public:  // Constructors and destructor
       
    89 
       
    90         /**
       
    91         * Two-phased constructor.
       
    92         */
       
    93         static CUSBRemotePersonalityTest* NewL( CTestModuleIf& aTestModuleIf );
       
    94 
       
    95         /**
       
    96         * Destructor.
       
    97         */
       
    98         virtual ~CUSBRemotePersonalityTest();
       
    99 
       
   100     public: // New functions
       
   101 
       
   102         /**
       
   103         * ?member_description.
       
   104         * @since ?Series60_version
       
   105         * @param ?arg1 ?description
       
   106         * @return ?description
       
   107         */
       
   108         //?type ?member_function( ?type ?arg1 );
       
   109 
       
   110     public: // Functions from base classes
       
   111 
       
   112         /**
       
   113         * From CScriptBase Runs a script line.
       
   114         * @since ?Series60_version
       
   115         * @param aItem Script line containing method name and parameters
       
   116         * @return Symbian OS error code
       
   117         */
       
   118         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   119 
       
   120     protected:  // New functions
       
   121 
       
   122         /**
       
   123         * ?member_description.
       
   124         * @since ?Series60_version
       
   125         * @param ?arg1 ?description
       
   126         * @return ?description
       
   127         */
       
   128         //?type ?member_function( ?type ?arg1 );
       
   129 
       
   130     protected:  // Functions from base classes
       
   131 
       
   132         /**
       
   133         * From ?base_class ?member_description
       
   134         */
       
   135         //?type ?member_function();
       
   136 
       
   137     private:
       
   138 
       
   139         /**
       
   140         * C++ default constructor.
       
   141         */
       
   142         CUSBRemotePersonalityTest( CTestModuleIf& aTestModuleIf );
       
   143 
       
   144         /**
       
   145         * By default Symbian 2nd phase constructor is private.
       
   146         */
       
   147         void ConstructL();
       
   148 
       
   149         // Prohibit copy constructor if not deriving from CBase.
       
   150         // ?classname( const ?classname& );
       
   151         // Prohibit assigment operator if not deriving from CBase.
       
   152         // ?classname& operator=( const ?classname& );
       
   153 
       
   154         /**
       
   155         * Frees all resources allocated from test methods.
       
   156         * @since ?Series60_version
       
   157         */
       
   158         void Delete();
       
   159 
       
   160         /**
       
   161         * Test methods are listed below. 
       
   162         */
       
   163 
       
   164         virtual TInt ExecuteApiTest( CStifItemParser& aItem );
       
   165         virtual TInt ExecuteModuleTest( CStifItemParser& aItem );
       
   166         virtual TInt ExecuteBranchTest( CStifItemParser& aItem );
       
   167         
       
   168         /**
       
   169          * Method used to log version of test class
       
   170          */
       
   171         void SendTestClassVersion();
       
   172 
       
   173         //ADD NEW METHOD DEC HERE
       
   174         //[TestMethods] - Do not remove
       
   175 
       
   176 	void DoExecuteApiTestL( TPtrC aApiTestName, TUSBRemotePersonalityTestResult& aTestResult );
       
   177 	
       
   178 	void CreatePluginImplementationTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   179 	void InitializeTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   180 	void CheckLastResultTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   181 	void GetAllPersonalitiesTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   182 	void SetPersonalityTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   183 	void GetPersonalityTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   184 	void GetPersonalityDesTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   185 	void GetLockStateTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   186 	void SetLockStateTestL( TUSBRemotePersonalityTestResult& aTestResult );	
       
   187 	
       
   188 	void DoExecuteModuleTestL( TPtrC aModuleTestName, TUSBRemotePersonalityTestResult& aTestResult );
       
   189 	
       
   190 	void ExampleModuleTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   191 
       
   192 	void DoExecuteBranchTestL( TPtrC aBranchTestName, TUSBRemotePersonalityTestResult& aTestResult );
       
   193 	
       
   194 	void ExampleBranchTestL( TUSBRemotePersonalityTestResult& aTestResult );
       
   195 
       
   196     public:     // Data
       
   197         // ?one_line_short_description_of_data
       
   198         //?data_declaration;
       
   199 
       
   200     protected:  // Data
       
   201         // ?one_line_short_description_of_data
       
   202         //?data_declaration;
       
   203 
       
   204     private:    // Data
       
   205         
       
   206         RUsb* iUsbMan;
       
   207         RDevUsbcClient* iDevUsbClient;
       
   208         RUsbWatcher* iUsbWatcher;
       
   209         RBuf8 iSetupBuff;
       
   210         RBuf8 iDataBuff;        
       
   211         
       
   212         CRemotePersonalityHandler *iPlugin;
       
   213         
       
   214         TUid iPluginDtorIDKey;
       
   215 
       
   216         // Reserved pointer for future extension
       
   217         //TAny* iReserved;
       
   218 
       
   219     public:     // Friend classes
       
   220         //?friend_class_declaration;
       
   221     protected:  // Friend classes
       
   222         //?friend_class_declaration;
       
   223     private:    // Friend classes
       
   224         //?friend_class_declaration;
       
   225 
       
   226     };
       
   227 
       
   228 #endif      // USBREMOTEPERSONALITYTEST_H
       
   229 
       
   230 // End of File