|
1 // Copyright (c) 2007-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 // Test step definitions for the PhoneCapability functional unit. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @internalTechnology |
|
20 */ |
|
21 |
|
22 #include "cctsyintegrationtestphonecapability.h" |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 CCTSYIntegrationTestPhoneCapabilityBase::CCTSYIntegrationTestPhoneCapabilityBase(CEtelSessionMgr& aEtelSessionMgr) |
|
28 : CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr) |
|
29 /** |
|
30 * Constructor |
|
31 */ |
|
32 { |
|
33 } |
|
34 |
|
35 CCTSYIntegrationTestPhoneCapabilityBase::~CCTSYIntegrationTestPhoneCapabilityBase() |
|
36 /* |
|
37 * Destructor |
|
38 */ |
|
39 { |
|
40 } |
|
41 |
|
42 |
|
43 CCTSYIntegrationTestPhoneCapability0001::CCTSYIntegrationTestPhoneCapability0001(CEtelSessionMgr& aEtelSessionMgr) |
|
44 : CCTSYIntegrationTestPhoneCapabilityBase(aEtelSessionMgr) |
|
45 /** |
|
46 * Constructor. |
|
47 */ |
|
48 { |
|
49 SetTestStepName(CCTSYIntegrationTestPhoneCapability0001::GetTestStepName()); |
|
50 } |
|
51 |
|
52 CCTSYIntegrationTestPhoneCapability0001::~CCTSYIntegrationTestPhoneCapability0001() |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 { |
|
57 } |
|
58 |
|
59 TVerdict CCTSYIntegrationTestPhoneCapability0001::doTestStepL() |
|
60 /** |
|
61 * @SYMTestCaseID BA-CTSY-INT-PCAP-0001 |
|
62 * @SYMFssID BA/CTSY/PCAP-0001 |
|
63 * @SYMTestCaseDesc Get multimode capabilities. |
|
64 * @SYMTestPriority High |
|
65 * @SYMTestActions |
|
66 * @SYMTestExpectedResults Pass - Correct caps returned. |
|
67 * @SYMTestType CIT |
|
68 * @SYMTestCaseDependencies live/automatic |
|
69 * |
|
70 * Reason for test: Verify correct caps are returned. |
|
71 * |
|
72 * @return - TVerdict code |
|
73 */ |
|
74 { |
|
75 |
|
76 // |
|
77 // SET UP |
|
78 // |
|
79 |
|
80 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
81 |
|
82 |
|
83 // |
|
84 // SET UP END |
|
85 // |
|
86 |
|
87 StartTest(); |
|
88 |
|
89 // |
|
90 // TEST START |
|
91 // |
|
92 |
|
93 |
|
94 // Check RMobilePhone::GetMultimodeCaps returns caps in set of RMobilePhone::KCapsGsmSupported RMobilePhone::KCapsGprsSupported |
|
95 |
|
96 TUint32 caps; |
|
97 TUint32 expectedCaps = RMobilePhone::KCapsGsmSupported | RMobilePhone::KCapsGprsSupported; |
|
98 TUint32 unwantedCaps = 0; |
|
99 |
|
100 ASSERT_EQUALS(phone.GetMultimodeCaps(caps), KErrNone, |
|
101 _L("RMobilePhone::GetMultimodeCaps returned with an error.")) |
|
102 |
|
103 ASSERT_BITS_SET(caps, expectedCaps, unwantedCaps, _L("RMobilePhone::GetMultimodeCaps returned wrong multimode caps")) |
|
104 |
|
105 // |
|
106 // TEST END |
|
107 // |
|
108 |
|
109 StartCleanup(); |
|
110 |
|
111 // Put any required test clean up here, then remove this comment |
|
112 |
|
113 return TestStepResult(); |
|
114 } |
|
115 |
|
116 TPtrC CCTSYIntegrationTestPhoneCapability0001::GetTestStepName() |
|
117 /** |
|
118 * @return The test step name. |
|
119 */ |
|
120 { |
|
121 return _L("CCTSYIntegrationTestPhoneCapability0001"); |
|
122 } |
|
123 |
|
124 |
|
125 |
|
126 CCTSYIntegrationTestPhoneCapability0002::CCTSYIntegrationTestPhoneCapability0002(CEtelSessionMgr& aEtelSessionMgr) |
|
127 : CCTSYIntegrationTestPhoneCapabilityBase(aEtelSessionMgr) |
|
128 /** |
|
129 * Constructor. |
|
130 */ |
|
131 { |
|
132 SetTestStepName(CCTSYIntegrationTestPhoneCapability0002::GetTestStepName()); |
|
133 } |
|
134 |
|
135 CCTSYIntegrationTestPhoneCapability0002::~CCTSYIntegrationTestPhoneCapability0002() |
|
136 /** |
|
137 * Destructor. |
|
138 */ |
|
139 { |
|
140 } |
|
141 |
|
142 TVerdict CCTSYIntegrationTestPhoneCapability0002::doTestStepL() |
|
143 /** |
|
144 * @SYMTestCaseID BA-CTSY-INT-PCAP-0002 |
|
145 * @SYMFssID BA/CTSY/PCAP-0002 |
|
146 * @SYMTestCaseDesc Cancel request for phone capability change notification. |
|
147 * @SYMTestPriority High |
|
148 * @SYMTestActions RPhone::NotifyCapsChangeCancel |
|
149 * @SYMTestExpectedResults Pass - KErrCancel returned on cancellation. |
|
150 * @SYMTestType CIT |
|
151 * @SYMTestCaseDependencies live/automatic |
|
152 * |
|
153 * Reason for test: Verify KErrCancel returned. |
|
154 * |
|
155 * @return - TVerdict code |
|
156 */ |
|
157 { |
|
158 |
|
159 // |
|
160 // SET UP |
|
161 // |
|
162 |
|
163 RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone); |
|
164 |
|
165 // |
|
166 // SET UP END |
|
167 // |
|
168 |
|
169 StartTest(); |
|
170 |
|
171 // |
|
172 // TEST START |
|
173 // |
|
174 |
|
175 TRequestStatus status; |
|
176 |
|
177 // Call RPhone::NotifyCapsChange. |
|
178 |
|
179 RPhone::TCaps caps; |
|
180 |
|
181 phone.NotifyCapsChange(status, caps); |
|
182 |
|
183 User::After(1000000); |
|
184 |
|
185 // Check RPhone::NotifyCapsChangeCancel completes with KErrCancel. |
|
186 |
|
187 phone.NotifyCapsChangeCancel(); |
|
188 |
|
189 User::WaitForRequest(status); |
|
190 |
|
191 ASSERT_TRUE(status==KErrCancel, _L("RMobilePhone::NotifyCapsChangeCancel status is not KErrCancel.")) |
|
192 |
|
193 // |
|
194 // TEST END |
|
195 // |
|
196 |
|
197 StartCleanup(); |
|
198 |
|
199 // Put any required test clean up here, then remove this comment |
|
200 |
|
201 return TestStepResult(); |
|
202 } |
|
203 |
|
204 TPtrC CCTSYIntegrationTestPhoneCapability0002::GetTestStepName() |
|
205 /** |
|
206 * @return The test step name. |
|
207 */ |
|
208 { |
|
209 return _L("CCTSYIntegrationTestPhoneCapability0002"); |
|
210 } |
|
211 |
|
212 |
|
213 |