|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 #include "TCustomStep.h" |
|
22 #include "AnimationConfig.h" |
|
23 #include "AnimationTestServer.h" |
|
24 #include "DummyAnimation.h" |
|
25 #include "Animator.h" |
|
26 |
|
27 _LIT(KWrongAnimator, "Wrong animator created"); |
|
28 |
|
29 // |
|
30 // Windows: |
|
31 // |
|
32 CCustomStepAnimationWindow::CCustomStepAnimationWindow(RWsSession& aWsSession, CTestWindowGroup& aGroup, CWindowGc& aGc) : CTestWindow(aWsSession, aGroup, aGc) |
|
33 { |
|
34 } |
|
35 |
|
36 void CCustomStepAnimationWindow::DrawL() |
|
37 { |
|
38 } |
|
39 |
|
40 // |
|
41 // The test: |
|
42 // |
|
43 CCustomStep::CCustomStep() |
|
44 { |
|
45 SetTestStepName(KCustomStep); |
|
46 } |
|
47 |
|
48 CCustomStep::~CCustomStep() |
|
49 { |
|
50 delete iWin; |
|
51 } |
|
52 |
|
53 void CCustomStep::InitialiseL() |
|
54 { |
|
55 CAnimationTestStep::InitialiseL(); |
|
56 |
|
57 ANIM_INFO1(_L("Begin test SYNCH")); |
|
58 |
|
59 TInt winborder = 2; |
|
60 iWinSize = Screen()->SizeInPixels(); |
|
61 iWinSize.iWidth /= 2; |
|
62 iWinPosition = TPoint(iWinSize.iWidth + winborder, winborder); |
|
63 iWinSize.iWidth -= winborder * 2; |
|
64 iWinSize.iHeight -= winborder * 2; |
|
65 iWinRect = TRect(iWinPosition, iWinSize); |
|
66 |
|
67 iWin = new (ELeave) CCustomStepAnimationWindow(Ws(), *GroupWin(), *Gc()); |
|
68 iWin->Window()->SetRequiredDisplayMode(EColor256); |
|
69 iWin->Window()->SetExtent(iWinPosition, iWinSize); |
|
70 iWin->Window()->SetBackgroundColor(iBackgroundColor1); |
|
71 iWin->Window()->SetVisible(ETrue); |
|
72 iWin->Window()->Activate(); |
|
73 } |
|
74 |
|
75 /** |
|
76 @SYMTestCaseID UIF-animation-TCustomStep-doActiveTestStepL |
|
77 |
|
78 @SYMTestCaseDesc This tests a derived class of CAnimator |
|
79 |
|
80 @SYMPREQ 269 |
|
81 |
|
82 @SYMTestStatus Implemented |
|
83 |
|
84 @SYMTestPriority High |
|
85 |
|
86 @SYMTestActions |
|
87 There are no animation sequences tested here. |
|
88 What is done is derive a class from CAnimator, and test the DataEventL |
|
89 function of the class. |
|
90 |
|
91 @SYMTestExpectedResults Pass |
|
92 |
|
93 */ |
|
94 TVerdict CCustomStep::doActiveTestStepL() |
|
95 { |
|
96 SetTestStepID(_L("UIF-animation-TCustomStep-doActiveTestStepL")); |
|
97 |
|
98 InitialiseL(); |
|
99 |
|
100 CDummyDataProvider * dp = new (ELeave) CDummyDataProvider; |
|
101 CDummyAnimation * animation = CDummyAnimation::NewLC(dp); |
|
102 CAnimator * animator = CAnimator::NewL(animation); |
|
103 TInt verify = 0; |
|
104 animator->DataEventL(0, &verify, sizeof(TInt)); |
|
105 if (verify != 12345) |
|
106 { |
|
107 ANIM_ERR1(KWrongAnimator); |
|
108 SetTestStepResult(EFail); |
|
109 } |
|
110 delete animator; |
|
111 CleanupStack::PopAndDestroy(animation); |
|
112 |
|
113 RecordTestResultL(); |
|
114 CloseTMSGraphicsStep(); |
|
115 |
|
116 return TestStepResult(); |
|
117 } |