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