|
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 alf client server api |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <coemain.h> |
|
23 #include <stifparser.h> |
|
24 #include <stiftestinterface.h> |
|
25 #include <alf/alfappserver.h> |
|
26 #include <alf/alfappsrvsessionbase.h> |
|
27 #include <aknserverapp.h> |
|
28 |
|
29 #include "testplatclientserver.h" |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CTestPlatClientServer::TestServerNewAppServerL |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 TInt CTestPlatClientServer::TestServerNewAppServerL( CStifItemParser& /*aItem*/ ) |
|
36 { |
|
37 |
|
38 // Print to UI |
|
39 _LIT( Ktestplatclientserver, "testplatclientserver" ); |
|
40 _LIT( KTestServerNewAppServerL, "In TestServerNewAppServerL" ); |
|
41 TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerNewAppServerL ); |
|
42 // Print to log file |
|
43 iLog->Log( KTestServerNewAppServerL ); |
|
44 |
|
45 CAlfAppServer* appServer = CAlfAppServer::NewAppServerL(); |
|
46 delete appServer; |
|
47 |
|
48 return KErrNone; |
|
49 |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CTestPlatClientServer::TestServerHandleClientExitL |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 TInt CTestPlatClientServer::TestServerHandleClientExitL( CStifItemParser& /*aItem*/ ) |
|
57 { |
|
58 |
|
59 // Print to UI |
|
60 _LIT( Ktestplatclientserver, "testplatclientserver" ); |
|
61 _LIT( KTestServerHandleClientExitL, "In TestServerHandleClientExitL" ); |
|
62 TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerHandleClientExitL ); |
|
63 // Print to log file |
|
64 iLog->Log( KTestServerHandleClientExitL ); |
|
65 |
|
66 CAlfAppServer* appServer = CAlfAppServer::NewAppServerL(); |
|
67 CleanupStack::PushL( appServer ); |
|
68 |
|
69 appServer->HandleClientExit( 0 ); |
|
70 |
|
71 CleanupStack::PopAndDestroy( appServer ); |
|
72 return KErrNone; |
|
73 |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CTestPlatClientServer::TestServerAdjustWindowGroupPositionL |
|
78 // ----------------------------------------------------------------------------- |
|
79 // |
|
80 TInt CTestPlatClientServer::TestServerAdjustWindowGroupPositionL( |
|
81 CStifItemParser& /*aItem*/ ) |
|
82 { |
|
83 |
|
84 // Print to UI |
|
85 _LIT( Ktestplatclientserver, "testplatclientserver" ); |
|
86 _LIT( KTestServerAdjustWindowGroupPositionL, |
|
87 "In TestServerAdjustWindowGroupPositionL" ); |
|
88 TestModuleIf().Printf( 0, Ktestplatclientserver, |
|
89 KTestServerAdjustWindowGroupPositionL ); |
|
90 // Print to log file |
|
91 iLog->Log( KTestServerAdjustWindowGroupPositionL ); |
|
92 |
|
93 CAlfAppServer* appServer = CAlfAppServer::NewAppServerL(); |
|
94 CleanupStack::PushL( appServer ); |
|
95 |
|
96 CCoeEnv* coe = CCoeEnv::Static(); |
|
97 RWindowGroup& mainWg = coe->RootWin(); |
|
98 appServer->AdjustWindowGroupPositionL( mainWg, 1, CAlfAppServer::EBehindOfParent ); |
|
99 |
|
100 CleanupStack::PopAndDestroy( appServer ); |
|
101 |
|
102 return KErrNone; |
|
103 |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CTestPlatClientServer::TestServerWsSessionL |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 TInt CTestPlatClientServer::TestServerWsSessionL( |
|
111 CStifItemParser& /*aItem*/ ) |
|
112 { |
|
113 |
|
114 // Print to UI |
|
115 _LIT( Ktestplatclientserver, "testplatclientserver" ); |
|
116 _LIT( KTestServerWsSessionL, "In TestServerWsSessionL" ); |
|
117 TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerWsSessionL ); |
|
118 // Print to log file |
|
119 iLog->Log( KTestServerWsSessionL ); |
|
120 |
|
121 CAlfAppServer* appServer = CAlfAppServer::NewAppServerL(); |
|
122 CleanupStack::PushL( appServer ); |
|
123 |
|
124 appServer->WsSession(); |
|
125 |
|
126 CleanupStack::PopAndDestroy( appServer ); |
|
127 |
|
128 return KErrNone; |
|
129 |
|
130 } |
|
131 |
|
132 // ----------------------------------------------------------------------------- |
|
133 // CTestPlatClientServer::TestServerMetricsInterfaceL |
|
134 // ----------------------------------------------------------------------------- |
|
135 // |
|
136 TInt CTestPlatClientServer::TestServerMetricsInterfaceL( |
|
137 CStifItemParser& /*aItem*/ ) |
|
138 { |
|
139 |
|
140 // Print to UI |
|
141 _LIT( Ktestplatclientserver, "testplatclientserver" ); |
|
142 _LIT( KTestServerMetricsInterfaceL, |
|
143 "In TestServerMetricsInterfaceL" ); |
|
144 TestModuleIf().Printf( 0, Ktestplatclientserver, |
|
145 KTestServerMetricsInterfaceL ); |
|
146 // Print to log file |
|
147 iLog->Log( KTestServerMetricsInterfaceL ); |
|
148 |
|
149 CAlfAppServer* appServer = CAlfAppServer::NewAppServerL(); |
|
150 CleanupStack::PushL( appServer ); |
|
151 |
|
152 appServer->MetricsInterface(); |
|
153 |
|
154 CleanupStack::PopAndDestroy( appServer ); |
|
155 |
|
156 return KErrNone; |
|
157 |
|
158 } |
|
159 |
|
160 // ----------------------------------------------------------------------------- |
|
161 // CTestPlatClientServer::TestServerMetricsInterfaceConstL |
|
162 // ----------------------------------------------------------------------------- |
|
163 // |
|
164 TInt CTestPlatClientServer::TestServerMetricsInterfaceConstL( |
|
165 CStifItemParser& /*aItem*/ ) |
|
166 { |
|
167 |
|
168 // Print to UI |
|
169 _LIT( Ktestplatclientserver, "testplatclientserver" ); |
|
170 _LIT( KTestServerMetricsInterfaceConstL, |
|
171 "In TestServerMetricsInterfaceConstL" ); |
|
172 TestModuleIf().Printf( 0, Ktestplatclientserver, |
|
173 KTestServerMetricsInterfaceConstL ); |
|
174 // Print to log file |
|
175 iLog->Log( KTestServerMetricsInterfaceConstL ); |
|
176 |
|
177 CAlfAppServer* appServer = CAlfAppServer::NewAppServerL(); |
|
178 CleanupStack::PushL( appServer ); |
|
179 |
|
180 ( ( const CAlfAppServer* ) appServer )->MetricsInterface(); |
|
181 |
|
182 CleanupStack::PopAndDestroy( appServer ); |
|
183 |
|
184 return KErrNone; |
|
185 |
|
186 } |
|
187 |
|
188 // ----------------------------------------------------------------------------- |
|
189 // CTestPlatClientServer::TestServerSetMetricsInterfaceL |
|
190 // ----------------------------------------------------------------------------- |
|
191 // |
|
192 TInt CTestPlatClientServer::TestServerSetMetricsInterfaceL( |
|
193 CStifItemParser& /*aItem*/ ) |
|
194 { |
|
195 |
|
196 // Print to UI |
|
197 _LIT( Ktestplatclientserver, "testplatclientserver" ); |
|
198 _LIT( KTestServerSetMetricsInterfaceL, "In TestServerSetMetricsInterfaceL" ); |
|
199 TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerSetMetricsInterfaceL ); |
|
200 // Print to log file |
|
201 iLog->Log( KTestServerSetMetricsInterfaceL ); |
|
202 |
|
203 CAlfAppServer* appServer = CAlfAppServer::NewAppServerL(); |
|
204 CleanupStack::PushL( appServer ); |
|
205 |
|
206 appServer->SetMetricsInterface( NULL ); |
|
207 |
|
208 CleanupStack::PopAndDestroy( appServer ); |
|
209 |
|
210 return KErrNone; |
|
211 } |
|
212 |
|
213 // ----------------------------------------------------------------------------- |
|
214 // CTestPlatClientServer::TestServerAppUiL |
|
215 // ----------------------------------------------------------------------------- |
|
216 // |
|
217 TInt CTestPlatClientServer::TestServerAppUiL( |
|
218 CStifItemParser& /*aItem*/ ) |
|
219 { |
|
220 |
|
221 // Print to UI |
|
222 _LIT( Ktestplatclientserver, "testplatclientserver" ); |
|
223 _LIT( KTestServerAppUiL, "In TestServerAppUiL" ); |
|
224 TestModuleIf().Printf( 0, Ktestplatclientserver, KTestServerAppUiL ); |
|
225 // Print to log file |
|
226 iLog->Log( KTestServerAppUiL ); |
|
227 |
|
228 CAlfAppServer* appServer = CAlfAppServer::NewAppServerL(); |
|
229 CleanupStack::PushL( appServer ); |
|
230 |
|
231 appServer->AppUi(); |
|
232 |
|
233 CleanupStack::PopAndDestroy( appServer ); |
|
234 |
|
235 return KErrNone; |
|
236 } |
|
237 |
|
238 // [End of File] |