1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
22 #include <e32base_private.h> |
22 #include <e32base_private.h> |
23 #include <e32Test.h> // RTest headder |
23 #include <e32Test.h> // RTest headder |
24 #include "testcaseroot.h" |
24 #include "testcaseroot.h" |
25 #include "testcasewd.h" |
25 #include "testcasewd.h" |
26 #include "testcase0670.h" |
26 #include "testcase0670.h" |
|
27 #include "OstTraceDefinitions.h" |
|
28 #ifdef OST_TRACE_COMPILER_IN_USE |
|
29 #include "testcase0670Traces.h" |
|
30 #endif |
27 |
31 |
28 |
32 |
29 |
33 |
30 // the name below is used to add a pointer to our construction method to a pointer MAP in |
34 // the name below is used to add a pointer to our construction method to a pointer MAP in |
31 // the class factory |
35 // the class factory |
32 _LIT(KTestCaseId,"PBASE-USB_OTGDI-0670"); |
36 _LIT(KTestCaseId,"PBASE-USB_OTGDI-0670"); |
33 const TTestCaseFactoryReceipt<CTestCase0670> CTestCase0670::iFactoryReceipt(KTestCaseId); |
37 const TTestCaseFactoryReceipt<CTestCase0670> CTestCase0670::iFactoryReceipt(KTestCaseId); |
34 |
38 |
35 CTestCase0670* CTestCase0670::NewL(TBool aHost) |
39 CTestCase0670* CTestCase0670::NewL(TBool aHost) |
36 { |
40 { |
37 LOG_FUNC |
41 if(gVerboseOutput) |
|
42 { |
|
43 OstTraceFunctionEntry0(CTESTCASE0670_NEWL); |
|
44 } |
38 CTestCase0670* self = new (ELeave) CTestCase0670(aHost); |
45 CTestCase0670* self = new (ELeave) CTestCase0670(aHost); |
39 CleanupStack::PushL(self); |
46 CleanupStack::PushL(self); |
40 self->ConstructL(); |
47 self->ConstructL(); |
41 CleanupStack::Pop(self); |
48 CleanupStack::Pop(self); |
42 return self; |
49 return self; |
108 |
121 |
109 void CTestCase0670::DescribePreconditions() |
122 void CTestCase0670::DescribePreconditions() |
110 { |
123 { |
111 // H4 width **************************** |
124 // H4 width **************************** |
112 test.Printf(_L("***************************\n")); |
125 test.Printf(_L("***************************\n")); |
|
126 OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS, "***************************\n"); |
113 test.Printf(_L("* This test uses a Mini-A *\n")); |
127 test.Printf(_L("* This test uses a Mini-A *\n")); |
|
128 OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP01, "* This test uses a Mini-A *\n"); |
114 test.Printf(_L("* to Mini-B cable to link *\n")); |
129 test.Printf(_L("* to Mini-B cable to link *\n")); |
|
130 OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP02, "* to Mini-B cable to link *\n"); |
115 test.Printf(_L("* the H4 board to the OPT *\n")); |
131 test.Printf(_L("* the H4 board to the OPT *\n")); |
|
132 OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP03, "* the H4 board to the OPT *\n"); |
116 test.Printf(_L("* and makes use of the *\n")); |
133 test.Printf(_L("* and makes use of the *\n")); |
|
134 OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP04, "* and makes use of the *\n"); |
117 test.Printf(_L("* USB OPT test code *\n")); |
135 test.Printf(_L("* USB OPT test code *\n")); |
|
136 OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP05, "* USB OPT test code *\n"); |
118 test.Printf(_L("***************************\n")); |
137 test.Printf(_L("***************************\n")); |
|
138 OstTrace0(TRACE_NORMAL, CTESTCASE0670_DESCRIBEPRECONDITIONS_DUP06, "***************************\n"); |
119 } |
139 } |
120 |
140 |
121 |
141 |
122 // handle event completion |
142 // handle event completion |
123 void CTestCase0670::RunStepL() |
143 void CTestCase0670::RunStepL() |
124 { |
144 { |
125 LOG_FUNC |
145 if(gVerboseOutput) |
|
146 { |
|
147 OstTraceFunctionEntry0(CTESTCASE0670_RUNSTEPL); |
|
148 } |
126 // Obtain the completion code for this CActive obj. |
149 // Obtain the completion code for this CActive obj. |
127 TInt completionCode(iStatus.Int()); |
150 TInt completionCode(iStatus.Int()); |
128 TBuf<MAX_DSTRLEN> aDescription; |
151 TBuf<MAX_DSTRLEN> aDescription; |
129 |
152 |
130 switch(iCaseStep) |
153 switch(iCaseStep) |
153 break; |
176 break; |
154 |
177 |
155 case EConnectAtoB: |
178 case EConnectAtoB: |
156 // H4 width **************************** |
179 // H4 width **************************** |
157 test.Printf(_L("\n")); |
180 test.Printf(_L("\n")); |
|
181 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP01, "\n"); |
158 test.Printf(_L("***********************\n")); |
182 test.Printf(_L("***********************\n")); |
|
183 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP02, "***********************\n"); |
159 // WAIT_ON_KEYOP( "Connect H4(A) to OPT(B)\n"); |
184 // WAIT_ON_KEYOP( "Connect H4(A) to OPT(B)\n"); |
160 test.Printf(_L("Connect H4(A) to OPT(B)\n")); |
185 test.Printf(_L("Connect H4(A) to OPT(B)\n")); |
|
186 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP03, "Connect H4(Ato OPT(B)\n"); |
161 test.Printf(KPressAnyKeyToContinue); |
187 test.Printf(KPressAnyKeyToContinue); |
|
188 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP04, KPressAnyKeyToContinue); |
162 |
189 |
163 iCaseStep = EStartOptTD4_5; |
190 iCaseStep = EStartOptTD4_5; |
164 RequestCharacter(); |
191 RequestCharacter(); |
165 break; |
192 break; |
166 |
193 |
167 case EStartOptTD4_5: |
194 case EStartOptTD4_5: |
168 // H4 width **************************** |
195 // H4 width **************************** |
169 test.Printf(_L("On the OPT, select:\n")); |
196 test.Printf(_L("On the OPT, select:\n")); |
|
197 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP05, "On the OPT, select:\n"); |
170 test.Printf(_L(" Certified FS-A-UUT Test\n")); |
198 test.Printf(_L(" Certified FS-A-UUT Test\n")); |
|
199 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP06, " Certified FS-A-UUT Test\n"); |
171 test.Printf(_L(" Test TD.4.5-2.9ms-100ms\n")); |
200 test.Printf(_L(" Test TD.4.5-2.9ms-100ms\n")); |
|
201 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP07, " Test TD.4.5-2.9ms-100ms\n"); |
172 test.Printf(_L(" And then Click 'Run' ")); |
202 test.Printf(_L(" And then Click 'Run' ")); |
|
203 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP08, " And then Click 'Run' "); |
173 test.Printf(_L(" When test starts, press any key")); |
204 test.Printf(_L(" When test starts, press any key")); |
|
205 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP09, " When test starts, press any key"); |
174 iCaseStep = EPromptYOpt4_5; |
206 iCaseStep = EPromptYOpt4_5; |
175 RequestCharacter(); |
207 RequestCharacter(); |
176 break; |
208 break; |
177 |
209 |
178 case EPromptYOpt4_5: |
210 case EPromptYOpt4_5: |
179 iCaseStep = EConfirmOpt4_5; |
211 iCaseStep = EConfirmOpt4_5; |
180 test.Printf(_L("Did it PASS (Y/N)?")); |
212 test.Printf(_L("Did it PASS (Y/N)?")); |
|
213 OstTrace0(TRACE_NORMAL, CTESTCASE0670_RUNSTEPL_DUP10, "Did it PASS (Y/N?"); |
181 RequestCharacter(); // 30 seconds for user input |
214 RequestCharacter(); // 30 seconds for user input |
182 iWDTimer->IssueRequest(KDelayDurationForTest4_5, this, &CancelKB); |
215 iWDTimer->IssueRequest(KDelayDurationForTest4_5, this, &CancelKB); |
183 break; |
216 break; |
184 |
217 |
185 case EConfirmOpt4_5: |
218 case EConfirmOpt4_5: |