|
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 molr10Step.cpp |
|
20 @internalTechnology |
|
21 */ |
|
22 #include "molr10Step.h" |
|
23 #include "te_suplprotocolsuitedefs.h" |
|
24 |
|
25 /** |
|
26 Destructor |
|
27 */ |
|
28 Cmolr10Step::~Cmolr10Step() |
|
29 |
|
30 { |
|
31 } |
|
32 |
|
33 /** |
|
34 Constructor |
|
35 */ |
|
36 Cmolr10Step::Cmolr10Step() |
|
37 { |
|
38 SetTestStepName(Kmolr10Step); |
|
39 } |
|
40 |
|
41 /** |
|
42 @return - TVerdict code |
|
43 Override of base class virtual |
|
44 */ |
|
45 TVerdict Cmolr10Step::doTestStepPreambleL() |
|
46 { |
|
47 // Call base class method for pre test actions |
|
48 CTe_suplprotocolSuiteStepBase::doTestStepPreambleL(); |
|
49 |
|
50 TLbsNetProtocolModuleParams param(*iGatewayObserver); |
|
51 iModule = CSuplGatewayInterface::NewL(reinterpret_cast<TAny*>(¶m)); |
|
52 |
|
53 return TestStepResult(); |
|
54 } |
|
55 |
|
56 |
|
57 /** Perform CMoLrStep1 test step. |
|
58 This test verifies that the SUPL Protocol Module correctly handles |
|
59 a timeout connecting to the remote server. |
|
60 |
|
61 @return TVerdict test result code |
|
62 */ |
|
63 TVerdict Cmolr10Step::doTestStepL() |
|
64 { |
|
65 |
|
66 INFO_PRINTF1(_L("\t********************************************************************")); |
|
67 INFO_PRINTF1(_L("\tMOLR times out attempting connection")); |
|
68 INFO_PRINTF1(_L("\t********************************************************************")); |
|
69 INFO_PRINTF1(_L("- START -")); |
|
70 // Initiate MO-LR |
|
71 TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111); |
|
72 TLbsNetPosRequestOptionsAssistance options1; |
|
73 options1.SetNewClientConnected(ETrue); |
|
74 TLbsNetPosRequestQuality quality1; |
|
75 options1.SetRequestQuality(quality1); |
|
76 TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList; |
|
77 options1.SetDataRequestMask(dataRequestMask1); |
|
78 INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation")); |
|
79 iModule->RequestSelfLocation(sessionId1, options1); |
|
80 |
|
81 // Check Connection Manager receives a request for connecting |
|
82 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EConnectReq)) |
|
83 { |
|
84 SetTestStepResult(EFail); |
|
85 return TestStepResult(); |
|
86 } |
|
87 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t ConnectionRequest -> NET")); |
|
88 |
|
89 // Connection Manager does not send a "connected" indication |
|
90 // ... 10 secods should pass and then: |
|
91 |
|
92 // Check gateway session completed |
|
93 if (EFail == CheckGatewayCallbackL( |
|
94 CSuplGatewayObserver::EProcessSessionComplete)) |
|
95 { |
|
96 SetTestStepResult(EFail); |
|
97 return TestStepResult(); |
|
98 } |
|
99 INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete")); |
|
100 |
|
101 // Check Connection Manager receives a disconnection request |
|
102 if (EFail == CheckNetworkCallbackL(CSuplNetworkTestObserver::EDisconnectReq)) |
|
103 { |
|
104 SetTestStepResult(EFail); |
|
105 return TestStepResult(); |
|
106 } |
|
107 INFO_PRINTF1(_L("\t\t\t\t\t\t\t\t DisconnectRequest -> NET")); |
|
108 |
|
109 // Check if more observer activity takes place |
|
110 if (iGatewayObserver->IsMoreObserverActivity() || |
|
111 iNetworkObserver->IsMoreObserverActivity()) |
|
112 { |
|
113 SetTestStepResult(EFail); |
|
114 return TestStepResult(); |
|
115 } |
|
116 INFO_PRINTF1(_L("- END -")); |
|
117 |
|
118 SetTestStepResult(EPass); |
|
119 return TestStepResult(); |
|
120 } |
|
121 |
|
122 |
|
123 /** |
|
124 * @return - TVerdict code |
|
125 * Override of base class virtual |
|
126 */ |
|
127 TVerdict Cmolr10Step::doTestStepPostambleL() |
|
128 { |
|
129 delete iModule; |
|
130 |
|
131 // Call base class method for post test actions |
|
132 CTe_suplprotocolSuiteStepBase::doTestStepPostambleL(); |
|
133 return TestStepResult(); |
|
134 } |