|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "ut_cphonetwosinglesandwaiting.h" |
|
19 #include <EUnitMacros.h> |
|
20 #include <EUnitDecorators.h> |
|
21 #include <featmgr.h> |
|
22 #include "PEVirtualEngine.h" |
|
23 #include "CPhoneViewControllerStub.h" |
|
24 #include "CPhoneStateMachineStub.h" |
|
25 #include "MPhoneKeyEvents.h" |
|
26 #include "TPhoneCommandParam.h" |
|
27 #include "CPhoneMainResourceResolver.h" |
|
28 #include "phoneappcommands.hrh" |
|
29 |
|
30 #define protected public |
|
31 #include "CPhoneTwoSinglesAndWaiting.h" |
|
32 |
|
33 // - Construction ----------------------------------------------------------- |
|
34 |
|
35 ut_cphonetwosinglesandwaiting* ut_cphonetwosinglesandwaiting::NewL() |
|
36 { |
|
37 ut_cphonetwosinglesandwaiting* self = ut_cphonetwosinglesandwaiting::NewLC(); |
|
38 CleanupStack::Pop(); |
|
39 return self; |
|
40 } |
|
41 |
|
42 ut_cphonetwosinglesandwaiting* ut_cphonetwosinglesandwaiting::NewLC() |
|
43 { |
|
44 ut_cphonetwosinglesandwaiting* self = new( ELeave ) ut_cphonetwosinglesandwaiting(); |
|
45 CleanupStack::PushL( self ); |
|
46 self->ConstructL(); |
|
47 return self; |
|
48 } |
|
49 |
|
50 ut_cphonetwosinglesandwaiting::~ut_cphonetwosinglesandwaiting() |
|
51 { |
|
52 } |
|
53 |
|
54 ut_cphonetwosinglesandwaiting::ut_cphonetwosinglesandwaiting() |
|
55 { |
|
56 } |
|
57 |
|
58 void ut_cphonetwosinglesandwaiting::ConstructL() |
|
59 { |
|
60 CEUnitTestSuiteClass::ConstructL(); |
|
61 } |
|
62 |
|
63 // - Test methods ----------------------------------------------------------- |
|
64 |
|
65 void ut_cphonetwosinglesandwaiting::SetupL( ) |
|
66 { |
|
67 iViewCommandHandle = CPhoneViewController::NewL(); |
|
68 iStateMachine = CPhoneStateMachineStub::NewL(); |
|
69 |
|
70 iStateTwoSinglesAndWaiting = CPhoneTwoSinglesAndWaiting::NewL( |
|
71 iStateMachine, iViewCommandHandle, NULL ); |
|
72 |
|
73 } |
|
74 |
|
75 |
|
76 void ut_cphonetwosinglesandwaiting::Teardown( ) |
|
77 { |
|
78 delete CPhoneMainResourceResolver::Instance(); |
|
79 delete iStateTwoSinglesAndWaiting; |
|
80 delete iViewCommandHandle; |
|
81 delete iStateMachine; |
|
82 } |
|
83 |
|
84 // ----------------------------------------------------------------------------- |
|
85 // Test conference idle |
|
86 // -check commands |
|
87 // ----------------------------------------------------------------------------- |
|
88 // |
|
89 void ut_cphonetwosinglesandwaiting::T_HandleIdleL( ) |
|
90 { |
|
91 |
|
92 iViewCommandHandle->SetViewGetCountOfActiveCalls(1); |
|
93 |
|
94 iStateTwoSinglesAndWaiting->HandlePhoneEngineMessageL( MEngineMonitor::EPEMessageIdle, 0 ); |
|
95 |
|
96 iViewCommandHandle->VerifyViewCommand( EPhoneViewRemoveCallHeader ); |
|
97 |
|
98 } |
|
99 |
|
100 // - EUnit test table ------------------------------------------------------- |
|
101 |
|
102 EUNIT_BEGIN_TEST_TABLE( |
|
103 ut_cphonetwosinglesandwaiting, |
|
104 "Add test suite description here.", |
|
105 "UNIT" ) |
|
106 |
|
107 EUNIT_TEST( |
|
108 "1- CPhoneTwoSinglesAndWaiting: Test idle", |
|
109 "", |
|
110 "Test0", |
|
111 "FUNCTIONALITY", |
|
112 SetupL, T_HandleIdleL, Teardown) |
|
113 |
|
114 EUNIT_END_TEST_TABLE |