748
|
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 "ctlbsclientpostp4704.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_LbsClientPosTp4704::CT_LbsClientPosTp4704(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
|
|
31 |
{
|
|
32 |
_LIT(KTestName, "TP4704 - Default Proxy fallback-other status2");
|
|
33 |
SetTestStepName(KTestName);
|
|
34 |
}
|
|
35 |
|
|
36 |
// ---------------------------------------------------------
|
|
37 |
// Destructor.
|
|
38 |
// ---------------------------------------------------------
|
|
39 |
CT_LbsClientPosTp4704::~CT_LbsClientPosTp4704()
|
|
40 |
{
|
|
41 |
}
|
|
42 |
|
|
43 |
void CT_LbsClientPosTp4704::CloseTest()
|
|
44 |
{
|
|
45 |
ClosePositioner();
|
|
46 |
Disconnect();
|
|
47 |
}
|
|
48 |
|
|
49 |
void CT_LbsClientPosTp4704::StartL()
|
|
50 |
{
|
|
51 |
ConnectL();
|
|
52 |
|
|
53 |
SetupProxyPSYsL();
|
|
54 |
|
|
55 |
TInt err = OpenPositioner();
|
|
56 |
_LIT(KOpenErr, "Error when opening positioner, %d");
|
|
57 |
AssertTrueL(err == KErrNone, KOpenErr, err);
|
|
58 |
|
|
59 |
_LIT(KServiceName, "TP4704");
|
|
60 |
iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
|
|
61 |
|
|
62 |
// Requesting a pre position request
|
|
63 |
TInt request = 100;
|
|
64 |
TPositionInfo posInfo;
|
|
65 |
RequestL(posInfo, request, KEspectedErrorCodePSY1);
|
|
66 |
|
|
67 |
/////////////////////////////////////////////
|
|
68 |
// Request 1
|
|
69 |
/////////////////////////////////////////////
|
|
70 |
request = 4704;
|
|
71 |
RequestL(posInfo, request, KEspectedErrorCodePSY1);
|
|
72 |
|
|
73 |
VerifyPositionFromL(posInfo, iUidTestProxyPsy1);
|
|
74 |
VerifyRequestTimeLessThanL(4001000);
|
|
75 |
|
|
76 |
VerifyPositionL(posInfo, 5, 15, 25);
|
|
77 |
}
|
|
78 |
|
|
79 |
void CT_LbsClientPosTp4704::SetupProxyPSYsL()
|
|
80 |
{
|
|
81 |
CPosModules* db = CPosModules::OpenL();
|
|
82 |
CleanupStack::PushL(db);
|
|
83 |
|
|
84 |
CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
|
|
85 |
|
|
86 |
moduleUpdate->SetUpdateAvailability(EFalse);
|
|
87 |
|
|
88 |
CPosModuleIdList* prioList = db->ModuleIdListLC();
|
|
89 |
|
|
90 |
// Disable all PSY:s except PSYs used by this test case
|
|
91 |
|
|
92 |
for (TInt i = 0 ; i < prioList->Count(); i++)
|
|
93 |
{
|
|
94 |
if ((*prioList)[i] != iUidTestProxyPsy1 &&
|
|
95 |
(*prioList)[i] != iUidTestProxyPsy2)
|
|
96 |
{
|
|
97 |
db->UpdateModuleL((*prioList)[i], *moduleUpdate);
|
|
98 |
}
|
|
99 |
}
|
|
100 |
moduleUpdate->SetUpdateAvailability(ETrue);
|
|
101 |
db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
|
|
102 |
db->UpdateModuleL(iUidTestProxyPsy2, *moduleUpdate);
|
|
103 |
|
|
104 |
db->SetModulePriorityL(iUidTestProxyPsy1, 0);
|
|
105 |
db->SetModulePriorityL(iUidTestProxyPsy2, 1);
|
|
106 |
|
|
107 |
CleanupStack::PopAndDestroy(prioList);
|
|
108 |
CleanupStack::PopAndDestroy(moduleUpdate);
|
|
109 |
CleanupStack::PopAndDestroy(db);
|
|
110 |
}
|
|
111 |
|
|
112 |
// End of File
|
|
113 |
|
|
114 |
|