|
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 molr20Step.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "molr20Step.h" |
|
23 #include "te_suplprotocolsuitedefs.h" |
|
24 |
|
25 /** |
|
26 Destructor |
|
27 */ |
|
28 Cmolr20Step::~Cmolr20Step() |
|
29 |
|
30 { |
|
31 } |
|
32 |
|
33 /** |
|
34 Constructor |
|
35 */ |
|
36 Cmolr20Step::Cmolr20Step() |
|
37 { |
|
38 SetTestStepName(Kmolr20Step); |
|
39 } |
|
40 |
|
41 /** |
|
42 @return - TVerdict code |
|
43 Override of base class virtual |
|
44 */ |
|
45 TVerdict Cmolr20Step::doTestStepPreambleL() |
|
46 { |
|
47 // Call base class method for pre test actions |
|
48 CTe_suplprotocolSuiteStepBase::doTestStepPreambleL(); |
|
49 |
|
50 TLbsNetProtocolModuleParams param(*iGatewayObserver); |
|
51 iModule = CSuplGatewayInterface::NewL(reinterpret_cast<TAny*>(¶m)); |
|
52 |
|
53 return TestStepResult(); |
|
54 } |
|
55 |
|
56 |
|
57 /** Perform CMoLrStep1 test step. |
|
58 This test verifies that the SUPL Protocol Module correctly handles |
|
59 a SUPL END with error code indication received during a positioning |
|
60 session. |
|
61 |
|
62 @return TVerdict test result code |
|
63 */ |
|
64 TVerdict Cmolr20Step::doTestStepL() |
|
65 { |
|
66 |
|
67 |
|
68 INFO_PRINTF1(_L("\t********************************************************************")); |
|
69 INFO_PRINTF1(_L("\tMOLR SUPL END with error indication received after receiving SUPL POS")); |
|
70 INFO_PRINTF1(_L("\t********************************************************************")); |
|
71 INFO_PRINTF1(_L("- START -")); |
|
72 // Initiate MO-LR |
|
73 TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111); |
|
74 TLbsNetPosRequestOptionsAssistance options1; |
|
75 options1.SetNewClientConnected(ETrue); |
|
76 TLbsNetPosRequestQuality quality1; |
|
77 options1.SetRequestQuality(quality1); |
|
78 TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList; |
|
79 options1.SetDataRequestMask(dataRequestMask1); |
|
80 INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation")); |
|
81 iModule->RequestSelfLocation(sessionId1, options1); |
|
82 |
|
83 // Check Connection Manager receives a request for connecting |
|
84 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq)) |
|
85 { |
|
86 SetTestStepResult(EFail); |
|
87 return TestStepResult(); |
|
88 } |
|
89 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET")); |
|
90 |
|
91 |
|
92 // Simulate the connection is up (inject that event) |
|
93 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connected <- NET")); |
|
94 iNetworkObserver->InjectConnectedIndication(iNetworkObserver->SessionId()); |
|
95 |
|
96 // Check Connection Manager receives a request to send a SUPL START |
|
97 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESuplStartSendReq)) |
|
98 { |
|
99 SetTestStepResult(EFail); |
|
100 return TestStepResult(); |
|
101 } |
|
102 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL START -> NET")); |
|
103 |
|
104 // Inject a SUPL RESPONSE |
|
105 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL RESPONSE <- NET")); |
|
106 CSuplMessageBase* resp = BuildSuplResponseL(TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); |
|
107 iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), resp); |
|
108 |
|
109 |
|
110 // Check gateway receives Location Request |
|
111 INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest()")); |
|
112 if (EFail == CheckGatewayCallbackL( |
|
113 CSuplGatewayObserver::EProcessLocationRequest) || |
|
114 MLbsNetworkProtocolObserver::EServiceSelfLocation != iGatewayObserver->LocType()) |
|
115 { |
|
116 SetTestStepResult(EFail); |
|
117 return TestStepResult(); |
|
118 } |
|
119 |
|
120 // LBS Requests assistance data |
|
121 INFO_PRINTF1(_L("\tLBS -> RequestAssistanceData ()")); |
|
122 TLbsNetSessionIdArray dummyIdArray; |
|
123 iModule->RequestAssistanceData(dataRequestMask1, dummyIdArray); |
|
124 |
|
125 // Check Connection Manager receives a request to send a SUPL POS INIT |
|
126 // with the assistance data mask requested by the gateway |
|
127 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplPosInitSendReq)) |
|
128 { |
|
129 SetTestStepResult(EFail); |
|
130 return TestStepResult(); |
|
131 } |
|
132 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS INIT -> NET")); |
|
133 |
|
134 // Inject a SUPL POS with some of the Assistance data requested |
|
135 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS - RRLP Assitance Data <- NET")); |
|
136 CSuplMessageBase* suplPos = BuildSuplPosAssitDataL(EAssistanceDataAquisitionAssistance|EAssistanceDataBadSatList, EFalse); |
|
137 iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), suplPos); |
|
138 |
|
139 // Check gateway receives the assistance data types requested. |
|
140 INFO_PRINTF1(_L("\tLBS <- ProcessAssistanceData()")); |
|
141 if (EFail == CheckGatewayCallbackL( |
|
142 CSuplGatewayObserver::EProcessAssistanceData) || |
|
143 (dataRequestMask1 & iGatewayObserver->AssistanceDataSetMask() != dataRequestMask1)) |
|
144 { |
|
145 SetTestStepResult(EFail); |
|
146 return TestStepResult(); |
|
147 } |
|
148 |
|
149 // Check the Connection Manager receives a request to send a SUPL POS (ack to assistance data) |
|
150 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplPosSendReq)) |
|
151 { |
|
152 SetTestStepResult(EFail); |
|
153 return TestStepResult(); |
|
154 } |
|
155 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS - RRLP Assistance Data Ack -> NET")); |
|
156 |
|
157 |
|
158 // Inject a SUPL END (with error) |
|
159 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL END <- NET")); |
|
160 CSuplMessageBase* suplEnd = BuildSuplEndL(EFalse, KErrCancel); |
|
161 iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), suplEnd); |
|
162 |
|
163 // Check gateway session completes |
|
164 if (EFail == CheckGatewayCallbackL( |
|
165 CSuplGatewayObserver::EProcessSessionComplete)) |
|
166 { |
|
167 SetTestStepResult(EFail); |
|
168 return TestStepResult(); |
|
169 } |
|
170 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
171 |
|
172 // Check Connection Manager receives a disconnection request |
|
173 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EDisconnectReq)) |
|
174 { |
|
175 SetTestStepResult(EFail); |
|
176 return TestStepResult(); |
|
177 } |
|
178 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t DisconnectRequest -> NET")); |
|
179 |
|
180 // Check if more observer activity takes place |
|
181 if (iGatewayObserver->IsMoreObserverActivity() || |
|
182 iNetworkObserver->IsMoreObserverActivity()) |
|
183 { |
|
184 SetTestStepResult(EFail); |
|
185 return TestStepResult(); |
|
186 } |
|
187 INFO_PRINTF1(_L("- END -")); |
|
188 |
|
189 SetTestStepResult(EPass); |
|
190 return TestStepResult(); |
|
191 |
|
192 } |
|
193 |
|
194 |
|
195 /** |
|
196 * @return - TVerdict code |
|
197 * Override of base class virtual |
|
198 */ |
|
199 TVerdict Cmolr20Step::doTestStepPostambleL() |
|
200 { |
|
201 delete iModule; |
|
202 |
|
203 // Call base class method for post test actions |
|
204 CTe_suplprotocolSuiteStepBase::doTestStepPostambleL(); |
|
205 return TestStepResult(); |
|
206 } |