|
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 molr15Step.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "molr15Step.h" |
|
23 #include "te_suplprotocolsuitedefs.h" |
|
24 |
|
25 Cmolr15Step::~Cmolr15Step() |
|
26 { |
|
27 } |
|
28 |
|
29 Cmolr15Step::Cmolr15Step() |
|
30 { |
|
31 SetTestStepName(Kmolr15Step); |
|
32 } |
|
33 |
|
34 /** |
|
35 * @return - TVerdict code |
|
36 * Override of base class virtual |
|
37 */ |
|
38 TVerdict Cmolr15Step::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 Cmolr15Step::doTestStepL() |
|
59 { |
|
60 |
|
61 INFO_PRINTF1(_L("\t********************************************************************")); |
|
62 INFO_PRINTF1(_L("\tMOLR unexpected SUPL POS after SUPL START")); |
|
63 INFO_PRINTF1(_L("\t********************************************************************")); |
|
64 INFO_PRINTF1(_L("- START -")); |
|
65 // Initiate MO-LR |
|
66 TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111); |
|
67 TLbsNetPosRequestOptionsAssistance options1; |
|
68 options1.SetNewClientConnected(ETrue); |
|
69 TLbsNetPosRequestQuality quality1; |
|
70 options1.SetRequestQuality(quality1); |
|
71 TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList; |
|
72 options1.SetDataRequestMask(dataRequestMask1); |
|
73 INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation")); |
|
74 iModule->RequestSelfLocation(sessionId1, options1); |
|
75 |
|
76 // Check Connection Manager receives a request for connecting |
|
77 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq)) |
|
78 { |
|
79 SetTestStepResult(EFail); |
|
80 return TestStepResult(); |
|
81 } |
|
82 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET")); |
|
83 |
|
84 // Simulate the connection is up (inject that event) |
|
85 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t Connected <- NET")); |
|
86 iNetworkObserver->InjectConnectedIndication(iNetworkObserver->SessionId()); |
|
87 |
|
88 // Check Connection Manager receives a request to send a SUPL START |
|
89 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESuplStartSendReq)) |
|
90 { |
|
91 SetTestStepResult(EFail); |
|
92 return TestStepResult(); |
|
93 } |
|
94 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL START -> NET")); |
|
95 |
|
96 // Inject a SUPL POS with some of the Assistance data requested - this is |
|
97 // not expected in an MOLR call and SUPL state machine should terminate the |
|
98 // session |
|
99 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL POS - RRLP Assitance Data <- NET")); |
|
100 CSuplMessageBase* suplPos = BuildSuplPosAssitDataL(EAssistanceDataAquisitionAssistance|EAssistanceDataBadSatList, EFalse); |
|
101 iNetworkObserver->InjectSuplMessage(iNetworkObserver->SessionId(), suplPos); |
|
102 |
|
103 // Check the Connection Manager receives a request to send a SUPL END |
|
104 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::ESendSuplEndSendReq)) |
|
105 { |
|
106 SetTestStepResult(EFail); |
|
107 return TestStepResult(); |
|
108 } |
|
109 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t SUPL END -> NET")); |
|
110 |
|
111 // Check gateway receives a session complete indication |
|
112 if (EFail == CheckGatewayCallbackL( |
|
113 CSuplGatewayObserver::EProcessSessionComplete)) |
|
114 { |
|
115 SetTestStepResult(EFail); |
|
116 return TestStepResult(); |
|
117 } |
|
118 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
119 |
|
120 // Check Connection Manager receives a disconnection request |
|
121 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EDisconnectReq)) |
|
122 { |
|
123 SetTestStepResult(EFail); |
|
124 return TestStepResult(); |
|
125 } |
|
126 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t DisconnectRequest -> NET")); |
|
127 |
|
128 // Check if more observer activity takes place |
|
129 if (iGatewayObserver->IsMoreObserverActivity() || |
|
130 iNetworkObserver->IsMoreObserverActivity()) |
|
131 { |
|
132 SetTestStepResult(EFail); |
|
133 return TestStepResult(); |
|
134 } |
|
135 INFO_PRINTF1(_L("- END -")); |
|
136 |
|
137 SetTestStepResult(EPass); |
|
138 return TestStepResult(); |
|
139 } |
|
140 |
|
141 |
|
142 /** |
|
143 * @return - TVerdict code |
|
144 * Override of base class virtual |
|
145 */ |
|
146 TVerdict Cmolr15Step::doTestStepPostambleL() |
|
147 { |
|
148 delete iModule; |
|
149 |
|
150 // Call base class method for post test actions |
|
151 CTe_suplprotocolSuiteStepBase::doTestStepPostambleL(); |
|
152 return TestStepResult(); |
|
153 } |