0
|
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 TESTCASE0677_H
|
|
19 |
#define TESTCASE0677_H
|
|
20 |
|
|
21 |
|
|
22 |
//----------------------------------------------------------------------------------------------
|
|
23 |
//! @SYMTestCaseID PBASE-T_OTGDI-0677
|
|
24 |
//! @SYMTestCaseDesc B-Device Role-swap attempt, VBUS down
|
|
25 |
//! @SYMFssID
|
|
26 |
//! @SYMPREQ 1305
|
|
27 |
//! @SYMREQ 8929
|
|
28 |
//! @SYMTestType UT
|
|
29 |
//! @SYMTestPriority 1
|
|
30 |
//! LDD is loaded. OTGDI driver session is open
|
|
31 |
//! OET inserted with SW9 set to B-Device
|
|
32 |
//! No A device connected, A plug not connected
|
|
33 |
//! @SYMTestActions 1. Call function on OTGDI to attempt role swap – BusRequest()
|
|
34 |
//! 2. Retrieve error event from error callback
|
|
35 |
//! @SYMTestExpectedResults The call to BusRequest() will trigger the sending of an SRP.
|
|
36 |
//! The SRP must be observed with a dual-trace oscilloscope measuring VBus and D+ and demonstrate the expected waveforms (Figure 5.5 in [R5])
|
|
37 |
//! The A device, if present, should NOT raise VBus.
|
|
38 |
//! The Error retrieved from the callback should be KErrUsbOtgSrpTimeout (-6691)
|
|
39 |
//! Note this test case doesn’t, and isn’t intended to complete role swap. That is tested in PBASE-USB_OTG-0681
|
|
40 |
//! @SYMTestStatus Defined
|
|
41 |
//----------------------------------------------------------------------------------------------
|
|
42 |
|
|
43 |
class CTestCase0677 : public CTestCaseRoot
|
|
44 |
{
|
|
45 |
public:
|
|
46 |
static CTestCase0677* NewL(TBool aHost);
|
|
47 |
virtual ~CTestCase0677();
|
|
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 CancelNotify(CTestCaseRoot *pThis);
|
|
58 |
|
|
59 |
private:
|
|
60 |
CTestCase0677(TBool aHost);
|
|
61 |
void ConstructL();
|
|
62 |
|
|
63 |
enum ECancelMethods {ECancelVBusNotify, ECancelEventNotify, ECancelMessageNotify};
|
|
64 |
ECancelMethods iCancelWhat;
|
|
65 |
TTime iTimeSRPStart; // time in microseconds since 0AD nominal Gregorian
|
|
66 |
//TTime iTimeNow;
|
|
67 |
|
|
68 |
// DATA
|
|
69 |
private:
|
|
70 |
|
|
71 |
TInt iRepeats; // loop counter,
|
|
72 |
|
|
73 |
|
|
74 |
enum TCaseSteps
|
|
75 |
{
|
|
76 |
EPreconditions,
|
|
77 |
ELoadLdd, // load client+otg
|
|
78 |
EDetectBPlug, // double-check before starting
|
|
79 |
ERequestBus, // drive
|
|
80 |
EWaitForSRPInitiated, // Wait for SRP active event
|
|
81 |
EWaitForSRPTimeout, // Wait for SRP timeout event
|
|
82 |
EIssueSRPObservedPrompt,// Issue message to user to verify SRP was observed
|
|
83 |
ECheckSRPObservedUserInput, // Check user input from previous step.
|
|
84 |
EUnloadLdd, // unload otg
|
|
85 |
ELastStep
|
|
86 |
};
|
|
87 |
|
|
88 |
|
|
89 |
TCaseSteps iCaseStep;
|
|
90 |
|
|
91 |
const static TTestCaseFactoryReceipt<CTestCase0677> iFactoryReceipt;
|
|
92 |
|
|
93 |
CTestCaseWatchdog *iWDTimer;
|
|
94 |
|
|
95 |
void ContinueAfter(TTimeIntervalMicroSeconds32 aMicroSecs, TCaseSteps step);
|
|
96 |
};
|
|
97 |
|
|
98 |
|
|
99 |
#endif // TESTCASE0677_H
|