os/kernelhwsrv/kerneltest/e32test/usbho/t_otgdi/inc/testcase0467.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // @internalComponent
    15 // 
    16 //
    17 
    18 #ifndef TESTCASE0467_H
    19 #define TESTCASE0467_H
    20 
    21 
    22 	
    23 //----------------------------------------------------------------------------------------------		
    24 //! @SYMTestCaseID				PBASE-T_OTGDI-0467
    25 //! @SYMTestCaseDesc			Must be able to detect an A plug insertion using simplified API
    26 //! @SYMFssID 
    27 //! @SYMPREQ					1782
    28 //! @SYMREQ						7080
    29 //! @SYMTestType				UT
    30 //! @SYMTestPriority			1 
    31 //! @SYMTestActions 			1. Register for events with QueueOtgIdPinNotification()
    32 //!                             2. Manually plug in mini A plug into DEV-board without anything on the other end of cable.
    33 //!                             3. Wait max 1 second for insertion event.
    34 //!                             4. Register for events with QueueOtgIdPinNotification()
    35 //!                             5. Remove plug	
    36 //! 							6. Wait max 1 second for remove event.
    37 //! 							7. Repeat steps 1 through 6, 3 times over.
    38 //! @SYMTestExpectedResults 	Between steps 2 and 3, we expect to see an event,
    39 //! 							Between steps 4,5 we expect another event. Fail the test 
    40 //!                             if event does not arrive in the 1 second time
    41 //----------------------------------------------------------------------------------------------	
    42 
    43 	class CTestCase0467 : public CTestCaseRoot
    44 	{
    45 public:
    46 	static CTestCase0467* NewL(TBool aHost);
    47 	virtual ~CTestCase0467(); 	
    48 	
    49 	virtual void ExecuteTestCaseL();
    50 	void DoCancel();
    51 	static void CancelKB(CTestCaseRoot *pThis);
    52 	
    53 	void RunStepL();
    54 	virtual void DescribePreconditions();
    55 	TInt GetStepIndex()	{ return(iCaseStep); };
    56 
    57 	static void CancelIdPin(CTestCaseRoot *pThis);
    58 	
    59 private:
    60 	CTestCase0467(TBool aHost);
    61 	void ConstructL();
    62 
    63 
    64 	// DATA
    65 private:		
    66 
    67 	enum TCaseSteps
    68 		{
    69 		EPreconditions,
    70 		ELoadLdd,		// load and prompt
    71 		ERepeatLoop,		// set up to repeat the test
    72 		EWaitForIDPresent,	// Q
    73 		EVerifyIDPresent,	// checker step
    74 		EWaitForIDGone,		// Q
    75 		EVerifyIDGone,		// checker step
    76 		EUnloadLdd,		// unload 
    77 		ELastStep	
    78 		};
    79 	
    80 		
    81 	TCaseSteps iCaseStep;
    82 	TInt       iRepeats;		// loop counter, set to run 3 times over
    83 	TInt       iDetectionRetry;	// swallow other events
    84 	
    85 	const static TTestCaseFactoryReceipt<CTestCase0467> iFactoryReceipt;
    86 	
    87 	CTestCaseWatchdog *iWDTimer;	
    88 	
    89 	};
    90 	
    91 	
    92 #endif // TESTCASE0467_H