24
|
1 |
// Copyright (c) 2006-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 |
//
|
|
15 |
|
|
16 |
#include <e32test.h>
|
|
17 |
|
|
18 |
#include "TE_EtelMMTestStepBase.h"
|
|
19 |
#include "TE_mmCancelLbsRequests.h"
|
|
20 |
#include "testdef.h"
|
|
21 |
|
|
22 |
|
|
23 |
/**
|
|
24 |
* Cancel all Location Services requests
|
|
25 |
*/
|
|
26 |
enum TVerdict CTestCancelLbsRequests::doTestStepL()
|
|
27 |
{
|
|
28 |
INFO_PRINTF1(_L("Cancel a MT-LR request"));
|
|
29 |
TRequestStatus mtlrStatus;
|
|
30 |
TRequestStatus mcontrolStatus;
|
|
31 |
TRequestStatus reqStatus;
|
|
32 |
RMobileLocationServices::TNotifyMtlrV7Pckg notifyMtlrPckg(iNotifyMtlr);
|
|
33 |
RMobileLocationServices::TMeasurementControlV7Pckg measurementControlPckg(iMeasurementControl);
|
|
34 |
RMobileLocationServices::TMeasurementReportV7Pckg measurementReportPckg(iMeasurementReport);
|
|
35 |
RMobileLocationServices::TStartMolrV7Pckg startMolrPckg(iStartMolr);
|
|
36 |
RMobileLocationServices::TMolrReturnResultV7Pckg molrReturnResultPckg(iMolrReturnResult);
|
|
37 |
|
|
38 |
// Notify Mtlr Cancel
|
|
39 |
TInt measurementId;
|
|
40 |
GetIntFromConfig(ConfigSection(), _L("MeasurementId"), measurementId);
|
|
41 |
|
|
42 |
TInt dataCodingScheme ;
|
|
43 |
GetIntFromConfig(ConfigSection(), _L("DataCodingScheme"), dataCodingScheme);
|
|
44 |
|
|
45 |
TBool errorStatus;
|
|
46 |
GetBoolFromConfig(ConfigSection(), _L("ErrorStatus"), errorStatus);
|
|
47 |
|
|
48 |
iMeasurementControl.iMeasurementIdentity=measurementId;
|
|
49 |
iNotifyMtlr.iLocationInfo.iLcsClientName.iLcsDataCodingScheme = dataCodingScheme;
|
|
50 |
iLocationSvc.NotifyMtlr(mtlrStatus,notifyMtlrPckg);
|
|
51 |
iLocationSvc.NotifyMeasurementControl(mcontrolStatus,measurementControlPckg);
|
|
52 |
iLocationSvc.CancelAsyncRequest(EMobileLocationServicesNotifyMtlr);
|
|
53 |
User::WaitForRequest(mtlrStatus);
|
|
54 |
TEST(mtlrStatus == KErrCancel);
|
|
55 |
INFO_PRINTF2(_L("Test %d - Cancel NotifyMTLRl passed"), iTestCount++);
|
|
56 |
|
|
57 |
// Measurement Control Cancel
|
|
58 |
iLocationSvc.CancelAsyncRequest(EMobileLocationServicesNotifyMeasurementControl);
|
|
59 |
User::WaitForRequest(mcontrolStatus);
|
|
60 |
TEST(mcontrolStatus==KErrCancel);
|
|
61 |
INFO_PRINTF2(_L("Test %d - Cancel NotifyMeasurementControl passed"), iTestCount++);
|
|
62 |
|
|
63 |
// Cancel SendMtlrResponse
|
|
64 |
iMtlrResponse=DMMTSY_MTLR_RESPONSE2;
|
|
65 |
iLocationSvc.SendMtlrResponse(reqStatus,iMtlrResponse);
|
|
66 |
iLocationSvc.CancelAsyncRequest(EMobileLocationServicesSendMtlrResponse);
|
|
67 |
User::WaitForRequest(reqStatus);
|
|
68 |
TEST(reqStatus == KErrCancel);
|
|
69 |
INFO_PRINTF2(_L("Test %d - Cancel SendMtlrResponse passed"), iTestCount++);
|
|
70 |
|
|
71 |
// Cancel SendMeasurementReport request
|
|
72 |
iMeasurementReport.iMeasuredResults.iTUePosMeasuredResults.iPosErrorStatus = errorStatus;
|
|
73 |
iMeasurementReport.iMeasurementIdentity=measurementId;
|
|
74 |
iLocationSvc.SendMeasurementReport(reqStatus,measurementReportPckg);
|
|
75 |
iLocationSvc.CancelAsyncRequest(EMobileLocationServicesSendMeasurementReport);
|
|
76 |
User::WaitForRequest(reqStatus);
|
|
77 |
TEST(reqStatus == KErrCancel);
|
|
78 |
INFO_PRINTF2(_L("Test %d - Cancel SendMeasurementReport passed"), iTestCount++);
|
|
79 |
|
|
80 |
// cancel MOLR request
|
|
81 |
TInt molrType;
|
|
82 |
GetIntFromConfig(ConfigSection(), _L("Molrtype"), molrType);
|
|
83 |
if(molrType == 1)
|
|
84 |
iStartMolr.iMolrType=DMMTSY_MOLR_TYPE1;
|
|
85 |
iLocationSvc.SendMolr(reqStatus,startMolrPckg,molrReturnResultPckg);
|
|
86 |
iLocationSvc.CancelAsyncRequest(EMobileLocationServicesSendMolr);
|
|
87 |
User::WaitForRequest(reqStatus);
|
|
88 |
TEST(reqStatus == KErrCancel);
|
|
89 |
INFO_PRINTF2(_L("Test %d - RMobileLocationServices::SendMolr Cancel request passed"), iTestCount++);
|
|
90 |
|
|
91 |
|
|
92 |
// cancel a NotifyResetUePositioningInformation request.
|
|
93 |
RMobileLocationServices::TUePosTechnology uePositionTechnology;
|
|
94 |
iLocationSvc.NotifyResetUePositioningInformation(reqStatus, uePositionTechnology);
|
|
95 |
iLocationSvc.CancelAsyncRequest(EMobileLocationServicesNotifyResetUePositioningInformation);
|
|
96 |
User::WaitForRequest(reqStatus);
|
|
97 |
TEST(reqStatus == KErrCancel);
|
|
98 |
INFO_PRINTF2(_L("Test %d - RMobileLocationServices::NotifyResetUePositioningInformation Cancel request passed"), iTestCount++);
|
|
99 |
|
|
100 |
return TestStepResult();
|
|
101 |
}
|
|
102 |
|