|
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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-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 <centralrepository.h> |
|
20 #include "ctlbsclientpostp4709.h" |
|
21 #include <EPos_CPosModules.h> |
|
22 #include <EPos_CPosModuleUpdate.h> |
|
23 #include <EPos_CPosModuleIdList.h> |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 |
|
27 // --------------------------------------------------------- |
|
28 // Constructor. |
|
29 // --------------------------------------------------------- |
|
30 CT_LbsClientPosTp4709::CT_LbsClientPosTp4709(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent) |
|
31 { |
|
32 _LIT(KTestName, "TP4709 - Default Proxy-Configure Cleanup Timeout"); |
|
33 SetTestStepName(KTestName); |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------- |
|
37 // Destructor. |
|
38 // --------------------------------------------------------- |
|
39 CT_LbsClientPosTp4709::~CT_LbsClientPosTp4709() |
|
40 { |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // CPosTp4709::CloseTest |
|
45 // |
|
46 // (other items were commented in a header). |
|
47 // --------------------------------------------------------- |
|
48 // |
|
49 void CT_LbsClientPosTp4709::CloseTest() |
|
50 { |
|
51 ClosePositioner(); |
|
52 Disconnect(); |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------- |
|
56 // CPosTp4709::StartL |
|
57 // |
|
58 // (other items were commented in a header). |
|
59 // --------------------------------------------------------- |
|
60 // |
|
61 void CT_LbsClientPosTp4709::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, "TP4709"); |
|
72 iPositioner.SetRequestor(CRequestor::ERequestorService, |
|
73 CRequestor::EFormatApplication, KServiceName); |
|
74 |
|
75 ResetDefaultPSYLastWorkingExtGPSPSYL(); |
|
76 |
|
77 TInt request = 100; |
|
78 TPositionInfo posInfo; |
|
79 RequestL(posInfo, request, KEspectedErrorCodePSY1); |
|
80 |
|
81 ///////////////////////////////////////////// |
|
82 // Request 1 |
|
83 ///////////////////////////////////////////// |
|
84 |
|
85 // Check that partial update is not supported |
|
86 // Check this with TP/TC document, Fredrik |
|
87 // |
|
88 TPositionUpdateOptions updateOptions; |
|
89 updateOptions.SetAcceptPartialUpdates(ETrue); |
|
90 TInt res = iPositioner.SetUpdateOptions(updateOptions); |
|
91 User::LeaveIfError(res); |
|
92 |
|
93 request = 4709; |
|
94 RequestL(posInfo, request, KEspectedErrorCodePSY2); |
|
95 |
|
96 VerifyPositionFromL(posInfo, iUidTestPsyPartialUpdate); |
|
97 VerifyRequestTimeLessThanL(4400000); |
|
98 |
|
99 VerifyPositionL(posInfo, 30, 40, 50); |
|
100 } |
|
101 |
|
102 // --------------------------------------------------------- |
|
103 // CPosTp4709::SetupProxyPSYsL |
|
104 // |
|
105 // (other items were commented in a header). |
|
106 // --------------------------------------------------------- |
|
107 // |
|
108 void CT_LbsClientPosTp4709::SetupProxyPSYsL() |
|
109 { |
|
110 CPosModules* db = CPosModules::OpenL(); |
|
111 CleanupStack::PushL(db); |
|
112 |
|
113 CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC(); |
|
114 moduleUpdate->SetUpdateAvailability(EFalse); |
|
115 |
|
116 // Disable all PSY:s except PSYs used by this test case |
|
117 CPosModuleIdList* prioList = db->ModuleIdListLC(); |
|
118 for (TInt i = 0 ; i < prioList->Count(); i++) |
|
119 { |
|
120 if ((*prioList)[i] != iUidTestProxyPsy1 && |
|
121 (*prioList)[i] != iUidTestPsyPartialUpdate) |
|
122 { |
|
123 db->UpdateModuleL((*prioList)[i], *moduleUpdate); |
|
124 } |
|
125 } |
|
126 moduleUpdate->SetUpdateAvailability(ETrue); |
|
127 db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate); |
|
128 db->UpdateModuleL(iUidTestPsyPartialUpdate, *moduleUpdate); |
|
129 |
|
130 db->SetModulePriorityL(iUidTestProxyPsy1, 0); |
|
131 db->SetModulePriorityL(iUidTestPsyPartialUpdate, 1); |
|
132 |
|
133 CleanupStack::PopAndDestroy(prioList); |
|
134 CleanupStack::PopAndDestroy(moduleUpdate); |
|
135 CleanupStack::PopAndDestroy(db); |
|
136 } |
|
137 |
|
138 // End of File |