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