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 TESTCASE0683_H
|
|
19 |
#define TESTCASE0683_H
|
|
20 |
|
|
21 |
|
|
22 |
//----------------------------------------------------------------------------------------------
|
|
23 |
//! @SYMTestCaseID PBASE-T_OTGDI-0683
|
|
24 |
//! @SYMTestCaseDesc Role-swap attempt while monitoring Connection Idle notification.
|
|
25 |
//! @SYMFssID
|
|
26 |
//! @SYMPREQ 1305
|
|
27 |
//! @SYMREQ 8931
|
|
28 |
//! @SYMTestType UT
|
|
29 |
//! @SYMTestPriority 1
|
|
30 |
//! @SYMTestActions 1. A-Device raises VBus
|
|
31 |
//! 2. A-Device and B-Device wait to arrive in default roles (A-Host, B-Peripheral). A-Host must be "busy"
|
|
32 |
//! 3. B-Peripheral waits to arrive in configured state, A-Device waits to become "idle".
|
|
33 |
//! 4. A-Host enumerates newly attached peripheral, and suspends it.
|
|
34 |
//! 5 A-Host becomes idle, then waits to arrive in A-Peripheral state and also become "busy"
|
|
35 |
//! 6. B-Peripheral waits to arrive in suspended state
|
|
36 |
//! 7. B-Device makes a bus request, HNP occurs
|
|
37 |
//! 8. A-Device and B-Device arrive in swapped roles (B-Host, A-Peripheral). A-Peripheral must be "busy"
|
|
38 |
//! 9. A-Peripheral waits to arrive in configured state, B-Device waits to become B-Peripheral
|
|
39 |
//! 10. B-Host enumerates newly attached peripheral, and suspends it
|
|
40 |
//! 11. A-Peripheral becomes configured, then waits to arrive in suspended state and also become "idle"
|
|
41 |
//! 12. Role swap occurs automatically. Test repeats from step 2, 3 times.
|
|
42 |
//! 13 Upon B-Peripheral reaching suspended state for the third time, the B-Peipheral does not make a bus request.
|
|
43 |
//! 14 A-Host waits to become "idle"
|
|
44 |
//! 15. A-Device drops VBus
|
|
45 |
//! 16. A-Device and B-Device both observe VBus dropping.
|
|
46 |
//!
|
|
47 |
//! @SYMTestExpectedResults VBus rises, followed by multiple role swaps, followed by VBus dropping (within 30 seconds)
|
|
48 |
//! @SYMTestStatus Defined
|
|
49 |
//----------------------------------------------------------------------------------------------
|
|
50 |
|
|
51 |
|
|
52 |
class CTestCase0683 : public CTestCaseB2BRoot
|
|
53 |
{
|
|
54 |
public:
|
|
55 |
static CTestCase0683* NewL(TBool aHost);
|
|
56 |
virtual ~CTestCase0683();
|
|
57 |
|
|
58 |
virtual void ExecuteTestCaseL();
|
|
59 |
void DoCancel();
|
|
60 |
static void CancelKB(CTestCaseRoot *pThis);
|
|
61 |
|
|
62 |
void RunStepL();
|
|
63 |
|
|
64 |
TInt GetStepIndex() { return(iCaseStep); };
|
|
65 |
|
|
66 |
private:
|
|
67 |
CTestCase0683(TBool aHost);
|
|
68 |
void ConstructL();
|
|
69 |
|
|
70 |
// DATA
|
|
71 |
private:
|
|
72 |
|
|
73 |
enum TCaseSteps
|
|
74 |
{
|
|
75 |
EPreconditions,
|
|
76 |
ELoadLdd, // Load LDDs, trigger FDFActor
|
|
77 |
EReadyToRaiseVBus, // Wait until VBus arrives
|
|
78 |
EDefaultRoles, // B-device as peripheral, A-device as host (and link is "busy")
|
|
79 |
EBConfigured, // B-Device is configured
|
|
80 |
EBSuspended, // B-device is suspended
|
|
81 |
EAIdleHostPriorToAPeripheral, // A-device detects suspension as "idle" prior to becoming A-Peripheral
|
|
82 |
ESwappedRoles, // B-device as peripheral, A-device as host
|
|
83 |
EAConfigured, // A-Device is configured
|
|
84 |
EASuspended, // A-device is suspended, also detects "idle"
|
|
85 |
EAIdleHostPriorToVBusDown, // A-device detects suspension as "idle" prior to shutting down VBus
|
|
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<CTestCase0683> iFactoryReceipt;
|
|
99 |
};
|
|
100 |
|
|
101 |
|
|
102 |
#endif // TESTCASE0683_H
|