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