|
1 /* |
|
2 * Copyright (c) 2009 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: video Playback User Input Handler test class for STIF testing |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: ou1cpsw#4 % |
|
19 |
|
20 #ifndef USERINPUTHANDLER_TEST_H |
|
21 #define USERINPUTHANDLER_TEST_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <StifLogger.h> |
|
25 #include <TestScripterInternal.h> |
|
26 #include <StifTestModule.h> |
|
27 #include <TestclassAssert.h> |
|
28 #include <e32base.h> |
|
29 #include <e32def.h> |
|
30 #include <StifItemParser.h> |
|
31 #include <W32STD.H> |
|
32 |
|
33 #include "mpxvideoplaybackcontrol.hrh" |
|
34 #include "mpxcommonvideoplaybackview.hrh" |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 class CMPXVideoPlaybackUserInputHandler; |
|
39 class CMPXVideoPlaybackContainer; |
|
40 class CMPXVideoPlaybackControl; |
|
41 |
|
42 // DATA |
|
43 |
|
44 // CONSTANTS |
|
45 |
|
46 |
|
47 // MACROS |
|
48 #define TEST_CLASS_VERSION_MAJOR 0 |
|
49 #define TEST_CLASS_VERSION_MINOR 0 |
|
50 #define TEST_CLASS_VERSION_BUILD 0 |
|
51 |
|
52 // Logging path |
|
53 _LIT( KUserinputhandlertest_LogPath, "\\logs\\testframework\\userinputhandlertest\\" ); |
|
54 |
|
55 // Log file |
|
56 _LIT( KUserinputhandlertest_LogFile, "userinputhandlertest.txt" ); |
|
57 _LIT( KUserinputhandlertest_LogFileWithTitle, "userinputhandlertest_[%S].txt" ); |
|
58 |
|
59 |
|
60 /** |
|
61 * CUserinputhandlertest class for STIF Test Framework TestScripter. |
|
62 * ?other_description_lines |
|
63 * |
|
64 * @lib ?library |
|
65 * @since ?Series60_version |
|
66 */ |
|
67 NONSHARABLE_CLASS(CUserinputhandlertest) : public CScriptBase |
|
68 { |
|
69 public: // Constructors and destructor |
|
70 |
|
71 /** |
|
72 * Two-phased constructor. |
|
73 */ |
|
74 static CUserinputhandlertest* NewL( CTestModuleIf& aTestModuleIf ); |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 virtual ~CUserinputhandlertest(); |
|
80 |
|
81 public: // Functions from base classes |
|
82 |
|
83 /** |
|
84 * From CScriptBase Runs a script line. |
|
85 * @since ?Series60_version |
|
86 * @param aItem Script line containing method name and parameters |
|
87 * @return Symbian OS error code |
|
88 */ |
|
89 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
90 |
|
91 private: |
|
92 |
|
93 /** |
|
94 * C++ default constructor. |
|
95 */ |
|
96 CUserinputhandlertest( CTestModuleIf& aTestModuleIf ); |
|
97 |
|
98 /** |
|
99 * By default Symbian 2nd phase constructor is private. |
|
100 */ |
|
101 void ConstructL(); |
|
102 |
|
103 /** |
|
104 * Frees all resources allocated from test methods. |
|
105 * @since ?Series60_version |
|
106 */ |
|
107 void Delete(); |
|
108 |
|
109 /** |
|
110 * Create stubs |
|
111 */ |
|
112 virtual TInt CreateStubsL( CStifItemParser& aItem ); |
|
113 |
|
114 /** |
|
115 * Method used to log version of test class |
|
116 */ |
|
117 void SendTestClassVersion(); |
|
118 |
|
119 /** |
|
120 * Issue pointer event |
|
121 * @return Symbian OS error code. |
|
122 */ |
|
123 virtual TInt PointerEvent( CStifItemParser& aItem ); |
|
124 |
|
125 /** |
|
126 * Issue pointer event |
|
127 * @return Symbian OS error code. |
|
128 */ |
|
129 virtual TInt KeyEvent( CStifItemParser& aItem ); |
|
130 |
|
131 /** |
|
132 * Issue media key event |
|
133 * @return Symbian OS error code. |
|
134 */ |
|
135 virtual TInt MediaKeyEvent( CStifItemParser& aItem ); |
|
136 |
|
137 /** |
|
138 * Issue foreground/background event |
|
139 * @return Symbian OS error code. |
|
140 */ |
|
141 virtual TInt SetForeground( CStifItemParser& aItem ); |
|
142 |
|
143 /** |
|
144 * Parse inputs |
|
145 * @return Symbian OS error code. |
|
146 */ |
|
147 TInt ParseInputs( CStifItemParser& aItem, |
|
148 TMPXVideoControlType& aControlType, |
|
149 TPointerEvent& aEventType, |
|
150 TEventCode& aEventCode, |
|
151 TKeyEvent& aKeyEvent ); |
|
152 |
|
153 /** |
|
154 * Check expected result |
|
155 * @return Symbian OS error code. |
|
156 */ |
|
157 TInt CheckExpectedResult( CStifItemParser& aItem ); |
|
158 |
|
159 /** |
|
160 * Check expected command |
|
161 * @return Symbian OS error code. |
|
162 */ |
|
163 TInt CheckExpectedCommand( CStifItemParser& aItem ); |
|
164 |
|
165 |
|
166 private: |
|
167 |
|
168 CMPXVideoPlaybackContainer* iContainer; |
|
169 CMPXVideoPlaybackControl* iControl; |
|
170 CMPXVideoPlaybackUserInputHandler* iUserInputHandler; |
|
171 |
|
172 }; |
|
173 |
|
174 #endif // USERINPUTHANDLER_TEST_H |
|
175 |
|
176 // End of File |