|
1 // Copyright (c) 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 molr9Step.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "molr9Step.h" |
|
23 #include "te_suplprotocolsuitedefs.h" |
|
24 |
|
25 _LIT(KX3pDestination, "x3pstep1@there.com"); |
|
26 const TUint KX3pSessionId = 0x101; |
|
27 const TInt KX3pPriority = 0x01; |
|
28 const TInt KADummyUid = 0x01; |
|
29 |
|
30 /** |
|
31 * Destructor |
|
32 */ |
|
33 Cmolr9Step::~Cmolr9Step() |
|
34 { |
|
35 } |
|
36 |
|
37 /** |
|
38 * Constructor |
|
39 */ |
|
40 Cmolr9Step::Cmolr9Step() |
|
41 { |
|
42 SetTestStepName(Kmolr9Step); |
|
43 } |
|
44 |
|
45 /** |
|
46 * @return - TVerdict code |
|
47 * Override of base class virtual |
|
48 */ |
|
49 TVerdict Cmolr9Step::doTestStepPreambleL() |
|
50 { |
|
51 // Call base class method for pre test actions |
|
52 CTe_suplprotocolSuiteStepBase::doTestStepPreambleL(); |
|
53 |
|
54 TLbsNetProtocolModuleParams param(*iGatewayObserver); |
|
55 iModule = CSuplGatewayInterface::NewL(reinterpret_cast<TAny*>(¶m)); |
|
56 |
|
57 return TestStepResult(); |
|
58 } |
|
59 |
|
60 /** Perform CMoLrStep9 test step. |
|
61 This test verifies that the SUPL Protocol Module completes a |
|
62 self-locate session when the positioning method is Autonomous |
|
63 and also simultaneous requests to start and cancel a Transmit |
|
64 to Third party procedure (unsupported by SUPL). |
|
65 The test tests the ability of the Protocol to store the |
|
66 session Ids and send the corresponding completion indications. |
|
67 |
|
68 @return TVerdict test result code |
|
69 */ |
|
70 TVerdict Cmolr9Step::doTestStepL() |
|
71 |
|
72 { |
|
73 INFO_PRINTF1(_L("\t********************************************************************")); |
|
74 INFO_PRINTF1(_L("\tAutonomous self-locate request session and transmit to third party")); |
|
75 INFO_PRINTF1(_L("\t********************************************************************")); |
|
76 INFO_PRINTF1(_L("- START -")); |
|
77 // Initiate MO-LR |
|
78 TLbsNetSessionId sessionId1(TUid::Uid(0x97654321), 0x1111); |
|
79 TLbsNetPosRequestOptionsAssistance options1; |
|
80 options1.SetNewClientConnected(ETrue); |
|
81 // Make the request an autonomous one |
|
82 options1.SetPosMode(TPositionModuleInfo::ETechnologyTerminal); |
|
83 TLbsNetPosRequestQuality quality1; |
|
84 options1.SetRequestQuality(quality1); |
|
85 TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList; |
|
86 options1.SetDataRequestMask(dataRequestMask1); |
|
87 INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation")); |
|
88 iModule->RequestSelfLocation(sessionId1, options1); |
|
89 |
|
90 // Attempt to initiate TransmitLocation |
|
91 INFO_PRINTF1(_L("\tLBS -> TransmitLocation")); |
|
92 TLbsNetSessionId sessionId(TUid::Uid(KADummyUid), KX3pSessionId); |
|
93 TLbsNetPosRequestOptions dummyOptions; |
|
94 iModule->RequestTransmitLocation(sessionId, KX3pDestination(), KX3pPriority, dummyOptions); |
|
95 |
|
96 // Attempt to cancel a TransmilLocation session |
|
97 INFO_PRINTF1(_L("\tLBS -> CancelTransmitLocation (REASON)")); |
|
98 iModule->CancelTransmitLocation(iGatewayObserver->SessionIdValue(), KErrGeneral); |
|
99 |
|
100 |
|
101 // Check that Autonomous MOLR has completed |
|
102 if (EFail == CheckGatewayCallbackL( |
|
103 CSuplGatewayObserver::EProcessSessionComplete)) |
|
104 { |
|
105 SetTestStepResult(EFail); |
|
106 return TestStepResult(); |
|
107 } |
|
108 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
109 |
|
110 // Check that TransmitLocatin has completed |
|
111 if (EFail == CheckGatewayCallbackL( |
|
112 CSuplGatewayObserver::EProcessSessionComplete)) |
|
113 { |
|
114 SetTestStepResult(EFail); |
|
115 return TestStepResult(); |
|
116 } |
|
117 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
118 |
|
119 // Check that TransmitLocatin cancellation is replied to |
|
120 if (EFail == CheckGatewayCallbackL( |
|
121 CSuplGatewayObserver::EProcessSessionComplete)) |
|
122 { |
|
123 SetTestStepResult(EFail); |
|
124 return TestStepResult(); |
|
125 } |
|
126 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
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 Cmolr9Step::doTestStepPostambleL() |
|
147 |
|
148 { |
|
149 delete iModule; |
|
150 |
|
151 // Call base class method for post test actions |
|
152 CTe_suplprotocolSuiteStepBase::doTestStepPostambleL(); |
|
153 return TestStepResult(); |
|
154 } |