|
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 molr5Step.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "molr5Step.h" |
|
23 #include "te_suplprotocolsuitedefs.h" |
|
24 |
|
25 /** |
|
26 * Destructor |
|
27 */ |
|
28 Cmolr5Step::~Cmolr5Step() |
|
29 |
|
30 { |
|
31 } |
|
32 |
|
33 /** |
|
34 * Constructor |
|
35 */ |
|
36 Cmolr5Step::Cmolr5Step() |
|
37 |
|
38 { |
|
39 SetTestStepName(Kmolr5Step); |
|
40 } |
|
41 |
|
42 /** |
|
43 * @return - TVerdict code |
|
44 * Override of base class virtual |
|
45 */ |
|
46 TVerdict Cmolr5Step::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 |
|
59 /** Perform Cmolr5Step test step. |
|
60 This test verifies that the SUPL Protocol Module correctly handles |
|
61 MO-LR Self Locate cancellation. |
|
62 Cancellation occurs just before receiving a SUPL RESPONSE. |
|
63 (SUPL RESPONSE should be ignored). |
|
64 |
|
65 @return TVerdict test result code |
|
66 */ |
|
67 TVerdict Cmolr5Step::doTestStepL() |
|
68 { |
|
69 INFO_PRINTF1(_L("\t********************************************************************")); |
|
70 INFO_PRINTF1(_L("\tMOLR cancelled by LBS before SUPL RESPONSE is received")); |
|
71 INFO_PRINTF1(_L("\t********************************************************************")); |
|
72 INFO_PRINTF1(_L("- START -")); |
|
73 // Initiate MO-LR |
|
74 TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111); |
|
75 TLbsNetPosRequestOptionsAssistance options1; |
|
76 options1.SetNewClientConnected(ETrue); |
|
77 TLbsNetPosRequestQuality quality1; |
|
78 options1.SetRequestQuality(quality1); |
|
79 TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList; |
|
80 options1.SetDataRequestMask(dataRequestMask1); |
|
81 INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation")); |
|
82 iModule->RequestSelfLocation(sessionId1, options1); |
|
83 |
|
84 // Check Connection Manager receives a request for connecting |
|
85 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq)) |
|
86 { |
|
87 SetTestStepResult(EFail); |
|
88 return TestStepResult(); |
|
89 } |
|
90 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET")); |
|
91 |
|
92 // Simulate the connection is up (inject that event) |
|
93 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connected <- NET")); |
|
94 iNetworkObserver->InjectConnectedIndication(iNetworkObserver->SessionId()); |
|
95 |
|
96 // Check Connection Manager receives a request to send a SUPL START |
|
97 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESuplStartSendReq)) |
|
98 { |
|
99 SetTestStepResult(EFail); |
|
100 return TestStepResult(); |
|
101 } |
|
102 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL START -> NET")); |
|
103 |
|
104 // LBS Cancels MO-LR |
|
105 INFO_PRINTF1(_L("\tLBS -> CancelSelfLocation")); |
|
106 iModule->CancelSelfLocation(sessionId1, KErrCancel); |
|
107 |
|
108 // Check the Connection Manager receives a request to send a SUPL END |
|
109 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplEndSendReq)) |
|
110 { |
|
111 SetTestStepResult(EFail); |
|
112 return TestStepResult(); |
|
113 } |
|
114 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL END -> NET")); |
|
115 |
|
116 // Inject a SUPL RESPONSE |
|
117 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL RESPONSE <- NET")); |
|
118 CSuplMessageBase* resp = BuildSuplResponseL(TPositionModuleInfo::ETechnologyTerminal | TPositionModuleInfo::ETechnologyAssisted); |
|
119 iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), resp); |
|
120 |
|
121 // Check gateway session completed |
|
122 if (EFail == CheckGatewayCallbackL( |
|
123 CSuplGatewayObserver::EProcessSessionComplete)) |
|
124 { |
|
125 SetTestStepResult(EFail); |
|
126 return TestStepResult(); |
|
127 } |
|
128 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
129 |
|
130 // Check Connection Manager receives a disconnection request |
|
131 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EDisconnectReq)) |
|
132 { |
|
133 SetTestStepResult(EFail); |
|
134 return TestStepResult(); |
|
135 } |
|
136 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t DisconnectRequest -> NET")); |
|
137 |
|
138 // Check if more observer activity takes place |
|
139 if (iGatewayObserver->IsMoreObserverActivity() || |
|
140 iNetworkObserver->IsMoreObserverActivity()) |
|
141 { |
|
142 SetTestStepResult(EFail); |
|
143 return TestStepResult(); |
|
144 } |
|
145 INFO_PRINTF1(_L("- END -")); |
|
146 |
|
147 SetTestStepResult(EPass); |
|
148 return TestStepResult(); |
|
149 } |
|
150 |
|
151 |
|
152 |
|
153 TVerdict Cmolr5Step::doTestStepPostambleL() |
|
154 /** |
|
155 * @return - TVerdict code |
|
156 * Override of base class virtual |
|
157 */ |
|
158 { |
|
159 delete iModule; |
|
160 |
|
161 // Call base class method for post test actions |
|
162 CTe_suplprotocolSuiteStepBase::doTestStepPostambleL(); |
|
163 return TestStepResult(); |
|
164 } |
|
165 |