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