os/kernelhwsrv/kerneltest/e32test/usbho/t_otgdi/inc/testcase0678.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/usbho/t_otgdi/inc/testcase0678.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,98 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// @internalComponent
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef TESTCASE0678_H
    1.22 +#define TESTCASE0678_H
    1.23 +
    1.24 +	
    1.25 +//----------------------------------------------------------------------------------------------		
    1.26 +//! @SYMTestCaseID				PBASE-T_OTGDI-0678
    1.27 +//! @SYMTestCaseDesc			B-Device Role-swap attempt. VBUS up, b_hnp_enable, bus suspended
    1.28 +//! @SYMFssID 
    1.29 +//! @SYMPREQ					1305
    1.30 +//! @SYMREQ						8929
    1.31 +//! @SYMTestType				UT
    1.32 +//! @SYMTestPriority			1 
    1.33 +//! @SYMTestActions 			1.	A-Device raises VBus
    1.34 +//!                             2.	A-Device and B-Device wait to arrive in default roles (A-Host, B-Peripheral)
    1.35 +//!								3.	B-Peripheral waits to arrive in configured state, A-Device waits to become A-Peripheral
    1.36 +//!								4.	A-Host enumerates newly attached peripheral, and suspends it
    1.37 +//!								5.	B-Peripheral waits to arrive in suspended state
    1.38 +//!								6.	B-Device makes a bus request, HNP occurs
    1.39 +//!								7.	A-Device and B-Device arrive in swapped roles (B-Host, A-Peripheral)
    1.40 +//!								8.	A-Peripheral waits to arrive in configured state, B-Device waits to become B-Peripheral
    1.41 +//!								9.	B-Host enumerates newly attached peripheral, and suspends it
    1.42 +//!								11.	A-Peripheral waits to arrive in suspended state
    1.43 +//!								12.	Role swap occurs automatically. Test repeats from step 2, 3 times.
    1.44 +//!								13.	A-Device drops VBus
    1.45 +//!								14.	A-Device and B-Device both observe VBus dropping.
    1.46 +//!								
    1.47 +//! @SYMTestExpectedResults 	VBus rises, followed by multiple role swaps, followed by VBus dropping (within 30 seconds)
    1.48 +//! @SYMTestStatus              Defined	
    1.49 +//----------------------------------------------------------------------------------------------	
    1.50 +
    1.51 +
    1.52 +	class CTestCase0678 : public CTestCaseB2BRoot
    1.53 +	{
    1.54 +public:
    1.55 +	static CTestCase0678* NewL(TBool aHost);
    1.56 +	virtual ~CTestCase0678(); 	
    1.57 +	
    1.58 +	virtual void ExecuteTestCaseL();
    1.59 +	void DoCancel();
    1.60 +	static void CancelKB(CTestCaseRoot *pThis);
    1.61 +	
    1.62 +	void RunStepL();
    1.63 +	
    1.64 +	TInt GetStepIndex()	{ return(iCaseStep); };	
    1.65 +	
    1.66 +private:
    1.67 +	CTestCase0678(TBool aHost);
    1.68 +	void ConstructL();
    1.69 +
    1.70 +	// DATA
    1.71 +private:		
    1.72 +
    1.73 +	enum TCaseSteps
    1.74 +		{
    1.75 +		EPreconditions,
    1.76 +		ELoadLdd,				//	Load LDDs, trigger FDFActor
    1.77 +		EReadyToRaiseVBus,			//	Wait until VBus arrives
    1.78 +		EDefaultRoles,   		//	B-device as peripheral, A-device as host
    1.79 +		EBConfigured,			//	B-Device is configured
    1.80 +		EBSuspended,			//	B-device is suspended
    1.81 +		ESwappedRoles,			//	B-device as peripheral, A-device as host
    1.82 +		EAConfigured,			//	A-Device is configured
    1.83 +		EASuspended,			//	A-device is suspended
    1.84 +
    1.85 +		EDropVBus,				//	Tidyup steps
    1.86 +		EVBusDropped,
    1.87 +		EUnloadLdd,
    1.88 +		EUnloadClient,
    1.89 +		ELastStep
    1.90 +		};
    1.91 +	
    1.92 +	TCaseSteps iCaseStep;
    1.93 +	TInt       iStateRetry;	// swallow other events
    1.94 +	
    1.95 +	TInt		iHNPCounter;	//	We want to do a full HNP cycle (A-Host->A-Peripheral->A-Host) x 3
    1.96 +	
    1.97 +	const static TTestCaseFactoryReceipt<CTestCase0678> iFactoryReceipt;
    1.98 +	};
    1.99 +	
   1.100 +	
   1.101 +#endif // TESTCASE0678_H