|
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 "ctlbsclientpostp4701.h" |
|
20 #include <EPos_CPosModules.h> |
|
21 #include <EPos_CPosModuleUpdate.h> |
|
22 #include <EPos_CPosModuleIdList.h> |
|
23 |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 |
|
27 // --------------------------------------------------------- |
|
28 // Constructor. |
|
29 // --------------------------------------------------------- |
|
30 CT_LbsClientPosTp4701::CT_LbsClientPosTp4701(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent) |
|
31 { |
|
32 _LIT(KTestName, "TP4701 - Default Proxy fallback-Active\\Ready Status1"); |
|
33 SetTestStepName(KTestName); |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------- |
|
37 // Destructor. |
|
38 // --------------------------------------------------------- |
|
39 CT_LbsClientPosTp4701::~CT_LbsClientPosTp4701() |
|
40 { |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // CPosTp4701::CloseTest |
|
45 // |
|
46 // (other items were commented in a header). |
|
47 // --------------------------------------------------------- |
|
48 // |
|
49 void CT_LbsClientPosTp4701::CloseTest() |
|
50 { |
|
51 ClosePositioner(); |
|
52 Disconnect(); |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------- |
|
56 // CPosTp4701::StartL |
|
57 // |
|
58 // (other items were commented in a header). |
|
59 // --------------------------------------------------------- |
|
60 // |
|
61 void CT_LbsClientPosTp4701::StartL() |
|
62 { |
|
63 ConnectL(); |
|
64 |
|
65 SetupProxyPSYsL(); |
|
66 ResetDefaultPSYLastWorkingExtGPSPSYL(); |
|
67 |
|
68 User::After(4000000); |
|
69 |
|
70 TInt err = OpenPositioner(); |
|
71 _LIT(KOpenErr, "Error when opening positioner, %d"); |
|
72 AssertTrueL(err == KErrNone, KOpenErr, err); |
|
73 |
|
74 _LIT(KServiceName, "TP4701"); |
|
75 iPositioner.SetRequestor(CRequestor::ERequestorService, |
|
76 CRequestor::EFormatApplication, KServiceName); |
|
77 |
|
78 ///////////////////////////////////////////// |
|
79 // Request 1 |
|
80 ///////////////////////////////////////////// |
|
81 TInt request = 4701; |
|
82 |
|
83 TPositionInfo posInfo; |
|
84 RequestL(posInfo, request, KEspectedErrorCodePSY1); |
|
85 |
|
86 VerifyPositionFromL(posInfo, iUidTestProxyPsy2); |
|
87 VerifyRequestTimeLessThanL(8500000); |
|
88 |
|
89 // Default proxy fallbacks to testproxypsy2 |
|
90 // because of time-shift,fix will |
|
91 // be given by TestProxyPsy2 first. |
|
92 VerifyPsyLoadedL(iUidTestProxyPsy1); |
|
93 VerifyPsyLoadedL(iUidTestProxyPsy2); |
|
94 |
|
95 VerifyPositionL(posInfo, 10, 20, 30); |
|
96 } |
|
97 |
|
98 // --------------------------------------------------------- |
|
99 // CPosTp4701::SetupProxyPSYsL |
|
100 // |
|
101 // (other items were commented in a header). |
|
102 // --------------------------------------------------------- |
|
103 // |
|
104 void CT_LbsClientPosTp4701::SetupProxyPSYsL() |
|
105 { |
|
106 CPosModules* db = CPosModules::OpenL(); |
|
107 CleanupStack::PushL(db); |
|
108 |
|
109 CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC(); |
|
110 moduleUpdate->SetUpdateAvailability(EFalse); |
|
111 |
|
112 // Disable all PSY:s except PSYs used by this test case |
|
113 CPosModuleIdList* prioList = db->ModuleIdListLC(); |
|
114 for (TInt i = 0 ; i < prioList->Count(); i++) |
|
115 { |
|
116 if ((*prioList)[i] != iUidTestProxyPsy1 && |
|
117 (*prioList)[i] != iUidTestProxyPsy2) |
|
118 { |
|
119 db->UpdateModuleL((*prioList)[i], *moduleUpdate); |
|
120 } |
|
121 } |
|
122 moduleUpdate->SetUpdateAvailability(ETrue); |
|
123 db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate); |
|
124 db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate); |
|
125 |
|
126 db->SetModulePriorityL(iUidTestProxyPsy1, 0); |
|
127 db->SetModulePriorityL(iUidTestProxyPsy2, 1); |
|
128 |
|
129 CleanupStack::PopAndDestroy(prioList); |
|
130 CleanupStack::PopAndDestroy(moduleUpdate); |
|
131 CleanupStack::PopAndDestroy(db); |
|
132 } |
|
133 |
|
134 // End of File |