|
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 // CONSTANTS |
|
28 _LIT8( KVisualTag, "visual" ); |
|
29 const TInt KBufSize = 64; |
|
30 |
|
31 // FORWARD DECLARATION |
|
32 class CTestCAlfControl : public CAlfControl |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * C++ default constructor. |
|
37 */ |
|
38 CTestCAlfControl(); |
|
39 |
|
40 /** |
|
41 * Destructor. |
|
42 */ |
|
43 ~CTestCAlfControl(); |
|
44 |
|
45 /** |
|
46 * It test protected function NotifyControlVisibility of CAlfControl |
|
47 * @param aIsVisible ETrue, if the control is now visible on the display. |
|
48 * EFalse, if the control is about to the hidden on the display. |
|
49 * @param aDisplay The display on which the control's visibility is changing. |
|
50 * return symbian error code |
|
51 */ |
|
52 TInt TestNotifyControlVisibility( TBool aIsVisible, CAlfDisplay& aDisplay ); |
|
53 |
|
54 /** |
|
55 * It test protected function VisualAddedL of CAlfControl |
|
56 * @param aVisual Visual that was added. |
|
57 * return symbian error code |
|
58 */ |
|
59 TInt TestVisualAddedL( CAlfVisual* aVisual ); |
|
60 |
|
61 /** |
|
62 * It test protected function VisualRemoved of CAlfControl |
|
63 * @param aVisual Visual that was removed. |
|
64 * return symbian error code |
|
65 */ |
|
66 TInt TestVisualRemoved( CAlfVisual* aVisual ); |
|
67 |
|
68 /** |
|
69 * It test protected function ConnectionAddedL of CAlfControl |
|
70 * @param aConnectedControl Connected child control |
|
71 * @parar aRole Role of the child control. |
|
72 * return symbian error code |
|
73 */ |
|
74 TInt TestConnectionAddedL( CAlfControl* aConnectedControl, |
|
75 TInt aRole ); |
|
76 |
|
77 /** |
|
78 * It test protected function ConnectionRemoved of CAlfControl |
|
79 * @param aConnectedControl Removed child control |
|
80 * @parar aRole Role of the child control. |
|
81 * return symbian error code |
|
82 */ |
|
83 TInt TestConnectionRemoved( CAlfControl* aConnectedControl, |
|
84 TInt aRole ); |
|
85 |
|
86 /** |
|
87 * It test protected function HostChangingL of CAlfControl |
|
88 * @param aNewHost New host control. If NULL, the host is removed. |
|
89 * return symbian error code |
|
90 */ |
|
91 TInt TestHostChangingL( CAlfControl* aNewHost ); |
|
92 |
|
93 /* |
|
94 * It test protected function VisualAddedL of CAlfControl |
|
95 * @param aExtensionUid extension uid |
|
96 * @parar aExtensionParams extension parameters |
|
97 * return symbian error code |
|
98 * */ |
|
99 TInt TestPropertyOwnerExtension(const TUid& aExtensionUid, |
|
100 TAny** aExtensionParams); |
|
101 |
|
102 }; |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CTestCAlfControl::CTestCAlfControl |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 CTestCAlfControl::CTestCAlfControl(){} |
|
109 // ----------------------------------------------------------------------------- |
|
110 // CTestCAlfControl::~CTestCAlfControl |
|
111 // ----------------------------------------------------------------------------- |
|
112 // |
|
113 CTestCAlfControl::~CTestCAlfControl(){} |
|
114 // ----------------------------------------------------------------------------- |
|
115 // CTestCAlfControl::TestNotifyControlVisibility |
|
116 // ----------------------------------------------------------------------------- |
|
117 // |
|
118 TInt CTestCAlfControl::TestNotifyControlVisibility( TBool aIsVisible, |
|
119 CAlfDisplay& aDisplay ) |
|
120 { |
|
121 NotifyControlVisibility( aIsVisible, aDisplay ); |
|
122 return KErrNone; |
|
123 } |
|
124 // ----------------------------------------------------------------------------- |
|
125 // CTestCAlfControl::TestVisualAddedL |
|
126 // ----------------------------------------------------------------------------- |
|
127 // |
|
128 TInt CTestCAlfControl::TestVisualAddedL( CAlfVisual* aVisual ) |
|
129 { |
|
130 VisualAddedL( aVisual ); |
|
131 return KErrNone; |
|
132 } |
|
133 // ----------------------------------------------------------------------------- |
|
134 // CTestCAlfControl::TestVisualRemoved |
|
135 // ----------------------------------------------------------------------------- |
|
136 // |
|
137 TInt CTestCAlfControl::TestVisualRemoved( CAlfVisual* aVisual ) |
|
138 { |
|
139 VisualRemoved( aVisual ); |
|
140 return KErrNone; |
|
141 } |
|
142 // ----------------------------------------------------------------------------- |
|
143 // CTestCAlfControl::TestConnectionAddedL |
|
144 // ----------------------------------------------------------------------------- |
|
145 // |
|
146 TInt CTestCAlfControl::TestConnectionAddedL( CAlfControl* aConnectedControl, |
|
147 TInt aRole ) |
|
148 { |
|
149 ConnectionAddedL( aConnectedControl, aRole ); |
|
150 return KErrNone; |
|
151 } |
|
152 // ----------------------------------------------------------------------------- |
|
153 // CTestCAlfControl::TestConnectionRemoved |
|
154 // ----------------------------------------------------------------------------- |
|
155 // |
|
156 TInt CTestCAlfControl::TestConnectionRemoved( CAlfControl* aConnectedControl, |
|
157 TInt aRole ) |
|
158 { |
|
159 ConnectionRemoved( aConnectedControl, aRole ); |
|
160 return KErrNone; |
|
161 } |
|
162 // ----------------------------------------------------------------------------- |
|
163 // CTestCAlfControl::TestHostChangingL |
|
164 // ----------------------------------------------------------------------------- |
|
165 // |
|
166 TInt CTestCAlfControl::TestHostChangingL( CAlfControl* aNewHost ) |
|
167 { |
|
168 HostChangingL( aNewHost ); |
|
169 return KErrNone; |
|
170 } |
|
171 // ----------------------------------------------------------------------------- |
|
172 // CTestCAlfControl::TestPropertyOwnerExtension |
|
173 // ----------------------------------------------------------------------------- |
|
174 // |
|
175 TInt CTestCAlfControl::TestPropertyOwnerExtension(const TUid& aExtensionUid, |
|
176 TAny** aExtensionParams) |
|
177 { |
|
178 PropertyOwnerExtension( aExtensionUid, aExtensionParams ); |
|
179 return KErrNone; |
|
180 } |
|
181 |
|
182 |
|
183 // ============================ MEMBER FUNCTIONS =============================== |
|
184 |
|
185 // ----------------------------------------------------------------------------- |
|
186 // CTestPlatAlfVisual::TestAlfCtrlConstructorL |
|
187 // ----------------------------------------------------------------------------- |
|
188 // |
|
189 TInt CTestPlatAlfVisual::TestAlfCtrlConstructorL( CStifItemParser& /*aItem*/ ) |
|
190 { |
|
191 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
192 _LIT( KTestAlfCtrlConstructorL, "TestAlfCtrlConstructorL" ); |
|
193 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlConstructorL ); |
|
194 // Print to log file |
|
195 iLog->Log( KTestAlfCtrlConstructorL ); |
|
196 CAlfControl* ctrl = new ( ELeave ) CAlfControl; |
|
197 CleanupStack::PushL( ctrl ); |
|
198 STIF_ASSERT_NOT_NULL( ctrl ); |
|
199 CleanupStack::PopAndDestroy( ctrl ); |
|
200 |
|
201 return KErrNone; |
|
202 } |
|
203 |
|
204 // ----------------------------------------------------------------------------- |
|
205 // CTestPlatAlfVisual::TestAlfCtrlConstructL |
|
206 // ----------------------------------------------------------------------------- |
|
207 // |
|
208 TInt CTestPlatAlfVisual::TestAlfCtrlConstructL( CStifItemParser& /*aItem*/ ) |
|
209 { |
|
210 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
211 _LIT( KTestAlfCtrlConstructL, "TestAlfCtrlConstructL" ); |
|
212 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlConstructL ); |
|
213 // Print to log file |
|
214 iLog->Log( KTestAlfCtrlConstructL ); |
|
215 CAlfControl* ctrl = new ( ELeave ) CAlfControl; |
|
216 CleanupStack::PushL( ctrl ); |
|
217 ctrl->ConstructL( *iAlfEnv ); |
|
218 CleanupStack::PopAndDestroy( ctrl ); |
|
219 |
|
220 return KErrNone; |
|
221 } |
|
222 |
|
223 // ----------------------------------------------------------------------------- |
|
224 // CTestPlatAlfVisual::TestAlfCtrlIdL |
|
225 // ----------------------------------------------------------------------------- |
|
226 // |
|
227 TInt CTestPlatAlfVisual::TestAlfCtrlIdL( CStifItemParser& /*aItem*/ ) |
|
228 { |
|
229 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
230 _LIT( KTestAlfCtrlIdL, "TestAlfCtrlIdL" ); |
|
231 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlIdL ); |
|
232 // Print to log file |
|
233 iLog->Log( KTestAlfCtrlIdL ); |
|
234 CAlfControl* ctrl = new ( ELeave ) CAlfControl; |
|
235 CleanupStack::PushL( ctrl ); |
|
236 ctrl->ConstructL( *iAlfEnv ); |
|
237 ctrl->SetId( 1 ); |
|
238 TInt vId = ctrl->Id(); |
|
239 STIF_ASSERT_EQUALS( 1, vId ); |
|
240 |
|
241 CleanupStack::PopAndDestroy( ctrl ); |
|
242 |
|
243 return KErrNone; |
|
244 } |
|
245 |
|
246 // ----------------------------------------------------------------------------- |
|
247 // CTestPlatAlfVisual::TestAlfCtrlGetCtrlMember |
|
248 // ----------------------------------------------------------------------------- |
|
249 // |
|
250 TInt CTestPlatAlfVisual::TestAlfCtrlGetCtrlMember( CStifItemParser& /*aItem*/ ) |
|
251 { |
|
252 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
253 _LIT( KTestAlfCtrlGetCtrlMember, "TestAlfCtrlGetCtrlMember" ); |
|
254 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGetCtrlMember ); |
|
255 // Print to log file |
|
256 iLog->Log( KTestAlfCtrlGetCtrlMember ); |
|
257 CAlfEnv* env = &( iAlfCtl->Env() ); |
|
258 STIF_ASSERT_SAME( iAlfEnv, env ); |
|
259 |
|
260 CAlfControlGroup* group = iAlfCtl->ControlGroup(); |
|
261 STIF_ASSERT_SAME( iAlfCtrlGroup, group ); |
|
262 |
|
263 CAlfDisplay* display = iAlfCtl->Display(); |
|
264 STIF_ASSERT_SAME( iAlfDisplay, display ); |
|
265 |
|
266 return KErrNone; |
|
267 } |
|
268 |
|
269 // ----------------------------------------------------------------------------- |
|
270 // CTestPlatAlfVisual::TestAlfCtrlProcessVisualL |
|
271 // ----------------------------------------------------------------------------- |
|
272 // |
|
273 TInt CTestPlatAlfVisual::TestAlfCtrlProcessVisualL( CStifItemParser& /*aItem*/ ) |
|
274 { |
|
275 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
276 _LIT( KTestAlfCtrlProcessVisualL, "TestAlfCtrlProcessVisualL" ); |
|
277 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessVisualL ); |
|
278 // Print to log file |
|
279 iLog->Log( KTestAlfCtrlProcessVisualL ); |
|
280 CAlfVisual* vVisual = new ( ELeave ) CAlfVisual(); |
|
281 CleanupStack::PushL( vVisual ); |
|
282 vVisual->ConstructL( *iAlfCtl ); |
|
283 TInt err = iAlfCtl->Append( vVisual ); |
|
284 if ( err != KErrNone ) |
|
285 { |
|
286 CleanupStack::PopAndDestroy( vVisual ); |
|
287 return err; |
|
288 } |
|
289 CleanupStack::Pop( vVisual ); |
|
290 TBuf8<KBufSize> vBuf(KVisualTag); |
|
291 vVisual->SetTagL( vBuf ); |
|
292 STIF_ASSERT_EQUALS( 1, iAlfCtl->VisualCount() ); |
|
293 STIF_ASSERT_NOT_NULL( iAlfCtl->FindTag( vBuf ) ); |
|
294 STIF_ASSERT_SAME( vVisual, &( iAlfCtl->Visual( 0 ) ) ); |
|
295 |
|
296 iAlfCtl->VisualLayoutUpdated( *vVisual ); |
|
297 iAlfCtl->VisualPrepareDrawFailed( *vVisual, -1 ); |
|
298 iAlfCtl->VisualDestroyed( *vVisual ); |
|
299 |
|
300 iAlfCtl->Remove( vVisual ); |
|
301 STIF_ASSERT_EQUALS( 0, iAlfCtl->VisualCount() ); |
|
302 iAlfCtl->AppendVisualL( EAlfVisualTypeText ); |
|
303 |
|
304 return KErrNone; |
|
305 } |
|
306 |
|
307 // ----------------------------------------------------------------------------- |
|
308 // CTestPlatAlfVisual::TestAlfCtrlProcessConnectL |
|
309 // ----------------------------------------------------------------------------- |
|
310 // |
|
311 TInt CTestPlatAlfVisual::TestAlfCtrlProcessConnectL( CStifItemParser& /*aItem*/ ) |
|
312 { |
|
313 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
314 _LIT( KTestAlfCtrlProcessConnectL, "TestAlfCtrlProcessConnectL" ); |
|
315 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessConnectL ); |
|
316 // Print to log file |
|
317 iLog->Log( KTestAlfCtrlProcessConnectL ); |
|
318 CAlfControl* ctrl = new ( ELeave ) CAlfControl; |
|
319 CleanupStack::PushL( ctrl ); |
|
320 ctrl->ConstructL( *iAlfEnv ); |
|
321 STIF_ASSERT_EQUALS( 0, (TInt)ctrl->Host() ); |
|
322 const TInt KAlfRoleSlave = 234; |
|
323 iAlfCtl->AddConnectionL( ctrl, KAlfRoleSlave ); |
|
324 STIF_ASSERT_EQUALS( (TInt)iAlfCtl, (TInt)ctrl->Host() ); |
|
325 STIF_ASSERT_EQUALS( 0, iAlfCtl->FindConnection( ctrl ) ); |
|
326 STIF_ASSERT_EQUALS( 1, iAlfCtl->ConnectionCount() ); |
|
327 STIF_ASSERT_EQUALS( (TInt)ctrl, (TInt)&iAlfCtl->Connection( 0 ) ); |
|
328 iAlfCtl->ConnectionByOrdinal( 0 ); |
|
329 STIF_ASSERT_EQUALS( KAlfRoleSlave, iAlfCtl->ConnectionRole( 0 ) ); |
|
330 iAlfCtl->ConnectionOrdinal( 0 ); |
|
331 |
|
332 iAlfCtl->RemoveConnection( ctrl ); |
|
333 STIF_ASSERT_EQUALS( 0, iAlfCtl->ConnectionCount() ); |
|
334 |
|
335 CleanupStack::PopAndDestroy( ctrl ); |
|
336 |
|
337 return KErrNone; |
|
338 } |
|
339 |
|
340 // ----------------------------------------------------------------------------- |
|
341 // CTestPlatAlfVisual::TestAlfCtrlProcessRole |
|
342 // ----------------------------------------------------------------------------- |
|
343 // |
|
344 TInt CTestPlatAlfVisual::TestAlfCtrlProcessRole( CStifItemParser& /*aItem*/ ) |
|
345 { |
|
346 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
347 _LIT( KTestAlfCtrlProcessRoleL, "TestAlfCtrlProcessRoleL" ); |
|
348 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessRoleL ); |
|
349 // Print to log file |
|
350 iLog->Log( KTestAlfCtrlProcessRoleL ); |
|
351 iAlfCtl->SetRole( 1 ); |
|
352 STIF_ASSERT_EQUALS( 1, iAlfCtl->Role() ); |
|
353 |
|
354 return KErrNone; |
|
355 } |
|
356 |
|
357 // ----------------------------------------------------------------------------- |
|
358 // CTestPlatAlfVisual::TestAlfCtrlProcessHostL |
|
359 // ----------------------------------------------------------------------------- |
|
360 // |
|
361 TInt CTestPlatAlfVisual::TestAlfCtrlProcessHostL( CStifItemParser& /*aItem*/ ) |
|
362 { |
|
363 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
364 _LIT( KTestAlfCtrlProcessHostL, "TestAlfCtrlProcessHostL" ); |
|
365 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessHostL ); |
|
366 // Print to log file |
|
367 iLog->Log( KTestAlfCtrlProcessHostL ); |
|
368 CAlfControl* ctrl = new ( ELeave ) CAlfControl; |
|
369 CleanupStack::PushL( ctrl ); |
|
370 ctrl->ConstructL( *iAlfEnv ); |
|
371 const TInt id = 123; |
|
372 ctrl->SetHostId( id ); |
|
373 STIF_ASSERT_EQUALS( id, ctrl->HostId() ); |
|
374 |
|
375 CleanupStack::PopAndDestroy( ctrl ); |
|
376 |
|
377 return KErrNone; |
|
378 } |
|
379 |
|
380 // ----------------------------------------------------------------------------- |
|
381 // CTestPlatAlfVisual::TestAlfCtrlHostDisplayL |
|
382 // ----------------------------------------------------------------------------- |
|
383 // |
|
384 TInt CTestPlatAlfVisual::TestAlfCtrlHostDisplayL( CStifItemParser& /*aItem*/ ) |
|
385 { |
|
386 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
387 _LIT( KTestAlfCtrlHostDisplayL, "TestAlfCtrlHostDisplayL" ); |
|
388 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlHostDisplayL ); |
|
389 // Print to log file |
|
390 iLog->Log( KTestAlfCtrlHostDisplayL ); |
|
391 CAlfControl* ctrl = new ( ELeave ) CAlfControl; |
|
392 CleanupStack::PushL( ctrl ); |
|
393 ctrl->ConstructL( *iAlfEnv ); |
|
394 |
|
395 const TPoint source( 23 , 34 ); |
|
396 const TPoint converted = ctrl->HostToDisplay( source ); |
|
397 STIF_ASSERT_EQUALS( source.iX, converted.iX ); |
|
398 STIF_ASSERT_EQUALS( source.iY, converted.iY );\ |
|
399 |
|
400 CleanupStack::PopAndDestroy( ctrl ); |
|
401 |
|
402 return KErrNone; |
|
403 } |
|
404 |
|
405 // ----------------------------------------------------------------------------- |
|
406 // CTestPlatAlfVisual::TestAlfCtrlDisplayPos |
|
407 // ----------------------------------------------------------------------------- |
|
408 // |
|
409 TInt CTestPlatAlfVisual::TestAlfCtrlDisplayPos( CStifItemParser& /*aItem*/ ) |
|
410 { |
|
411 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
412 _LIT( KTestAlfCtrlDisplayPos, "TestAlfCtrlDisplayPos" ); |
|
413 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlDisplayPos ); |
|
414 // Print to log file |
|
415 iLog->Log( KTestAlfCtrlDisplayPos ); |
|
416 iAlfCtl->DisplayArea(); |
|
417 iAlfCtl->DisplayCenter(); |
|
418 |
|
419 return KErrNone; |
|
420 } |
|
421 |
|
422 // ----------------------------------------------------------------------------- |
|
423 // CTestPlatAlfVisual::TestAlfCtrlEventL |
|
424 // ----------------------------------------------------------------------------- |
|
425 // |
|
426 TInt CTestPlatAlfVisual::TestAlfCtrlEventL( CStifItemParser& /*aItem*/ ) |
|
427 { |
|
428 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
429 _LIT( KTestAlfCtrlEventL, "TestAlfCtrlEventL" ); |
|
430 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlEventL ); |
|
431 // Print to log file |
|
432 iLog->Log( KTestAlfCtrlEventL ); |
|
433 TAlfEvent vEvent( 0 ); |
|
434 iAlfCtl->AcceptInput(); |
|
435 iAlfCtl->OfferEventL( vEvent ); |
|
436 const TInt num = 23; |
|
437 TAlfCustomEventCommand event( num, iAlfCtl ); |
|
438 iAlfEnv->Send( event,num ); |
|
439 iAlfCtl->CancelAllCommands(); |
|
440 const TPoint point( num, num ); |
|
441 TBool result = iAlfCtl->HitTest( point ); |
|
442 STIF_ASSERT_FALSE( result ); |
|
443 |
|
444 return KErrNone; |
|
445 } |
|
446 |
|
447 // ----------------------------------------------------------------------------- |
|
448 // CTestPlatAlfVisual::TestAlfCtrlProcessFocus |
|
449 // ----------------------------------------------------------------------------- |
|
450 // |
|
451 TInt CTestPlatAlfVisual::TestAlfCtrlProcessFocus( CStifItemParser& /*aItem*/ ) |
|
452 { |
|
453 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
454 _LIT( KTestAlfCtrlProcessFocus, "TestAlfCtrlProcessFocus" ); |
|
455 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessFocus ); |
|
456 // Print to log file |
|
457 iLog->Log( KTestAlfCtrlProcessFocus ); |
|
458 iAlfCtl->AcquireFocus(); |
|
459 iAlfCtl->RelinquishFocus(); |
|
460 TBool vBool = iAlfCtl->Focus(); |
|
461 STIF_ASSERT_FALSE( vBool ); |
|
462 iAlfCtl->FocusedConnection(); |
|
463 vBool = iAlfCtl->IsFocusing(); |
|
464 STIF_ASSERT_FALSE( vBool ); |
|
465 iAlfCtl->FocusChanged( *iAlfDisplay, EFalse ); |
|
466 STIF_ASSERT_FALSE( iAlfCtl->IsFocusing() ); |
|
467 return KErrNone; |
|
468 } |
|
469 |
|
470 // ----------------------------------------------------------------------------- |
|
471 // CTestPlatAlfVisual::TestAlfCtrlLayoutL |
|
472 // ----------------------------------------------------------------------------- |
|
473 // |
|
474 TInt CTestPlatAlfVisual::TestAlfCtrlLayoutL( CStifItemParser& /*aItem*/ ) |
|
475 { |
|
476 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
477 _LIT( KTestAlfCtrlLayoutL, "TestAlfCtrlLayoutL" ); |
|
478 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlLayoutL ); |
|
479 // Print to log file |
|
480 iLog->Log( KTestAlfCtrlLayoutL ); |
|
481 |
|
482 CAlfControl* ctrl = new ( ELeave ) CAlfControl; |
|
483 CleanupStack::PushL( ctrl ); |
|
484 ctrl->ConstructL( *iAlfEnv ); |
|
485 iAlfCtl->AddConnectionL( ctrl, 0 ); |
|
486 iAlfCtl->AppendLayoutL( EAlfLayoutTypeFlow ); |
|
487 iAlfCtl->ContainerLayout( ctrl ); |
|
488 STIF_ASSERT_NULL( iAlfCtl->ContainerLayout( NULL ) ); |
|
489 iAlfCtl->RemoveConnection( ctrl ); |
|
490 CleanupStack::PopAndDestroy( ctrl ); |
|
491 |
|
492 return KErrNone; |
|
493 } |
|
494 |
|
495 // ----------------------------------------------------------------------------- |
|
496 // CTestPlatAlfVisual::TestAlfCtrlIdentifier |
|
497 // ----------------------------------------------------------------------------- |
|
498 // |
|
499 TInt CTestPlatAlfVisual::TestAlfCtrlIdentifier( CStifItemParser& /*aItem*/ ) |
|
500 { |
|
501 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
502 _LIT( KTestAlfCtrlIdentifier, "TestAlfCtrlIdentifier" ); |
|
503 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlIdentifier ); |
|
504 // Print to log file |
|
505 iLog->Log( KTestAlfCtrlIdentifier ); |
|
506 |
|
507 const TInt vId = iAlfCtl->Identifier(); |
|
508 STIF_ASSERT_NOT_EQUALS( 0, vId ); |
|
509 |
|
510 return KErrNone; |
|
511 } |
|
512 |
|
513 // ----------------------------------------------------------------------------- |
|
514 // CTestPlatAlfVisual::TestAlfCtrlBounds |
|
515 // ----------------------------------------------------------------------------- |
|
516 // |
|
517 TInt CTestPlatAlfVisual::TestAlfCtrlBounds( CStifItemParser& /*aItem*/ ) |
|
518 { |
|
519 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
520 _LIT( KTestAlfCtrlBounds, "TestAlfCtrlBounds" ); |
|
521 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlBounds ); |
|
522 // Print to log file |
|
523 iLog->Log( KTestAlfCtrlBounds ); |
|
524 |
|
525 const TRect vRect = iAlfCtl->Bounds(); |
|
526 |
|
527 return KErrNone; |
|
528 } |
|
529 |
|
530 // ----------------------------------------------------------------------------- |
|
531 // CTestPlatAlfVisual::TestAlfCtrlShowL |
|
532 // ----------------------------------------------------------------------------- |
|
533 // |
|
534 TInt CTestPlatAlfVisual::TestAlfCtrlShowL( CStifItemParser& /*aItem*/ ) |
|
535 { |
|
536 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
537 _LIT( KTestAlfCtrlShowL, "TestAlfCtrlShowL" ); |
|
538 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlShowL ); |
|
539 // Print to log file |
|
540 iLog->Log( KTestAlfCtrlShowL ); |
|
541 |
|
542 iAlfCtl->ShowL( *iAlfDisplay ); |
|
543 |
|
544 return KErrNone; |
|
545 } |
|
546 |
|
547 // ----------------------------------------------------------------------------- |
|
548 // CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveVisualL |
|
549 // ----------------------------------------------------------------------------- |
|
550 // |
|
551 TInt CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveVisualL( CStifItemParser& /*aItem*/ ) |
|
552 { |
|
553 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
554 _LIT( KTestAlfCtrlAddAndRemoveVisualL, "TestAlfCtrlAddAndRemoveVisualL" ); |
|
555 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlAddAndRemoveVisualL ); |
|
556 // Print to log file |
|
557 iLog->Log( KTestAlfCtrlAddAndRemoveVisualL ); |
|
558 CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl; |
|
559 CleanupStack::PushL( ctrl ); |
|
560 ctrl->ConstructL( *iAlfEnv ); |
|
561 CAlfVisual* vVisual = new ( ELeave ) CAlfVisual(); |
|
562 CleanupStack::PushL( vVisual ); |
|
563 vVisual->ConstructL( *ctrl ); |
|
564 CleanupStack::Pop( vVisual ); |
|
565 ctrl->TestVisualAddedL( vVisual ); |
|
566 ctrl->TestVisualRemoved( vVisual ); |
|
567 |
|
568 CleanupStack::PopAndDestroy( ctrl ); |
|
569 |
|
570 return KErrNone; |
|
571 } |
|
572 |
|
573 |
|
574 // ----------------------------------------------------------------------------- |
|
575 // CTestPlatAlfVisual::TestAlfCtrlNotifyControlVisibilityL |
|
576 // ----------------------------------------------------------------------------- |
|
577 // |
|
578 TInt CTestPlatAlfVisual::TestAlfCtrlNotifyControlVisibilityL( CStifItemParser& /*aItem*/ ) |
|
579 { |
|
580 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
581 _LIT( KTestAlfCtrlNotifyControlVisibilityL, "TestAlfCtrlNotifyControlVisibilityL" ); |
|
582 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlNotifyControlVisibilityL ); |
|
583 // Print to log file |
|
584 iLog->Log( KTestAlfCtrlNotifyControlVisibilityL ); |
|
585 CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl; |
|
586 CleanupStack::PushL( ctrl ); |
|
587 ctrl->ConstructL( *iAlfEnv ); |
|
588 ctrl->TestNotifyControlVisibility( EFalse, *iAlfDisplay ); |
|
589 |
|
590 CleanupStack::PopAndDestroy( ctrl ); |
|
591 |
|
592 return KErrNone; |
|
593 } |
|
594 |
|
595 |
|
596 // ----------------------------------------------------------------------------- |
|
597 // CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveConnectionL |
|
598 // ----------------------------------------------------------------------------- |
|
599 // |
|
600 TInt CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveConnectionL( CStifItemParser& /*aItem*/ ) |
|
601 { |
|
602 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
603 _LIT( KTestAlfCtrlAddAndRemoveConnectionL, "TestAlfCtrlAddAndRemoveConnectionL" ); |
|
604 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlAddAndRemoveConnectionL ); |
|
605 // Print to log file |
|
606 iLog->Log( KTestAlfCtrlAddAndRemoveConnectionL ); |
|
607 CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl; |
|
608 CleanupStack::PushL( ctrl ); |
|
609 ctrl->ConstructL( *iAlfEnv ); |
|
610 ctrl->TestConnectionAddedL( iAlfCtl, 1 ); |
|
611 ctrl->TestConnectionRemoved( iAlfCtl, 1 ); |
|
612 |
|
613 CleanupStack::PopAndDestroy( ctrl ); |
|
614 |
|
615 return KErrNone; |
|
616 } |
|
617 |
|
618 |
|
619 // ----------------------------------------------------------------------------- |
|
620 // CTestPlatAlfVisual::TestAlfCtrlHostChangingL |
|
621 // ----------------------------------------------------------------------------- |
|
622 // |
|
623 TInt CTestPlatAlfVisual::TestAlfCtrlHostChangingL( CStifItemParser& /*aItem*/ ) |
|
624 { |
|
625 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
626 _LIT( KTestAlfCtrlHostChangingL, "TestAlfCtrlHostChangingL" ); |
|
627 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlHostChangingL ); |
|
628 // Print to log file |
|
629 iLog->Log( KTestAlfCtrlHostChangingL ); |
|
630 CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl; |
|
631 CleanupStack::PushL( ctrl ); |
|
632 ctrl->ConstructL( *iAlfEnv ); |
|
633 ctrl->TestHostChangingL( NULL ); |
|
634 |
|
635 CleanupStack::PopAndDestroy( ctrl ); |
|
636 |
|
637 return KErrNone; |
|
638 } |
|
639 |
|
640 // ----------------------------------------------------------------------------- |
|
641 // CTestPlatAlfVisual::TestAlfCtrlPropertyOwnerExtensionL |
|
642 // ----------------------------------------------------------------------------- |
|
643 // |
|
644 TInt CTestPlatAlfVisual::TestAlfCtrlPropertyOwnerExtensionL( CStifItemParser& /*aItem*/ ) |
|
645 { |
|
646 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
647 _LIT( KTestAlfCtrlPropertyOwnerExtensionL, "TestAlfCtrlPropertyOwnerExtensionL" ); |
|
648 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlPropertyOwnerExtensionL ); |
|
649 // Print to log file |
|
650 iLog->Log( KTestAlfCtrlPropertyOwnerExtensionL ); |
|
651 CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl; |
|
652 CleanupStack::PushL( ctrl ); |
|
653 ctrl->ConstructL( *iAlfEnv ); |
|
654 |
|
655 TUid vUid = { 0x00000000 }; |
|
656 ctrl->TestPropertyOwnerExtension( vUid, NULL ); |
|
657 |
|
658 CleanupStack::PopAndDestroy( ctrl ); |
|
659 |
|
660 return KErrNone; |
|
661 } |
|
662 |
|
663 // End of file |
|
664 |