|
1 // Copyright (c) 2001-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 |
|
17 |
|
18 // INCLUDES |
|
19 #include "ctlbsclientpostp4707.h" |
|
20 #include <lbs/epos_cposmodules.h> |
|
21 #include <lbs/epos_cposmoduleupdate.h> |
|
22 #include <lbs/epos_cposmoduleidlist.h> |
|
23 |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 |
|
27 // --------------------------------------------------------- |
|
28 // Constructor. |
|
29 // --------------------------------------------------------- |
|
30 CT_LbsClientPosTp4707::CT_LbsClientPosTp4707(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent) |
|
31 { |
|
32 _LIT(KTestName, "TP4707 - Default Proxy fallback-partial update3"); |
|
33 SetTestStepName(KTestName); |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------- |
|
37 // Destructor. |
|
38 // --------------------------------------------------------- |
|
39 CT_LbsClientPosTp4707::~CT_LbsClientPosTp4707() |
|
40 { |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // CPosTp4707::CloseTest |
|
45 // |
|
46 // (other items were commented in a header). |
|
47 // --------------------------------------------------------- |
|
48 // |
|
49 void CT_LbsClientPosTp4707::CloseTest() |
|
50 { |
|
51 ClosePositioner(); |
|
52 Disconnect(); |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------- |
|
56 // CPosTp4707::StartL |
|
57 // |
|
58 // (other items were commented in a header). |
|
59 // --------------------------------------------------------- |
|
60 // |
|
61 void CT_LbsClientPosTp4707::StartL() |
|
62 { |
|
63 ConnectL(); |
|
64 |
|
65 SetupProxyPSYsL(); |
|
66 |
|
67 TInt err = OpenPositioner(); |
|
68 _LIT(KOpenErr, "Error when opening positioner, %d"); |
|
69 AssertTrueL(err == KErrNone, KOpenErr, err); |
|
70 |
|
71 _LIT(KServiceName, "TP4707"); |
|
72 iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName); |
|
73 |
|
74 // Issue a pre position request |
|
75 TInt request = 100; |
|
76 TPositionInfo posInfo; |
|
77 RequestL(posInfo, request, KEspectedErrorCodePSY1); |
|
78 |
|
79 // |
|
80 // Request 1 |
|
81 // |
|
82 // Check that partial update is not supported |
|
83 TPositionUpdateOptions updateOptions; |
|
84 updateOptions.SetAcceptPartialUpdates(ETrue); |
|
85 iPositioner.SetUpdateOptions(updateOptions); |
|
86 |
|
87 request = 4707; |
|
88 RequestL(posInfo, request, KEspectedErrorCodePSY2); |
|
89 |
|
90 VerifyPositionFromL(posInfo, iUidTestPsyPartialUpdate); |
|
91 VerifyRequestTimeLessThanL(5001000); |
|
92 |
|
93 VerifyPositionL(posInfo, 30, 40, 50); |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------- |
|
97 // CPosTp4707::SetupProxyPSYsL |
|
98 // |
|
99 // (other items were commented in a header). |
|
100 // --------------------------------------------------------- |
|
101 // |
|
102 void CT_LbsClientPosTp4707::SetupProxyPSYsL() |
|
103 { |
|
104 CPosModules* db = CPosModules::OpenL(); |
|
105 CleanupStack::PushL(db); |
|
106 |
|
107 CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC(); |
|
108 |
|
109 moduleUpdate->SetUpdateAvailability(EFalse); |
|
110 |
|
111 CPosModuleIdList* prioList = db->ModuleIdListLC(); |
|
112 |
|
113 // Disable all PSY:s except PSYs used by this test case |
|
114 |
|
115 for (TInt i = 0 ; i < prioList->Count(); i++) |
|
116 { |
|
117 if ((*prioList)[i] != iUidTestProxyPsy1 && |
|
118 (*prioList)[i] != iUidTestPsyPartialUpdate) |
|
119 { |
|
120 db->UpdateModuleL((*prioList)[i], *moduleUpdate); |
|
121 } |
|
122 } |
|
123 moduleUpdate->SetUpdateAvailability(ETrue); |
|
124 db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate); |
|
125 db->UpdateModuleL(iUidTestPsyPartialUpdate, *moduleUpdate); |
|
126 |
|
127 db->SetModulePriorityL(iUidTestProxyPsy1, 0); |
|
128 db->SetModulePriorityL(iUidTestPsyPartialUpdate, 1); |
|
129 |
|
130 CleanupStack::PopAndDestroy(prioList); |
|
131 CleanupStack::PopAndDestroy(moduleUpdate); |
|
132 CleanupStack::PopAndDestroy(db); |
|
133 } |
|
134 |
|
135 // End of File |
|
136 |
|
137 |