|
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 "ctlbsclientpostp4703.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_LbsClientPosTp4703::CT_LbsClientPosTp4703(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent) |
|
31 { |
|
32 _LIT(KTestName, "TP4703 - Default Proxy fallback-other status1"); |
|
33 SetTestStepName(KTestName); |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------- |
|
37 // Destructor. |
|
38 // --------------------------------------------------------- |
|
39 CT_LbsClientPosTp4703::~CT_LbsClientPosTp4703() |
|
40 { |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // CPosTp4703::CloseTest |
|
45 // |
|
46 // (other items were commented in a header). |
|
47 // --------------------------------------------------------- |
|
48 // |
|
49 void CT_LbsClientPosTp4703::CloseTest() |
|
50 { |
|
51 ClosePositioner(); |
|
52 Disconnect(); |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------- |
|
56 // CPosTp4703::StartL |
|
57 // |
|
58 // (other items were commented in a header). |
|
59 // --------------------------------------------------------- |
|
60 // |
|
61 void CT_LbsClientPosTp4703::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, "TP4703"); |
|
72 iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName); |
|
73 |
|
74 // First request a pre position request |
|
75 TInt request = 100; |
|
76 TPositionInfo posInfo; |
|
77 RequestL(posInfo, request, KEspectedErrorCodePSY1); |
|
78 |
|
79 // |
|
80 // Request 1 |
|
81 // |
|
82 request = 4703; |
|
83 RequestL(posInfo, request, KEspectedErrorCodePSY1); |
|
84 |
|
85 VerifyPositionFromL(posInfo, iUidTestProxyPsy2); |
|
86 VerifyRequestTimeLessThanL(5001000); |
|
87 |
|
88 VerifyPositionL(posInfo, 10, 20, 30); |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------- |
|
92 // CPosTp4703::SetupProxyPSYsL |
|
93 // |
|
94 // (other items were commented in a header). |
|
95 // --------------------------------------------------------- |
|
96 // |
|
97 void CT_LbsClientPosTp4703::SetupProxyPSYsL() |
|
98 { |
|
99 CPosModules* db = CPosModules::OpenL(); |
|
100 CleanupStack::PushL(db); |
|
101 |
|
102 CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC(); |
|
103 |
|
104 moduleUpdate->SetUpdateAvailability(EFalse); |
|
105 |
|
106 CPosModuleIdList* prioList = db->ModuleIdListLC(); |
|
107 |
|
108 // Disable all PSY:s except PSYs used by this test case |
|
109 |
|
110 for (TInt i = 0 ; i < prioList->Count(); i++) |
|
111 { |
|
112 if ((*prioList)[i] != iUidTestProxyPsy1 && |
|
113 (*prioList)[i] != iUidTestProxyPsy2) |
|
114 { |
|
115 db->UpdateModuleL((*prioList)[i], *moduleUpdate); |
|
116 } |
|
117 } |
|
118 moduleUpdate->SetUpdateAvailability(ETrue); |
|
119 db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate); |
|
120 db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate); |
|
121 |
|
122 db->SetModulePriorityL(iUidTestProxyPsy1, 0); |
|
123 db->SetModulePriorityL(iUidTestProxyPsy2, 1); |
|
124 |
|
125 CleanupStack::PopAndDestroy(prioList); |
|
126 CleanupStack::PopAndDestroy(moduleUpdate); |
|
127 CleanupStack::PopAndDestroy(db); |
|
128 } |
|
129 |
|
130 // End of File |
|
131 |
|
132 |