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