|
1 // Copyright (c) 2002-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 // EtelPacketTest3G_1.cpp |
|
15 // JetStream Packet data tests. |
|
16 // This file tests the 3G (WCDMA) Packet Service functionality - TestCase 3G.1 |
|
17 // |
|
18 // |
|
19 |
|
20 // Symbian OS includes |
|
21 #include <e32base.h> |
|
22 |
|
23 #include <etelpckt.h> |
|
24 #include <pcktcs.h> |
|
25 |
|
26 #include "Te_EtelPacketTestStepBase.h" |
|
27 |
|
28 #include "testdef.h" |
|
29 |
|
30 #include "Te_EtelPacketTest3g_1.h" |
|
31 #include "Te_etelpckt_defs.h" |
|
32 |
|
33 |
|
34 CEtelPacketTest3G_1::CEtelPacketTest3G_1() |
|
35 /** Constructor |
|
36 * Stores the name of this test case. |
|
37 */ |
|
38 { |
|
39 SetTestStepName(_L("3GPacketService")); |
|
40 } |
|
41 |
|
42 |
|
43 CEtelPacketTest3G_1::~CEtelPacketTest3G_1() |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 { |
|
48 } |
|
49 |
|
50 |
|
51 enum TVerdict CEtelPacketTest3G_1::doTestStepL( void ) |
|
52 /** |
|
53 * Test step 3G.1 calls the 3G Packet service (RPacketService) methods |
|
54 */ |
|
55 { |
|
56 RPhone pcktPhone; |
|
57 TInt ret=pcktPhone.Open(iTelServer,DPCKTTSY_PHONE_NAME); |
|
58 CHECKPOINT_EX(ret==KErrNone,CHP_OPEN_PHONE); |
|
59 |
|
60 RPacketService wcdmaService; |
|
61 ret=wcdmaService.Open(pcktPhone); |
|
62 CHECKPOINT(ret,KErrNone,CHP_SRVS_CASE("A.3G1")); |
|
63 |
|
64 TRequestStatus reqStatus; |
|
65 |
|
66 // Enumerate NIFs |
|
67 TInt nifCount; |
|
68 wcdmaService.EnumerateNifs(reqStatus, nifCount); |
|
69 User::WaitForRequest(reqStatus); |
|
70 |
|
71 CHECKPOINT(reqStatus.Int(),KErrNone,CHP_SRVS_CASE("A.3G2")); |
|
72 CHECKPOINT(nifCount,DPCKTTSY_NUMBER_OF_NIFS,CHP_SRVS_CASE("A.3G2")); |
|
73 |
|
74 // Cancel Request |
|
75 wcdmaService.EnumerateNifs(reqStatus, nifCount); |
|
76 wcdmaService.CancelAsyncRequest(EPacketEnumerateNifs); |
|
77 User::WaitForRequest(reqStatus); |
|
78 CHECKPOINT(reqStatus.Int(), KErrCancel, CHP_SRVS_CASE("A.3G2")) |
|
79 |
|
80 // Get NIF Information |
|
81 TInt nifIndex=1; // 2 NIFs are defined in the testdef.h file |
|
82 RPacketService::TNifInfoV2 nifInfoV2; |
|
83 RPacketService::TNifInfoV2Pckg nifInfoV2Pckg(nifInfoV2); |
|
84 |
|
85 wcdmaService.GetNifInfo(reqStatus, nifIndex, nifInfoV2Pckg); |
|
86 User::WaitForRequest(reqStatus); |
|
87 |
|
88 CHECKPOINT(reqStatus.Int(),KErrNone,CHP_SRVS_CASE("A.3G3")); |
|
89 CHECKPOINT_COMP_STR(nifInfoV2.iContextName,DPCKTTSY_NIF_CONTEXT1,CHP_SRVS_CASE("A.3G3")); |
|
90 CHECKPOINT(nifInfoV2.iNumberOfContexts,DPCKTTSY_NUMBER_OF_CONTEXTS_IN_NIF1,CHP_SRVS_CASE("A.3G3")); |
|
91 CHECKPOINT(nifInfoV2.iNifStatus,DPCKTTSY_CONTEXT_INFO_STATUS0,CHP_SRVS_CASE("A.3G3")); |
|
92 CHECKPOINT_COMP_STR(nifInfoV2.iPdpAddress,DPCKTTSY_PDP_ADDRESS1,CHP_SRVS_CASE("A.3G3")); |
|
93 CHECKPOINT(nifInfoV2.iContextType,DPCKTTSY_INTERNAL_CONTEXT,CHP_SRVS_CASE("A.3G3")); |
|
94 |
|
95 // Cancel Request |
|
96 wcdmaService.GetNifInfo(reqStatus, nifIndex, nifInfoV2Pckg); |
|
97 wcdmaService.CancelAsyncRequest(EPacketGetNifInfo); |
|
98 User::WaitForRequest(reqStatus); |
|
99 CHECKPOINT(reqStatus.Int(), KErrCancel, CHP_SRVS_CASE("A.3G3")) |
|
100 |
|
101 // Enumerate Contexts in NIF |
|
102 TInt nifContextCount; |
|
103 TBufC<DPCKTTSY_NIF_NAME_LENGTH> existingContextName=DPCKTTSY_NIF_CONTEXT2; |
|
104 |
|
105 wcdmaService.EnumerateContextsInNif(reqStatus, existingContextName, nifContextCount); |
|
106 User::WaitForRequest(reqStatus); |
|
107 |
|
108 CHECKPOINT(reqStatus.Int(),KErrNone,CHP_SRVS_CASE("A.3G4")); |
|
109 CHECKPOINT(nifContextCount,DPCKTTSY_NUMBER_OF_CONTEXTS_IN_NIF2,CHP_SRVS_CASE("A.3G4")); |
|
110 |
|
111 // Cancel Request |
|
112 wcdmaService.EnumerateContextsInNif(reqStatus, existingContextName, nifContextCount); |
|
113 wcdmaService.CancelAsyncRequest(EPacketEnumerateContextsInNif); |
|
114 User::WaitForRequest(reqStatus); |
|
115 CHECKPOINT(reqStatus.Int(), KErrCancel, CHP_SRVS_CASE("A.3G4")) |
|
116 |
|
117 // Get Context name in NIF |
|
118 TInt contextIndex=1; |
|
119 TName contextName; |
|
120 |
|
121 wcdmaService.GetContextNameInNif(reqStatus, existingContextName, contextIndex, contextName); |
|
122 User::WaitForRequest(reqStatus); |
|
123 |
|
124 CHECKPOINT(reqStatus.Int(),KErrNone,CHP_SRVS_CASE("A.3G5")); |
|
125 CHECKPOINT_COMP_STR(contextName,DPCKTTSY_CONTEXT2_IN_NIF2,CHP_SRVS_CASE("A.3G5")); |
|
126 |
|
127 |
|
128 // Cancel Request |
|
129 wcdmaService.GetContextNameInNif(reqStatus, existingContextName, contextIndex, contextName); |
|
130 wcdmaService.CancelAsyncRequest(EPacketGetContextNameInNif); |
|
131 User::WaitForRequest(reqStatus); |
|
132 CHECKPOINT(reqStatus.Int(), KErrCancel, CHP_SRVS_CASE("A.3G5")) |
|
133 |
|
134 // Change Request: NDOE-57BHUF. |
|
135 // Get Current Packet Release mode |
|
136 RPacketService::TPacketReleaseMode releaseMode; |
|
137 wcdmaService.GetCurrentReleaseMode(reqStatus, releaseMode); |
|
138 User::WaitForRequest(reqStatus); |
|
139 CHECKPOINT(reqStatus.Int(),KErrNone,CHP_SRVS_CASE("A.3G6")); |
|
140 CHECKPOINT(releaseMode,DPCKTTSY_NETWORK_MODE1,CHP_SRVS_CASE("A.3G6")); |
|
141 |
|
142 // Cancel Get Current Packet Release mode |
|
143 wcdmaService.GetCurrentReleaseMode(reqStatus, releaseMode); |
|
144 wcdmaService.CancelAsyncRequest(EPacketGetCurrentReleaseMode); |
|
145 User::WaitForRequest(reqStatus); |
|
146 CHECKPOINT(reqStatus.Int(),KErrCancel,CHP_SRVS_CASE("A.3G6")); |
|
147 |
|
148 // Roaming notification - NotifyReleaseModeChange() method |
|
149 wcdmaService.NotifyReleaseModeChange(reqStatus, releaseMode); |
|
150 User::WaitForRequest(reqStatus); |
|
151 CHECKPOINT(reqStatus.Int(),KErrNone,CHP_SRVS_CASE("A.3G7")); |
|
152 CHECKPOINT(releaseMode,DPCKTTSY_NETWORK_MODE2,CHP_SRVS_CASE("A.3G7")); |
|
153 |
|
154 // Cancel Roaming notification - NotifyReleaseModeChange() method |
|
155 wcdmaService.NotifyReleaseModeChange(reqStatus, releaseMode); |
|
156 wcdmaService.CancelAsyncRequest(EPacketNotifyReleaseModeChange); |
|
157 User::WaitForRequest(reqStatus); |
|
158 CHECKPOINT(reqStatus.Int(),KErrCancel,CHP_SRVS_CASE("A.3G7")); |
|
159 |
|
160 //DeactivateNIF |
|
161 wcdmaService.DeactivateNIF(reqStatus, DPCKTTSY_NIF_CONTEXT1); |
|
162 User::WaitForRequest(reqStatus); |
|
163 CHECKPOINT(reqStatus.Int(),KErrNone,CHP_SRVS_CASE("A.3G8")); |
|
164 |
|
165 //Cancel DeactivateNIF |
|
166 wcdmaService.DeactivateNIF(reqStatus, DPCKTTSY_NIF_CONTEXT1); |
|
167 wcdmaService.CancelAsyncRequest(EPacketDeactivateNIF); |
|
168 User::WaitForRequest(reqStatus); |
|
169 CHECKPOINT(reqStatus.Int(),KErrCancel,CHP_SRVS_CASE("A.3G8")); |
|
170 |
|
171 wcdmaService.Close(); |
|
172 pcktPhone.Close(); |
|
173 |
|
174 return TestStepResult(); |
|
175 } |