kerneltest/e32test/usbho/t_otgdi/inc/testcase0684.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     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 TESTCASE0684_H
       
    19 #define TESTCASE0684_H
       
    20 
       
    21 	
       
    22 //----------------------------------------------------------------------------------------------		
       
    23 //! @SYMTestCaseID				PBASE-T_OTGDI-0684
       
    24 //! @SYMTestCaseDesc			'B' Device should accept all bMaxPower levels from 'A' device
       
    25 //! @SYMFssID 
       
    26 //! @SYMPREQ					1305
       
    27 //! @SYMREQ						8931
       
    28 //! @SYMTestType				UT
       
    29 //! @SYMTestPriority			1 
       
    30 //! @SYMTestActions 			
       
    31 //!					1. Set the bMaxPower to zero for B device. Set the bMaxPower to Zero for A Device.
       
    32 //!					2. Calling BusRequest() on A Device to Raise VBus
       
    33 //!					3. Checking: A device is in A_Host state , 
       
    34 //!								 B device is in B_Peripheral state, 
       
    35 //!								 B device received B_HNP_ENABLE , 
       
    36 //!				                 bus is in SUSPEND
       
    37 //!					4. call BusRequest() on B device to request a role swap 
       
    38 //!					5. Checking: B device temporarily get the host role, (since there are no Function driver load) 
       
    39 //!								 A device received a SET_CONFIGURATION
       
    40 //!					6. Checking: The end state of role swapping is: 
       
    41 //!								 A in A_Peripheral and B in B_Host, 
       
    42 //!								 B device received B_HNP_ENABLE, 
       
    43 //!                    			 bus is in SUSPEND
       
    44 //!					7. On A device, set the bMaxPower to 50 ma,
       
    45 //!					8. On B device, Issue BusRequest()
       
    46 //!					9. Checking: B device temporarily get the host role, 
       
    47 //!								 A device received a SET_CONFIGURATION
       
    48 //!
       
    49 //! @SYMTestExpectedResults 	 B device should not complain about A device's power request is too high since now it is in B IdPin mode 
       
    50 //!                              and never supply power to VBus.
       
    51 //! @SYMTestStatus              Defined	
       
    52 //----------------------------------------------------------------------------------------------	
       
    53 
       
    54 
       
    55 	class CTestCase0684 : public CTestCaseB2BRoot
       
    56 	{
       
    57 public:
       
    58 	static CTestCase0684* NewL(TBool aHost);
       
    59 	virtual ~CTestCase0684(); 	
       
    60 	
       
    61 	virtual void ExecuteTestCaseL();
       
    62 	void DoCancel();
       
    63 	static void CancelKB(CTestCaseRoot *pThis);
       
    64 	
       
    65 	void RunStepL();
       
    66 	
       
    67 	TInt GetStepIndex()	{ return(iCaseStep); };	
       
    68 	
       
    69 private:
       
    70 	CTestCase0684(TBool aHost);
       
    71 	void ConstructL();
       
    72 	void RunStepLOLD();
       
    73 	// DATA
       
    74 private:		
       
    75 
       
    76 	enum TCaseSteps
       
    77 		{
       
    78 		// Fixed steps
       
    79 		EPreconditions,
       
    80 		ELoadLdd,				//	Load LDDs, trigger FDFActor
       
    81 		ESetMaxPower2Zero,		//  Set bMaxPower in the configure descriptor to 0  
       
    82 		EReadyToRaiseVBus,		//	Wait until VBus arrives
       
    83 		EDefaultRoles,   		//	B-device as peripheral, A-device as host (and link is "busy")
       
    84 		
       
    85 		// Steps for this test case only
       
    86 		EAWaitForHNPEnabled,	//  A wait for HNPEnbaled 
       
    87 		EAToPeripheral,			// 
       
    88 		EAToHost,
       
    89 		EBWaitForHNPEnabled,
       
    90 		EBToHost,
       
    91 		EBToPeripheral,
       
    92 		EBConfigured,			//	B-Device is configured
       
    93 		EBSuspended,			//	B-device is suspended
       
    94 		EBWaitForTimeout,
       
    95 		EAIdleHostPriorToAPeripheral,
       
    96 		EAConfigured,
       
    97 		
       
    98 		// Fixed steps
       
    99 		EIdleHostPriorToVBusDown,
       
   100 		EDropVBus,				//	Tidyup steps
       
   101 		EVBusDropped,
       
   102 		EUnloadLdd,
       
   103 		EUnloadClient,
       
   104 		ELastStep
       
   105 		};
       
   106 	
       
   107 	TCaseSteps iCaseStep;
       
   108 	TInt       iStateRetry;	// swallow other events
       
   109 	TInt	   iBusRequestCounter;
       
   110 	TBool      iIsTimeToDrop;
       
   111 	const static TTestCaseFactoryReceipt<CTestCase0684> iFactoryReceipt;
       
   112 	};
       
   113 	
       
   114 	
       
   115 #endif // TESTCASE0683_H
       
   116