|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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: test functions for alfvisual.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 |
|
25 #include "testplatalfvisual.h" |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS =============================== |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CTestPlatAlfVisual::TestAlfCtrlGroupResourceId |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 TInt CTestPlatAlfVisual::TestAlfCtrlGroupResourceId( CStifItemParser& /*aItem*/ ) |
|
34 { |
|
35 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
36 _LIT( KTestAlfCtrlGroupResourceIdL, "TestAlfCtrlGroupResourceIdL" ); |
|
37 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGroupResourceIdL ); |
|
38 // Print to log file |
|
39 iLog->Log( KTestAlfCtrlGroupResourceIdL ); |
|
40 |
|
41 TInt vId = iAlfCtrlGroup->ResourceId(); |
|
42 STIF_ASSERT_EQUALS( 1, vId ); |
|
43 |
|
44 return KErrNone; |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CTestPlatAlfVisual::TestAlfCtrlGroupProcessCtrlL |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 TInt CTestPlatAlfVisual::TestAlfCtrlGroupProcessCtrlL( CStifItemParser& /*aItem*/ ) |
|
52 { |
|
53 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
54 _LIT( KTestAlfCtrlGroupProcessCtrlL, "TestAlfCtrlGroupProcessCtrlL" ); |
|
55 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGroupProcessCtrlL ); |
|
56 // Print to log file |
|
57 iLog->Log( KTestAlfCtrlGroupProcessCtrlL ); |
|
58 |
|
59 CAlfControl* ctrl = new ( ELeave ) CAlfControl; |
|
60 CleanupStack::PushL( ctrl ); |
|
61 ctrl->ConstructL( *iAlfEnv ); |
|
62 const TInt num = 23; |
|
63 ctrl->SetId( num ); |
|
64 iAlfCtrlGroup->AppendL( ctrl ); |
|
65 STIF_ASSERT_EQUALS( 2, iAlfCtrlGroup->Count() ); |
|
66 CAlfControl* foundControl = &iAlfCtrlGroup->Control( 1 ); |
|
67 STIF_ASSERT_EQUALS( (TInt)ctrl, (TInt)foundControl ); |
|
68 iAlfCtrlGroup->FindControl( num ); |
|
69 foundControl = iAlfCtrlGroup->FindControl( num ); |
|
70 STIF_ASSERT_NOT_EQUALS( 0, (TInt)foundControl ); |
|
71 iAlfCtrlGroup->Remove( ctrl ); |
|
72 CleanupStack::PopAndDestroy( ctrl ); |
|
73 |
|
74 return KErrNone; |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CTestPlatAlfVisual::TestAlfCtrlGroupProcessInput |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 TInt CTestPlatAlfVisual::TestAlfCtrlGroupProcessInput( CStifItemParser& /*aItem*/ ) |
|
82 { |
|
83 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
84 _LIT( KTestAlfCtrlGroupProcessInput, "TestAlfCtrlGroupProcessInput" ); |
|
85 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGroupProcessInput ); |
|
86 // Print to log file |
|
87 iLog->Log( KTestAlfCtrlGroupProcessInput ); |
|
88 |
|
89 iAlfCtrlGroup->SetAcceptInput( ETrue ); |
|
90 STIF_ASSERT_TRUE( iAlfCtrlGroup->AcceptInput() ); |
|
91 |
|
92 return KErrNone; |
|
93 } |
|
94 |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CTestPlatAlfVisual::TestAlfCtrlGroupProcessTransformL |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 TInt CTestPlatAlfVisual::TestAlfCtrlGroupProcessTransformL( CStifItemParser& /*aItem*/ ) |
|
101 { |
|
102 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
103 _LIT( KTestAlfCtrlGroupProcessTransformL, "TestAlfCtrlGroupProcessTransformL" ); |
|
104 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGroupProcessTransformL ); |
|
105 // Print to log file |
|
106 iLog->Log( KTestAlfCtrlGroupProcessTransformL ); |
|
107 |
|
108 iAlfCtrlGroup->EnableTransformationL( ETrue ); |
|
109 STIF_ASSERT_TRUE( iAlfCtrlGroup->IsTransformed() ); |
|
110 iAlfCtrlGroup->Transformation(); |
|
111 iAlfCtrlGroup->EnableTransformationL( EFalse ); |
|
112 STIF_ASSERT_FALSE( iAlfCtrlGroup->IsTransformed() ); |
|
113 |
|
114 return KErrNone; |
|
115 } |
|
116 |
|
117 // End of file |
|
118 |