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 TESTCASE0681_H
|
|
19 |
#define TESTCASE0681_H
|
|
20 |
|
|
21 |
//----------------------------------------------------------------------------------------------
|
|
22 |
//! @SYMTestCaseID PBASE-T_OTGDI-0681
|
|
23 |
//! @SYMTestCaseDesc B-Device SRP/HNP attempt, A-Device detects SRP, responds with BusRespondSrp
|
|
24 |
//! @SYMFssID
|
|
25 |
//! @SYMPREQ 1305
|
|
26 |
//! @SYMREQ 8929
|
|
27 |
//! @SYMTestType UT
|
|
28 |
//! @SYMTestPriority 1
|
|
29 |
//! @SYMTestActions 1. B-Device triggers SRP, A-Device waits to detect SRP
|
|
30 |
//! 2. A-Device calls BusRespondSrp
|
|
31 |
//! 3. A-Device and B-Device arrive in swapped roles (B-Host, A-Peripheral)
|
|
32 |
//! 4. A-Peripheral waits to arrive in configured state, B-Device waits to become B-Peripheral
|
|
33 |
//! 5. B-Host enumerates newly attached peripheral, and suspends it
|
|
34 |
//! 6. A-Peripheral waits to arrive in suspended state
|
|
35 |
//! 7. Role swap occurs automatically
|
|
36 |
//! 8. A-Device and B-Device wait to arrive in default roles (A-Host, B-Peripheral)
|
|
37 |
//! 9. B-Peripheral waits to arrive in configured state, A-Device waits to become A-Peripheral
|
|
38 |
//! 10. A-Host enumerates newly attached peripheral, and suspends it
|
|
39 |
//! 11. B-Peripheral waits to arrive in suspended state
|
|
40 |
//! 12. B-Device makes a bus request, HNP occurs. Test repeats from step 3, 3 times.
|
|
41 |
//! 13. A-Device drops VBus
|
|
42 |
//! 14. A-Device and B-Device both observe VBus dropping.
|
|
43 |
//!
|
|
44 |
//! @SYMTestExpectedResults SRP is detected and responded to. VBus rises, followed by multiple role swaps,
|
|
45 |
//! followed by VBus dropping (all within 30 seconds)
|
|
46 |
//! @SYMTestStatus Defined
|
|
47 |
//----------------------------------------------------------------------------------------------
|
|
48 |
|
|
49 |
|
|
50 |
class CTestCase0681 : public CTestCaseB2BRoot
|
|
51 |
{
|
|
52 |
public:
|
|
53 |
static CTestCase0681* NewL(TBool aHost);
|
|
54 |
virtual ~CTestCase0681();
|
|
55 |
|
|
56 |
virtual void ExecuteTestCaseL();
|
|
57 |
void DoCancel();
|
|
58 |
static void CancelKB(CTestCaseRoot *pThis);
|
|
59 |
|
|
60 |
void RunStepL();
|
|
61 |
|
|
62 |
TInt GetStepIndex() { return(iCaseStep); };
|
|
63 |
|
|
64 |
private:
|
|
65 |
CTestCase0681(TBool aHost);
|
|
66 |
void ConstructL();
|
|
67 |
|
|
68 |
virtual void StepB2BPreconditions();
|
|
69 |
|
|
70 |
// DATA
|
|
71 |
private:
|
|
72 |
|
|
73 |
enum TCaseSteps
|
|
74 |
{
|
|
75 |
EPreconditions,
|
|
76 |
ELoadLdd, // Load LDDs, trigger FDFActor
|
|
77 |
EPerformSrp, // B-device performs SRP, A-device prepares to detect it
|
|
78 |
EAReceivedSrp, // A-device responds to SRP
|
|
79 |
ESwappedRoles, // B-device as peripheral, A-device as host
|
|
80 |
EAConfigured, // A-Device is configured
|
|
81 |
EASuspended, // A-device is suspended
|
|
82 |
EDefaultRoles, // B-device as peripheral, A-device as host
|
|
83 |
EBConfigured, // B-Device is configured
|
|
84 |
EBSuspended, // B-device is suspended
|
|
85 |
|
|
86 |
EDropVBus, // Tidyup steps
|
|
87 |
EVBusDropped,
|
|
88 |
EUnloadLdd,
|
|
89 |
EUnloadClient,
|
|
90 |
ELastStep
|
|
91 |
};
|
|
92 |
|
|
93 |
TCaseSteps iCaseStep;
|
|
94 |
TInt iStateRetry; // swallow other events
|
|
95 |
|
|
96 |
TInt iHNPCounter; // We want to do a full HNP cycle (A-Host->A-Peripheral->A-Host) x 3
|
|
97 |
|
|
98 |
const static TTestCaseFactoryReceipt<CTestCase0681> iFactoryReceipt;
|
|
99 |
};
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
#endif // TESTCASE0681_H
|