1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/usbho/t_otgdi/inc/testcase0677.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,99 @@
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 TESTCASE0677_H
1.22 +#define TESTCASE0677_H
1.23 +
1.24 +
1.25 +//----------------------------------------------------------------------------------------------
1.26 +//! @SYMTestCaseID PBASE-T_OTGDI-0677
1.27 +//! @SYMTestCaseDesc B-Device Role-swap attempt, VBUS down
1.28 +//! @SYMFssID
1.29 +//! @SYMPREQ 1305
1.30 +//! @SYMREQ 8929
1.31 +//! @SYMTestType UT
1.32 +//! @SYMTestPriority 1
1.33 +//! LDD is loaded. OTGDI driver session is open
1.34 +//! OET inserted with SW9 set to B-Device
1.35 +//! No A device connected, A plug not connected
1.36 +//! @SYMTestActions 1. Call function on OTGDI to attempt role swap – BusRequest()
1.37 +//! 2. Retrieve error event from error callback
1.38 +//! @SYMTestExpectedResults The call to BusRequest() will trigger the sending of an SRP.
1.39 +//! The SRP must be observed with a dual-trace oscilloscope measuring VBus and D+ and demonstrate the expected waveforms (Figure 5.5 in [R5])
1.40 +//! The A device, if present, should NOT raise VBus.
1.41 +//! The Error retrieved from the callback should be KErrUsbOtgSrpTimeout (-6691)
1.42 +//! Note this test case doesn’t, and isn’t intended to complete role swap. That is tested in PBASE-USB_OTG-0681
1.43 +//! @SYMTestStatus Defined
1.44 +//----------------------------------------------------------------------------------------------
1.45 +
1.46 + class CTestCase0677 : public CTestCaseRoot
1.47 + {
1.48 +public:
1.49 + static CTestCase0677* NewL(TBool aHost);
1.50 + virtual ~CTestCase0677();
1.51 +
1.52 + virtual void ExecuteTestCaseL();
1.53 + void DoCancel();
1.54 + static void CancelKB(CTestCaseRoot *pThis);
1.55 +
1.56 + void RunStepL();
1.57 + virtual void DescribePreconditions();
1.58 + TInt GetStepIndex() { return(iCaseStep); };
1.59 +
1.60 + static void CancelNotify(CTestCaseRoot *pThis);
1.61 +
1.62 +private:
1.63 + CTestCase0677(TBool aHost);
1.64 + void ConstructL();
1.65 +
1.66 + enum ECancelMethods {ECancelVBusNotify, ECancelEventNotify, ECancelMessageNotify};
1.67 + ECancelMethods iCancelWhat;
1.68 + TTime iTimeSRPStart; // time in microseconds since 0AD nominal Gregorian
1.69 + //TTime iTimeNow;
1.70 +
1.71 + // DATA
1.72 +private:
1.73 +
1.74 + TInt iRepeats; // loop counter,
1.75 +
1.76 +
1.77 + enum TCaseSteps
1.78 + {
1.79 + EPreconditions,
1.80 + ELoadLdd, // load client+otg
1.81 + EDetectBPlug, // double-check before starting
1.82 + ERequestBus, // drive
1.83 + EWaitForSRPInitiated, // Wait for SRP active event
1.84 + EWaitForSRPTimeout, // Wait for SRP timeout event
1.85 + EIssueSRPObservedPrompt,// Issue message to user to verify SRP was observed
1.86 + ECheckSRPObservedUserInput, // Check user input from previous step.
1.87 + EUnloadLdd, // unload otg
1.88 + ELastStep
1.89 + };
1.90 +
1.91 +
1.92 + TCaseSteps iCaseStep;
1.93 +
1.94 + const static TTestCaseFactoryReceipt<CTestCase0677> iFactoryReceipt;
1.95 +
1.96 + CTestCaseWatchdog *iWDTimer;
1.97 +
1.98 + void ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps step);
1.99 + };
1.100 +
1.101 +
1.102 +#endif // TESTCASE0677_H