74
|
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"
|
78
|
29 |
#include <csmcmockcontext.h>
|
|
30 |
#include <smcdefaultvalue.h>
|
|
31 |
#include <msmcmockspecbuilder.h>
|
|
32 |
#include <smcobjecttotypemapper.h>
|
|
33 |
#include <smcmacros.h>
|
|
34 |
#include <msmcmockaction.h>
|
74
|
35 |
|
|
36 |
#define protected public
|
|
37 |
#include "CPhoneTwoSinglesAndWaiting.h"
|
|
38 |
|
|
39 |
// - Construction -----------------------------------------------------------
|
|
40 |
|
|
41 |
ut_cphonetwosinglesandwaiting* ut_cphonetwosinglesandwaiting::NewL()
|
|
42 |
{
|
|
43 |
ut_cphonetwosinglesandwaiting* self = ut_cphonetwosinglesandwaiting::NewLC();
|
|
44 |
CleanupStack::Pop();
|
|
45 |
return self;
|
|
46 |
}
|
|
47 |
|
|
48 |
ut_cphonetwosinglesandwaiting* ut_cphonetwosinglesandwaiting::NewLC()
|
|
49 |
{
|
|
50 |
ut_cphonetwosinglesandwaiting* self = new( ELeave ) ut_cphonetwosinglesandwaiting();
|
|
51 |
CleanupStack::PushL( self );
|
|
52 |
self->ConstructL();
|
|
53 |
return self;
|
|
54 |
}
|
|
55 |
|
|
56 |
ut_cphonetwosinglesandwaiting::~ut_cphonetwosinglesandwaiting()
|
|
57 |
{
|
78
|
58 |
CSmcMockContext::Release();
|
74
|
59 |
}
|
|
60 |
|
|
61 |
ut_cphonetwosinglesandwaiting::ut_cphonetwosinglesandwaiting()
|
|
62 |
{
|
|
63 |
}
|
|
64 |
|
|
65 |
void ut_cphonetwosinglesandwaiting::ConstructL()
|
|
66 |
{
|
|
67 |
CEUnitTestSuiteClass::ConstructL();
|
78
|
68 |
iMockContext = CSmcMockContext::InstanceL();
|
74
|
69 |
}
|
|
70 |
|
|
71 |
// - Test methods -----------------------------------------------------------
|
|
72 |
|
|
73 |
void ut_cphonetwosinglesandwaiting::SetupL( )
|
|
74 |
{
|
78
|
75 |
iMockContext->InitializeL();
|
74
|
76 |
iViewCommandHandle = CPhoneViewController::NewL();
|
|
77 |
iStateMachine = CPhoneStateMachineStub::NewL();
|
|
78 |
|
|
79 |
iStateTwoSinglesAndWaiting = CPhoneTwoSinglesAndWaiting::NewL(
|
|
80 |
iStateMachine, iViewCommandHandle, NULL );
|
|
81 |
|
|
82 |
}
|
|
83 |
|
|
84 |
|
|
85 |
void ut_cphonetwosinglesandwaiting::Teardown( )
|
|
86 |
{
|
|
87 |
delete CPhoneMainResourceResolver::Instance();
|
|
88 |
delete iStateTwoSinglesAndWaiting;
|
|
89 |
delete iViewCommandHandle;
|
|
90 |
delete iStateMachine;
|
78
|
91 |
iMockContext->Reset();
|
74
|
92 |
}
|
|
93 |
|
|
94 |
// -----------------------------------------------------------------------------
|
|
95 |
// Test conference idle
|
|
96 |
// -check commands
|
|
97 |
// -----------------------------------------------------------------------------
|
|
98 |
//
|
|
99 |
void ut_cphonetwosinglesandwaiting::T_HandleIdleL( )
|
|
100 |
{
|
|
101 |
|
|
102 |
iViewCommandHandle->SetViewGetCountOfActiveCalls(1);
|
|
103 |
|
|
104 |
iStateTwoSinglesAndWaiting->HandlePhoneEngineMessageL( MEngineMonitor::EPEMessageIdle, 0 );
|
|
105 |
|
|
106 |
iViewCommandHandle->VerifyViewCommand( EPhoneViewRemoveCallHeader );
|
|
107 |
|
|
108 |
}
|
|
109 |
|
|
110 |
// - EUnit test table -------------------------------------------------------
|
|
111 |
|
|
112 |
EUNIT_BEGIN_TEST_TABLE(
|
|
113 |
ut_cphonetwosinglesandwaiting,
|
|
114 |
"Add test suite description here.",
|
|
115 |
"UNIT" )
|
|
116 |
|
|
117 |
EUNIT_TEST(
|
|
118 |
"1- CPhoneTwoSinglesAndWaiting: Test idle",
|
|
119 |
"",
|
|
120 |
"Test0",
|
|
121 |
"FUNCTIONALITY",
|
|
122 |
SetupL, T_HandleIdleL, Teardown)
|
|
123 |
|
|
124 |
EUNIT_END_TEST_TABLE
|