|
1 // Copyright (c) 2008-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 "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 // Example CTestStep derived implementation |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file OneIntGpsPsyStep.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "OneIntGpsPsyStep.h" |
|
23 #include "Te_defproxySuiteDefs.h" |
|
24 |
|
25 COneIntGpsPsyStep::~COneIntGpsPsyStep() |
|
26 /** |
|
27 * Destructor |
|
28 */ |
|
29 { |
|
30 } |
|
31 |
|
32 COneIntGpsPsyStep::COneIntGpsPsyStep() |
|
33 /** |
|
34 * Constructor |
|
35 */ |
|
36 { |
|
37 // **MUST** call SetTestStepName in the constructor as the controlling |
|
38 // framework uses the test step name immediately following construction to set |
|
39 // up the step's unique logging ID. |
|
40 SetTestStepName(KOneIntGpsPsyStep); |
|
41 } |
|
42 |
|
43 TVerdict COneIntGpsPsyStep::doTestStepPreambleL() |
|
44 /** |
|
45 * @return - TVerdict code |
|
46 * Override of base class virtual |
|
47 */ |
|
48 { |
|
49 CTe_defproxySuiteStepBase::doTestStepPreambleL(); |
|
50 SetTestStepResult(EPass); |
|
51 return TestStepResult(); |
|
52 } |
|
53 |
|
54 |
|
55 TVerdict COneIntGpsPsyStep::doTestStepL() |
|
56 /** |
|
57 * @return - TVerdict code |
|
58 * Override of base class pure virtual |
|
59 * Our implementation only gets called if the base class doTestStepPreambleL() did |
|
60 * not leave. That being the case, the current test result value will be EPass. |
|
61 */ |
|
62 { |
|
63 StandardPrepareL(); |
|
64 InitPsySettingsL(1, KIntGpsPsy1, 1); |
|
65 |
|
66 TRequestStatus status; |
|
67 TPositionInfo posInfo; |
|
68 TPositionUpdateOptions options; |
|
69 |
|
70 //1. Make location request when PSY response imediately |
|
71 SET_TIME |
|
72 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
73 CHECK_TIME(0) |
|
74 |
|
75 //Unload default proxy and all PSYs |
|
76 CLOSE_AND_OPEN_POSITIONER |
|
77 |
|
78 |
|
79 //2. Make location request when PSY response is 10s |
|
80 ConfigPsyL(KIntGpsPsy1, 1, KConfigLRNoError10s); |
|
81 SET_TIME |
|
82 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
83 CHECK_TIME(10) |
|
84 |
|
85 //Unload default proxy and all PSYs |
|
86 CLOSE_AND_OPEN_POSITIONER |
|
87 |
|
88 //3. Make location request when PSY response is 35s |
|
89 ConfigPsyL(KIntGpsPsy1, 2, |
|
90 KConfigLRNoError35s, |
|
91 KConfigStatusReady); |
|
92 SET_TIME |
|
93 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
94 CHECK_TIME(35) |
|
95 |
|
96 User::After(KSmallDelay); |
|
97 //PSY1 will be in device ready state |
|
98 |
|
99 //4. Make location request when PSY response imediatley |
|
100 SET_TIME |
|
101 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
102 CHECK_TIME(0) |
|
103 |
|
104 //5. Make location request when PSY response is 1s |
|
105 ConfigPsyL(KIntGpsPsy1, 1, KConfigLRNoError1s); |
|
106 SET_TIME |
|
107 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
108 CHECK_TIME(1) |
|
109 |
|
110 //6. Make location request when PSY response is 5s |
|
111 ConfigPsyL(KIntGpsPsy1, 1, KConfigLRNoError5s); |
|
112 SET_TIME |
|
113 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
114 CHECK_TIME(5) |
|
115 |
|
116 //Set device status to active |
|
117 ConfigPsyL(KIntGpsPsy1, 1, KConfigStatusActive); |
|
118 |
|
119 //7. Make location request when PSY response imediatley |
|
120 SET_TIME |
|
121 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
122 CHECK_TIME(0) |
|
123 |
|
124 //8. Make location request when PSY response is 1s |
|
125 ConfigPsyL(KIntGpsPsy1, 1, KConfigLRNoError1s); |
|
126 SET_TIME |
|
127 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
128 CHECK_TIME(1) |
|
129 |
|
130 //9. Make location request when PSY response is 5s |
|
131 ConfigPsyL(KIntGpsPsy1, 1, KConfigLRNoError5s); |
|
132 SET_TIME |
|
133 PositionRequestWithCheck(posInfo, KErrNone, KIntGpsPsy1); |
|
134 CHECK_TIME(5) |
|
135 |
|
136 // cleanup |
|
137 StandardCleanup(); |
|
138 return TestStepResult(); |
|
139 } |
|
140 |
|
141 |
|
142 |
|
143 TVerdict COneIntGpsPsyStep::doTestStepPostambleL() |
|
144 /** |
|
145 * @return - TVerdict code |
|
146 * Override of base class virtual |
|
147 */ |
|
148 { |
|
149 CTe_defproxySuiteStepBase::doTestStepPostambleL(); |
|
150 return TestStepResult(); |
|
151 } |