|
1 // Copyright (c) 2005-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 // Example CTestStep derived implementation |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file molr2Step.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "molr2Step.h" |
|
23 #include "te_suplprotocolsuitedefs.h" |
|
24 |
|
25 Cmolr2Step::~Cmolr2Step() |
|
26 { |
|
27 } |
|
28 |
|
29 Cmolr2Step::Cmolr2Step() |
|
30 { |
|
31 SetTestStepName(Kmolr2Step); |
|
32 } |
|
33 |
|
34 /** |
|
35 * @return - TVerdict code |
|
36 * Override of base class virtual |
|
37 */ |
|
38 TVerdict Cmolr2Step::doTestStepPreambleL() |
|
39 |
|
40 { |
|
41 |
|
42 // Call base class method for pre test actions |
|
43 CTe_suplprotocolSuiteStepBase::doTestStepPreambleL(); |
|
44 |
|
45 TLbsNetProtocolModuleParams param(*iGatewayObserver); |
|
46 iModule = CSuplGatewayInterface::NewL(reinterpret_cast<TAny*>(¶m)); |
|
47 |
|
48 return TestStepResult(); |
|
49 } |
|
50 |
|
51 /** Perform CMoLrStep1 test step. |
|
52 This test verifies that the SUPL Protocol Module correctly handles |
|
53 an MO-LR Self Locate sequence with position |
|
54 delivered by SLP by means of a SUPL END message. |
|
55 |
|
56 @return TVerdict test result code |
|
57 */ |
|
58 TVerdict Cmolr2Step::doTestStepL() |
|
59 { |
|
60 |
|
61 INFO_PRINTF1(_L("\t********************************************************************")); |
|
62 INFO_PRINTF1(_L("\tMOLR basic procedure followed - position in SUPL END")); |
|
63 INFO_PRINTF1(_L("\t********************************************************************")); |
|
64 INFO_PRINTF1(_L("- START -")); |
|
65 |
|
66 // Make the request a tracking one |
|
67 INFO_PRINTF1(_L("\tLBS -> AdviceSystemStatus (Tracking ON)")); |
|
68 iModule->AdviceSystemStatus(CLbsNetworkProtocolBase::ESystemStatusClientTracking); |
|
69 |
|
70 // Initiate MO-LR |
|
71 TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111); |
|
72 TLbsNetPosRequestOptionsAssistance options1; |
|
73 options1.SetNewClientConnected(ETrue); |
|
74 TLbsNetPosRequestQuality quality1; |
|
75 options1.SetRequestQuality(quality1); |
|
76 TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList; |
|
77 options1.SetDataRequestMask(dataRequestMask1); |
|
78 INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation")); |
|
79 iModule->RequestSelfLocation(sessionId1, options1); |
|
80 |
|
81 // Check Connection Manager receives a request for connecting |
|
82 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq)) |
|
83 { |
|
84 SetTestStepResult(EFail); |
|
85 return TestStepResult(); |
|
86 } |
|
87 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET")); |
|
88 |
|
89 // Simulate the connection is up (inject that event) |
|
90 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connected <- NET")); |
|
91 iNetworkObserver->InjectConnectedIndication(iNetworkObserver->SessionId()); |
|
92 |
|
93 // Check Connection Manager receives a request to send a SUPL START |
|
94 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESuplStartSendReq)) |
|
95 { |
|
96 SetTestStepResult(EFail); |
|
97 return TestStepResult(); |
|
98 } |
|
99 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL START -> NET")); |
|
100 |
|
101 // Inject a SUPL RESPONSE |
|
102 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL RESPONSE <- NET")); |
|
103 CSuplMessageBase* resp = BuildSuplResponseL(TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); |
|
104 iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), resp); |
|
105 |
|
106 // Check gateway receives Location Request |
|
107 INFO_PRINTF1(_L("\tLBS <- ProcessLocationRequest()")); |
|
108 if (EFail == CheckGatewayCallbackL( |
|
109 CSuplGatewayObserver::EProcessLocationRequest) || |
|
110 MLbsNetworkProtocolObserver::EServiceSelfLocation != iGatewayObserver->LocType()) |
|
111 { |
|
112 SetTestStepResult(EFail); |
|
113 return TestStepResult(); |
|
114 } |
|
115 |
|
116 // LBS Requests assistance data |
|
117 INFO_PRINTF1(_L("\tLBS -> RequestAssistanceData ()")); |
|
118 TLbsNetSessionIdArray dummyIdArray; |
|
119 iModule->RequestAssistanceData(dataRequestMask1, dummyIdArray); |
|
120 |
|
121 // Check Connection Manager receives a request to send a SUPL POS INIT |
|
122 // with the assistance data mask requested by the gateway |
|
123 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplPosInitSendReq)) |
|
124 { |
|
125 SetTestStepResult(EFail); |
|
126 return TestStepResult(); |
|
127 } |
|
128 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS INIT -> NET")); |
|
129 |
|
130 // Inject a SUPL END (with position) |
|
131 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL END <- NET")); |
|
132 CSuplMessageBase* suplEnd = BuildSuplEndL(ETrue); |
|
133 |
|
134 iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), suplEnd); |
|
135 |
|
136 // Check gateway receives Location Update |
|
137 INFO_PRINTF1(_L("\tLBS <- ProcessLocationUpdate()")); |
|
138 if (EFail == CheckGatewayCallbackL( |
|
139 CSuplGatewayObserver::EProcessLocationUpdate)) |
|
140 { |
|
141 SetTestStepResult(EFail); |
|
142 return TestStepResult(); |
|
143 } |
|
144 |
|
145 // Check gateway receives a session complete indication |
|
146 if (EFail == CheckGatewayCallbackL( |
|
147 CSuplGatewayObserver::EProcessSessionComplete)) |
|
148 { |
|
149 SetTestStepResult(EFail); |
|
150 return TestStepResult(); |
|
151 } |
|
152 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
153 |
|
154 INFO_PRINTF1(_L("\tLBS -> AdviceSystemStatus (Tracking OFF)")); |
|
155 iModule->AdviceSystemStatus(CLbsNetworkProtocolBase::ESystemStatusNone); |
|
156 |
|
157 // Check Connection Manager receives a disconnection request |
|
158 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EDisconnectReq)) |
|
159 { |
|
160 SetTestStepResult(EFail); |
|
161 return TestStepResult(); |
|
162 } |
|
163 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t DisconnectRequest -> NET")); |
|
164 |
|
165 // Check if more observer activity takes place |
|
166 if (iGatewayObserver->IsMoreObserverActivity() || |
|
167 iNetworkObserver->IsMoreObserverActivity()) |
|
168 { |
|
169 SetTestStepResult(EFail); |
|
170 return TestStepResult(); |
|
171 } |
|
172 INFO_PRINTF1(_L("- END -")); |
|
173 |
|
174 SetTestStepResult(EPass); |
|
175 return TestStepResult(); |
|
176 |
|
177 } |
|
178 |
|
179 |
|
180 /** |
|
181 * @return - TVerdict code |
|
182 * Override of base class virtual |
|
183 */ |
|
184 TVerdict Cmolr2Step::doTestStepPostambleL() |
|
185 { |
|
186 delete iModule; |
|
187 |
|
188 // Call base class method for post test actions |
|
189 CTe_suplprotocolSuiteStepBase::doTestStepPostambleL(); |
|
190 return TestStepResult(); |
|
191 } |