81 { |
81 { |
82 INFO_PRINTF1(_L("CT_LbsHybridEmergencyCancel::doTestStepL()")); |
82 INFO_PRINTF1(_L("CT_LbsHybridEmergencyCancel::doTestStepL()")); |
83 // Stop the test if the preable failed |
83 // Stop the test if the preable failed |
84 TESTL(TestStepResult() == EPass); |
84 TESTL(TestStepResult() == EPass); |
85 |
85 |
86 const TInt KTimeOut = 60*1000*1000; |
86 const TInt KTimeOut = 80*1000*1000; |
87 const TInt KAdviceSystemStatusTimeout = 40*1000*1000; |
87 const TInt KAdviceSystemStatusTimeout = 40*1000*1000; |
88 |
88 |
89 // reset integration modules count of number of cancels recieved from LBS |
89 // reset integration modules count of number of cancels recieved from LBS |
90 T_LbsUtils utils; |
90 T_LbsUtils utils; |
91 |
91 |
189 |
189 |
190 // in this test we expect this cancel message to be ignored as it is an emergency |
190 // in this test we expect this cancel message to be ignored as it is an emergency |
191 InitiateCancelMTLR(iSessionId.SessionNum()); |
191 InitiateCancelMTLR(iSessionId.SessionNum()); |
192 |
192 |
193 //NHR's timer alpha2 times out -> Hybrid Positioning Start |
193 //NHR's timer alpha2 times out -> Hybrid Positioning Start |
194 quality = ArgUtils::Quality(); // set timeout t |
194 // quality = ArgUtils::Quality(); // set timeout t |
195 iProxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method); |
195 // iProxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method); |
196 |
196 |
197 // >> RequestAssistanceData(0) |
197 // >> RequestAssistanceData(0) |
198 TESTL(iProxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData); |
198 TESTL(iProxy->WaitForResponse(KTimeOut) == ENetMsgRequestAssistanceData); |
199 cleanupCnt = iProxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataGroup); |
199 cleanupCnt = iProxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataGroup); |
200 TESTL(dataGroup == EAssistanceDataNone); |
200 TESTL(dataGroup == EAssistanceDataNone); |
206 CheckForObserverEventTestsL(KTimeOut, *this); |
206 CheckForObserverEventTestsL(KTimeOut, *this); |
207 |
207 |
208 // Verify that the last callback was to ProcessSessionComplete() |
208 // Verify that the last callback was to ProcessSessionComplete() |
209 TESTL(iState==EGpsLocReceived); |
209 TESTL(iState==EGpsLocReceived); |
210 |
210 |
211 |
211 // and finally check that no cancels were sent to test integration module |
212 // MTLR Session Completion Start |
212 TInt cancelCount = utils.IntegrationModulesCountOfCancelsL(); |
|
213 INFO_PRINTF2(_L("--- cancel count = %d"), cancelCount); |
|
214 TESTL(cancelCount== 0); |
|
215 |
|
216 // MTLR Session Completion Start |
213 // << ProcessSessionComplete() |
217 // << ProcessSessionComplete() |
214 iProxy->CallL(ENetMsgProcessSessionComplete, &iSessionId, &reason); |
218 iProxy->CallL(ENetMsgProcessSessionComplete, &iSessionId, &reason); |
215 |
219 |
216 // << ProcessStatusUpdate() |
220 // << ProcessStatusUpdate() |
217 MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask activeServiceMask2 = MLbsNetworkProtocolObserver::EServiceNone; |
221 MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask activeServiceMask2 = MLbsNetworkProtocolObserver::EServiceNone; |
218 iProxy->CallL(ENetMsgProcessStatusUpdate, &activeServiceMask2); |
222 iProxy->CallL(ENetMsgProcessStatusUpdate, &activeServiceMask2); |
219 |
223 |
220 // >> Callback from ProcessRequestComplete() |
224 // >> Callback from ProcessRequestComplete() |
221 CheckForObserverEventTestsL(KTimeOut, *this); |
225 CheckForObserverEventTestsL(KTimeOut, *this); |
222 |
226 |
|
227 INFO_PRINTF2(_L("iState = 0x%x. Expecting ERequestComplete"), iState); |
223 // Verify that the last callback was to ProcessSessionComplete() |
228 // Verify that the last callback was to ProcessSessionComplete() |
224 TESTL(iState==ERequestComplete); |
229 TESTL(iState==ERequestComplete); |
225 |
230 |
226 // and finally check that no cancels were sent to test integration module |
|
227 TInt cancelCount = utils.IntegrationModulesCountOfCancelsL(); |
|
228 INFO_PRINTF2(_L("--- cancel count = %d"), cancelCount); |
|
229 TESTL(cancelCount== 0); |
|
230 |
|
231 // MTLR Session Completion Stop |
231 // MTLR Session Completion Stop |
232 |
232 |
233 |
233 |
234 |
234 |
235 return TestStepResult(); |
235 return TestStepResult(); |
244 ReturnToTestStep(); |
244 ReturnToTestStep(); |
245 } |
245 } |
246 |
246 |
247 void CT_LbsHybridEmergencyCancel::ProcessNetworkPositionUpdate(TUint /*aRequestId*/, const TPositionInfo& aPosInfo) |
247 void CT_LbsHybridEmergencyCancel::ProcessNetworkPositionUpdate(TUint /*aRequestId*/, const TPositionInfo& aPosInfo) |
248 { |
248 { |
|
249 TPosition getPos; |
|
250 aPosInfo.GetPosition(getPos); |
|
251 INFO_PRINTF2(_L("latitude=%f"), getPos.Latitude()); |
|
252 INFO_PRINTF2(_L("Longitude=%f"), getPos.Longitude()); |
|
253 INFO_PRINTF2(_L("HorizontalAccuracy=%f"), getPos.HorizontalAccuracy()); |
|
254 INFO_PRINTF2(_L("PositionMode=%d"), aPosInfo.PositionMode()); |
249 if(iState==EPrivacyCheckOk) |
255 if(iState==EPrivacyCheckOk) |
250 { |
256 { |
251 iState=ERefLocReceived; |
257 iState=ERefLocReceived; |
252 INFO_PRINTF1(_L(">>CT_LbsHybridEmergencyCancel::ProcessNetworkPositionUpdate(RefPosition)")); |
258 INFO_PRINTF1(_L(">>CT_LbsHybridEmergencyCancel::ProcessNetworkPositionUpdate(RefPosition)")); |
253 } |
259 } |
254 else if(iState==ERefLocReceived) |
260 else if(iState==ERefLocReceived) |
255 { |
261 { |
256 TPosition getPos; |
|
257 aPosInfo.GetPosition(getPos); |
|
258 if(getPos.Latitude()==49.2 && getPos.Longitude()==3.5 && getPos.Altitude()==50 && getPos.HorizontalAccuracy()==2 && getPos.VerticalAccuracy()==3) |
262 if(getPos.Latitude()==49.2 && getPos.Longitude()==3.5 && getPos.Altitude()==50 && getPos.HorizontalAccuracy()==2 && getPos.VerticalAccuracy()==3) |
259 { |
263 { |
260 INFO_PRINTF1(_L(">>CT_LbsHybridEmergencyCancel::ProcessNetworkPositionUpdate(GpsPosition)")); |
264 INFO_PRINTF1(_L(">>CT_LbsHybridEmergencyCancel::ProcessNetworkPositionUpdate(GpsPosition)")); |
261 iState=EGpsLocReceived; |
265 iState=EGpsLocReceived; |
262 } |
266 } |