86
|
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 |
// INCLUDE FILES
|
|
18 |
#include <MenuSatInterface.h>
|
|
19 |
#include "menusatinterfacetest.h"
|
|
20 |
|
|
21 |
|
|
22 |
// CONSTANTS
|
|
23 |
_LIT( KSatName, "Plus Mega" );
|
|
24 |
|
|
25 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
26 |
|
|
27 |
|
|
28 |
void CMenuSatInterfaceTest::Test_SatUiVisibleL()
|
|
29 |
{
|
|
30 |
TInt result (KErrGeneral);
|
|
31 |
|
|
32 |
TBool visible = ETrue;
|
|
33 |
TRAP(result,
|
|
34 |
CMenuSATInterface* interface = new(ELeave) CMenuSATInterface();
|
|
35 |
CleanupStack::PushL( interface );
|
|
36 |
|
|
37 |
interface->MakeSatUiVisible( visible, KSatName );
|
|
38 |
CleanupStack::PopAndDestroy( interface );
|
|
39 |
);
|
|
40 |
TBuf<256> name;
|
|
41 |
TInt error = RProperty::Get( KCRUidCa, KCaSatUIName, name );
|
|
42 |
|
|
43 |
if( name == KSatName()
|
|
44 |
&& error == KErrNone )
|
|
45 |
{
|
|
46 |
result = KErrNone;
|
|
47 |
}
|
|
48 |
QVERIFY(result == KErrNone);
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
//
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
void CMenuSatInterfaceTest::Test_SatUiVisibleIconIdL()
|
|
56 |
{
|
|
57 |
TInt result (KErrGeneral);
|
|
58 |
|
|
59 |
TBool visible = ETrue;
|
|
60 |
TUint8 iconInfoId = 21;
|
|
61 |
TRAP(result,
|
|
62 |
CMenuSATInterface* interface = new(ELeave) CMenuSATInterface();
|
|
63 |
CleanupStack::PushL( interface );
|
|
64 |
interface->MakeSatUiVisible( visible, KSatName, iconInfoId );
|
|
65 |
CleanupStack::PopAndDestroy( interface );
|
|
66 |
);
|
|
67 |
TInt iconInfoIdTest = -1;
|
|
68 |
RProperty::Get( KCRUidCa, KCaSatUIIconId, iconInfoIdTest );
|
|
69 |
|
|
70 |
if( iconInfoIdTest == iconInfoId )
|
|
71 |
{
|
|
72 |
result = KErrNone;
|
|
73 |
}
|
|
74 |
QVERIFY(result == KErrNone);
|
|
75 |
}
|
|
76 |
|
|
77 |
// ---------------------------------------------------------------------------
|
|
78 |
//
|
|
79 |
// ---------------------------------------------------------------------------
|
|
80 |
//
|
|
81 |
void CMenuSatInterfaceTest::Test_SatInterfaceConstructL()
|
|
82 |
{
|
|
83 |
TInt result (KErrGeneral);
|
|
84 |
|
|
85 |
TRAP(result,
|
|
86 |
CMenuSATInterface* interface = new(ELeave) CMenuSATInterface();
|
|
87 |
if( interface )
|
|
88 |
{
|
|
89 |
result = KErrNone;
|
|
90 |
}
|
|
91 |
);
|
|
92 |
QVERIFY(result == KErrNone);
|
|
93 |
}
|
|
94 |
|
|
95 |
QTEST_MAIN(CMenuSatInterfaceTest)
|
|
96 |
// End of File
|