|
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_cphsingleandcallsetupandwait.h" |
|
19 #include <EUnitMacros.h> |
|
20 #include <EUnitDecorators.h> |
|
21 #include <featmgr.h> |
|
22 #include "CPhoneSingleAndCallSetupAndWaiting.h" |
|
23 #include "PEVirtualEngine.h" |
|
24 #include "CPhoneViewControllerStub.h" |
|
25 #include "CPhoneStateMachineStub.h" |
|
26 #include "MPhoneKeyEvents.h" |
|
27 #include "TPhoneCommandParam.h" |
|
28 #include "CPhoneMainResourceResolver.h" |
|
29 #include "phoneappcommands.hrh" |
|
30 |
|
31 |
|
32 // - Construction ----------------------------------------------------------- |
|
33 |
|
34 ut_cphsingleandcallsetupandwait* ut_cphsingleandcallsetupandwait::NewL() |
|
35 { |
|
36 ut_cphsingleandcallsetupandwait* self = ut_cphsingleandcallsetupandwait::NewLC(); |
|
37 CleanupStack::Pop(); |
|
38 return self; |
|
39 } |
|
40 |
|
41 ut_cphsingleandcallsetupandwait* ut_cphsingleandcallsetupandwait::NewLC() |
|
42 { |
|
43 ut_cphsingleandcallsetupandwait* self = new( ELeave ) ut_cphsingleandcallsetupandwait(); |
|
44 CleanupStack::PushL( self ); |
|
45 self->ConstructL(); |
|
46 return self; |
|
47 } |
|
48 |
|
49 ut_cphsingleandcallsetupandwait::~ut_cphsingleandcallsetupandwait() |
|
50 { |
|
51 } |
|
52 |
|
53 ut_cphsingleandcallsetupandwait::ut_cphsingleandcallsetupandwait() |
|
54 { |
|
55 } |
|
56 |
|
57 void ut_cphsingleandcallsetupandwait::ConstructL() |
|
58 { |
|
59 CEUnitTestSuiteClass::ConstructL(); |
|
60 } |
|
61 |
|
62 // - Test methods ----------------------------------------------------------- |
|
63 |
|
64 |
|
65 |
|
66 void ut_cphsingleandcallsetupandwait::SetupL( ) |
|
67 { |
|
68 iViewCommandHandle = CPhoneViewController::NewL(); |
|
69 iStateMachine = CPhoneStateMachineStub::NewL(); |
|
70 |
|
71 iStateSingleAndCallSetupAndWaiting = CPhoneSingleAndCallSetupAndWaiting::NewL( |
|
72 iStateMachine, iViewCommandHandle, NULL ); |
|
73 |
|
74 } |
|
75 |
|
76 |
|
77 void ut_cphsingleandcallsetupandwait::Teardown( ) |
|
78 { |
|
79 delete CPhoneMainResourceResolver::Instance(); |
|
80 delete iStateSingleAndCallSetupAndWaiting; |
|
81 delete iViewCommandHandle; |
|
82 delete iStateMachine; |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // Test conference idle |
|
87 // -check commands |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 void ut_cphsingleandcallsetupandwait::T_HandleIdleL( ) |
|
91 { |
|
92 |
|
93 iViewCommandHandle->SetViewGetCountOfActiveCalls(1); |
|
94 |
|
95 iStateSingleAndCallSetupAndWaiting->HandlePhoneEngineMessageL( MEngineMonitor::EPEMessageIdle, 0 ); |
|
96 |
|
97 iViewCommandHandle->VerifyViewCommand( EPhoneViewRemoveCallHeader ); |
|
98 |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // Test callsetup fail with reason remote busy. |
|
103 // -check commands |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 void ut_cphsingleandcallsetupandwait::T_RemoteBusyL( ) |
|
107 { |
|
108 // At the moment ut_cphsingleandcallsetupandwait uses cphonestatestub and because of this |
|
109 // we cant check/verify EPhoneViewStopCapturingKey command since it is called from cphonestate |
|
110 // and because test uses cphonestatestub+cphonestate.h(original) we cant check if CaptureKeysDuringCallNotificationL |
|
111 // was called. |
|
112 // When this test dll is transfered to use MOCK FW this case can be made fully functional. |
|
113 /*iStateSingleAndCallSetupAndWaiting->HandlePhoneEngineMessageL( MEngineMonitor::EPEMessageRemoteBusy, 0 ); |
|
114 |
|
115 iViewCommandHandle->VerifyViewCommand( EPhoneViewStopCapturingKey ); */ |
|
116 } |
|
117 |
|
118 // - EUnit test table ------------------------------------------------------- |
|
119 |
|
120 EUNIT_BEGIN_TEST_TABLE( |
|
121 ut_cphsingleandcallsetupandwait, |
|
122 "Add test suite description here.", |
|
123 "UNIT" ) |
|
124 |
|
125 |
|
126 EUNIT_TEST( |
|
127 "2- CPhoneSingleAndCallSetupAndWaiting: Test idle", |
|
128 "", |
|
129 "Test0", |
|
130 "FUNCTIONALITY", |
|
131 SetupL, T_HandleIdleL, Teardown ) |
|
132 |
|
133 /*EUNIT_TEST( |
|
134 "3- CPhoneSingleAndCallSetupAndWaiting: Test remote busy", |
|
135 "", |
|
136 "Test0", |
|
137 "FUNCTIONALITY", |
|
138 SetupL, T_RemoteBusyL, Teardown ) */ |
|
139 |
|
140 EUNIT_END_TEST_TABLE |