|
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 HGenericInfoStep.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "HGenericInfoStep.h" |
|
23 #include "Te_defproxySuiteDefs.h" |
|
24 |
|
25 CHGenericInfoStep::~CHGenericInfoStep() |
|
26 /** |
|
27 * Destructor |
|
28 */ |
|
29 { |
|
30 } |
|
31 |
|
32 CHGenericInfoStep::CHGenericInfoStep() |
|
33 /** |
|
34 * Constructor |
|
35 */ |
|
36 { |
|
37 SetTestStepName(KHGenericInfoStep); |
|
38 } |
|
39 |
|
40 TVerdict CHGenericInfoStep::doTestStepPreambleL() |
|
41 /** |
|
42 * @return - TVerdict code |
|
43 * Override of base class virtual |
|
44 */ |
|
45 { |
|
46 CTe_defproxySuiteStepBase::doTestStepPreambleL(); |
|
47 SetTestStepResult(EPass); |
|
48 return TestStepResult(); |
|
49 } |
|
50 |
|
51 |
|
52 TVerdict CHGenericInfoStep::doTestStepL() |
|
53 /** |
|
54 * @return - TVerdict code |
|
55 * Override of base class pure virtual |
|
56 * Our implementation only gets called if the base class doTestStepPreambleL() did |
|
57 * not leave. That being the case, the current test result value will be EPass. |
|
58 */ |
|
59 { |
|
60 StandardPrepareL(); |
|
61 InitPsySettingsL(2, |
|
62 KExtGpsPsy1, 1, |
|
63 KIntGpsPsy1, 1); |
|
64 |
|
65 TRequestStatus status; |
|
66 TPositionInfo posInfo; |
|
67 TPositionUpdateOptions options; |
|
68 HPositionGenericInfo* genInfo = HPositionGenericInfo::NewLC(); |
|
69 |
|
70 //Set requested data |
|
71 genInfo->SetRequestedField(EPositionFieldComment); |
|
72 genInfo->SetRequestedField(EPositionFieldHorizontalSpeed); |
|
73 genInfo->SetRequestedField(EPositionFieldMediaLinks); |
|
74 genInfo->SetRequestedField(EPositionFieldMediaLinksStart); |
|
75 genInfo->SetRequestedField(EPositionFieldSatelliteNumInView); |
|
76 genInfo->SetRequestedField(EPositionFieldSatelliteTime); |
|
77 //These two are not supported by the PSY |
|
78 genInfo->SetRequestedField(EPositionFieldTrueCourse); |
|
79 genInfo->SetRequestedField(EPositionFieldStreet); |
|
80 |
|
81 |
|
82 //1. When PSY returns KErrPositionBufferOverflow, it shall be returned |
|
83 //to the client |
|
84 ConfigPsyL(KExtGpsPsy1, 1, |
|
85 KConfigLRErrBufferOverflow //KErrPositionBufferOverflow 1s |
|
86 ); |
|
87 |
|
88 //In error case, the module ID is not set by Location Server |
|
89 PositionRequestWithCheck(*genInfo, KErrPositionBufferOverflow, KNullUid); |
|
90 |
|
91 //2. PSY2 return a fix which is not requested at different time |
|
92 ConfigPsyL(KExtGpsPsy1, 3, |
|
93 KConfigStatusActive, //Status active |
|
94 KConfigLRPartial5s, //Partial in 5s |
|
95 KConfigLRNoError45s |
|
96 ); |
|
97 |
|
98 ConfigPsyL(KIntGpsPsy1, 1, |
|
99 KConfigLRHGeneric10s //Status active |
|
100 ); |
|
101 |
|
102 InitPsyListInDefaultProxyL(); |
|
103 User::After(KSecond * 7); //Delay after configuration |
|
104 |
|
105 SET_TIME |
|
106 PositionRequestWithCheck(*genInfo, KPositionPartialUpdate, KExtGpsPsy1); |
|
107 CHECK_TIME(5) |
|
108 |
|
109 PositionRequestWithCheck(*genInfo, KErrNone, KIntGpsPsy1); |
|
110 CHECK_TIME(7) //timeshift 2s + reponse time 10s - first request(5s) |
|
111 |
|
112 //3. Check satellite info |
|
113 ConfigPsyL(KExtGpsPsy1, 3, |
|
114 KConfigStatusActive, //Status active |
|
115 KConfigLRPartial5s, //Partial in 5s |
|
116 KConfigLRNoError45s |
|
117 ); |
|
118 |
|
119 ConfigPsyL(KIntGpsPsy1, 1, |
|
120 KConfigLRNoError10s //Status active |
|
121 ); |
|
122 |
|
123 InitPsyListInDefaultProxyL(); |
|
124 User::After(KSecond * 7); //Delay after configuration |
|
125 |
|
126 TPositionSatelliteInfo satInfo; |
|
127 |
|
128 SET_TIME |
|
129 PositionRequestWithCheck(satInfo, KPositionPartialUpdate, KExtGpsPsy1); |
|
130 CHECK_TIME(5) |
|
131 |
|
132 PositionRequestWithCheck(satInfo, KErrNone, KIntGpsPsy1); |
|
133 CHECK_TIME(7) //timeshift 2s + reponse time 10s - first request(5s) |
|
134 |
|
135 |
|
136 |
|
137 CleanupStack::PopAndDestroy(genInfo); |
|
138 StandardCleanup(); |
|
139 return TestStepResult(); |
|
140 } |
|
141 |
|
142 |
|
143 |
|
144 TVerdict CHGenericInfoStep::doTestStepPostambleL() |
|
145 /** |
|
146 * @return - TVerdict code |
|
147 * Override of base class virtual |
|
148 */ |
|
149 { |
|
150 CTe_defproxySuiteStepBase::doTestStepPostambleL(); |
|
151 return TestStepResult(); |
|
152 } |