|
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 |
|
22 #if !defined(__TCLCK0STEP_H__) |
|
23 #define __TCLCK0STEP_H__ |
|
24 |
|
25 |
|
26 #include <test/testexecutestepbase.h> |
|
27 #include "TClockTestServer.h" |
|
28 #include "appfwk_test_AppUi.h" |
|
29 |
|
30 class CTClck0Step : public CTmsTestStep |
|
31 { |
|
32 public: |
|
33 CTClck0Step(); |
|
34 ~CTClck0Step(); |
|
35 // virtual TVerdict doTestStepPreambleL(); |
|
36 // virtual TVerdict doTestStepPostambleL(); |
|
37 virtual TVerdict doTestStepL(); |
|
38 void ConstructAppL(CCoeEnv* aCoeEnv); |
|
39 |
|
40 private: |
|
41 }; |
|
42 |
|
43 enum TFunction |
|
44 { |
|
45 ECreateDigitalClockWithNoConstructCall, |
|
46 ECreateDigitalClockWithTooManyConstructCalls, |
|
47 ECreateDigitalClockWithNoTextSections, |
|
48 ECreateDigitalClockWithTooManyTextSections, |
|
49 ECreateDigitalClockWithNonNormalizedRect, |
|
50 ECreateAnalogClockWithNoConstructCall, |
|
51 ECreateAnalogClockWithTooManyConstructCalls, |
|
52 ECreateAnalogClockWithNoHands, |
|
53 ECreateAnalogClockWithTooManyHands, |
|
54 ECreateAnalogClockWithHandWithNoFeatures |
|
55 }; |
|
56 |
|
57 // |
|
58 |
|
59 struct SPanickingFunctionData |
|
60 { |
|
61 TInt iMainWindowGroup; |
|
62 TFunction iFunction; |
|
63 }; |
|
64 |
|
65 // |
|
66 |
|
67 class CDestructableFont : public CBase |
|
68 { |
|
69 public: |
|
70 CDestructableFont(CWsScreenDevice* aScreenDevice); |
|
71 void ConstructL(const TFontSpec& aFontSpec); |
|
72 virtual ~CDestructableFont(); |
|
73 TInt Handle() const; |
|
74 private: |
|
75 CWsScreenDevice* iScreenDevice; // not owned by this pointer |
|
76 CFbsFont* iFont; |
|
77 }; |
|
78 |
|
79 // |
|
80 class CTestClckUi; |
|
81 class CClkControl : public CCoeControl |
|
82 { |
|
83 friend class CTestClckUi; |
|
84 public: |
|
85 CClkControl(); |
|
86 void ConstructL(); |
|
87 virtual ~CClkControl(); |
|
88 private: |
|
89 // functions overriding those in CCoeControl |
|
90 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
91 virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
92 virtual void Draw(const TRect& aRect) const; |
|
93 // miscellaneous functions |
|
94 void TestForDegenerateClockCreationL(); |
|
95 void TestClosingPartiallyCreatedDigitalClocksL(); |
|
96 void TestClosingPartiallyCreatedAnalogClocksL(); |
|
97 static void FireOffNewThreadAndTestForPanicL(TAny* aData); |
|
98 void CreateDigitalClocksL(); |
|
99 void CreateAnalogClocksL(); |
|
100 private: |
|
101 TRgb iBackgroundColor; |
|
102 RAnimDll iAnimDll; |
|
103 RDigitalClock* iDigitalClock0; |
|
104 TPoint iDigitalClock0Position; |
|
105 TSize iDigitalClock0Size; |
|
106 RAnalogClock* iAnalogClock0; |
|
107 TPoint iAnalogClock0Position; |
|
108 TSize iAnalogClock0Size; |
|
109 TInt iUniversalTimeOffset; |
|
110 |
|
111 }; |
|
112 |
|
113 class CTestClckUi : public CTestCoeAppUi |
|
114 { |
|
115 public: |
|
116 CTestClckUi(CTmsTestStep* aStep); |
|
117 void ConstructL(); |
|
118 protected: |
|
119 CClkControl* iControl; |
|
120 protected: |
|
121 virtual void RunTestStepL(TInt aStep); |
|
122 }; |
|
123 |
|
124 |
|
125 |
|
126 _LIT(KTClck0Step,"TClck0"); |
|
127 |
|
128 #endif |