|
1 /* |
|
2 * Copyright (c) 2010 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: STIF testclass declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef SYSTEMTONESERVICESTIF_H |
|
19 #define SYSTEMTONESERVICESTIF_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <StifLogger.h> |
|
23 #include <TestScripterInternal.h> |
|
24 #include <StifTestModule.h> |
|
25 #include <TestclassAssert.h> |
|
26 |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 |
|
31 // MACROS |
|
32 |
|
33 #define TEST_CLASS_VERSION_MAJOR 0 |
|
34 #define TEST_CLASS_VERSION_MINOR 0 |
|
35 #define TEST_CLASS_VERSION_BUILD 0 |
|
36 |
|
37 // Logging path |
|
38 _LIT( KsystemtoneservicestifLogPath, "f:\\testing\\Log\\" ); |
|
39 // Log file |
|
40 _LIT( KsystemtoneservicestifLogFile, "systemtoneservicestif.txt" ); |
|
41 _LIT( KsystemtoneservicestifLogFileWithTitle, "systemtoneservicestif_[%S].txt" ); |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 // FORWARD DECLARATIONS |
|
47 |
|
48 class CSystemToneServiceStif; |
|
49 class CSystemToneService; |
|
50 |
|
51 enum TPlayState |
|
52 { |
|
53 EStopped, |
|
54 EPlaying |
|
55 }; |
|
56 |
|
57 _LIT( KTrue, "True"); |
|
58 _LIT( KFalse, "False"); |
|
59 |
|
60 // CLASS DECLARATION |
|
61 |
|
62 /** |
|
63 * CSystemToneServiceStif test class for STIF Test Framework TestScripter. |
|
64 |
|
65 */ |
|
66 NONSHARABLE_CLASS(CSystemToneServiceStif) : public CScriptBase |
|
67 { |
|
68 public: // Constructors and destructor |
|
69 |
|
70 /** |
|
71 * Two-phased constructor. |
|
72 */ |
|
73 static CSystemToneServiceStif* NewL( CTestModuleIf& aTestModuleIf ); |
|
74 |
|
75 /** |
|
76 * Destructor. |
|
77 */ |
|
78 virtual ~CSystemToneServiceStif(); |
|
79 |
|
80 |
|
81 public: // Functions from base classes |
|
82 |
|
83 /** |
|
84 * From CScriptBase Runs a script line. |
|
85 * @param aItem Script line containing method name and parameters |
|
86 * @return Symbian OS error code |
|
87 */ |
|
88 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
89 |
|
90 |
|
91 |
|
92 private: |
|
93 |
|
94 /** |
|
95 * C++ default constructor. |
|
96 */ |
|
97 CSystemToneServiceStif( CTestModuleIf& aTestModuleIf ); |
|
98 |
|
99 /** |
|
100 * By default Symbian 2nd phase constructor is private. |
|
101 */ |
|
102 void ConstructL(); |
|
103 |
|
104 |
|
105 /** |
|
106 * Frees all resources allocated from test methods. |
|
107 */ |
|
108 void Delete(); |
|
109 |
|
110 /** |
|
111 * Test methods are listed below. |
|
112 */ |
|
113 |
|
114 /** |
|
115 * Example test method. |
|
116 * @return Symbian OS error code. |
|
117 */ |
|
118 virtual TInt ExampleL( CStifItemParser& aItem ); |
|
119 |
|
120 /** |
|
121 * Method used to log version of test class |
|
122 */ |
|
123 void SendTestClassVersion(); |
|
124 |
|
125 //ADD NEW METHOD |
|
126 |
|
127 virtual TInt CreateSystemToneService( ); |
|
128 |
|
129 virtual TInt DeleteSystemToneService( ); |
|
130 |
|
131 virtual TInt PlaySystemToneService( CStifItemParser& aItem); |
|
132 |
|
133 virtual TInt PlaySystemToneServiceWithContext( CStifItemParser& aItem ); |
|
134 |
|
135 virtual TInt StopSystemToneService( CStifItemParser& aItem ); |
|
136 |
|
137 |
|
138 |
|
139 private: // Data |
|
140 TPlayState iPlayState; |
|
141 CSystemToneService* iSts; |
|
142 TUint iCurrentContext; |
|
143 |
|
144 |
|
145 |
|
146 }; |
|
147 |
|
148 #endif // SYSTEMTONESERVICESTIF_H |
|
149 |
|
150 // End of File |