|
1 // Copyright (c) 2008-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 // Declarations of Unit test step classes for MILIF testing. |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef TSI_MILIF_OMXILIFTESTS_H |
|
19 #define TSI_MILIF_OMXILIFTESTS_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <testframework.h> |
|
23 |
|
24 #include "milcomponentportif.h" |
|
25 #include "milifobserver.h" |
|
26 |
|
27 enum TTestEvents |
|
28 { |
|
29 EEventInit = 0, |
|
30 EEventInitComplete, |
|
31 EEventExecuteComplete, |
|
32 EEventPauseComplete, |
|
33 EEventStopComplete, |
|
34 EEventFlushComplete, |
|
35 EEventPortDisableComplete |
|
36 }; |
|
37 |
|
38 enum TTestState |
|
39 { |
|
40 ETestStateStart = 0, |
|
41 ETestStateInitializing, |
|
42 ETestStateInitialized, |
|
43 ETestStatePausing, |
|
44 ETestStateStopping, |
|
45 ETestStateFlushing, |
|
46 ETestStateFirstPortFlushed, |
|
47 ETestStateDisablingPort |
|
48 }; |
|
49 |
|
50 |
|
51 /* |
|
52 * |
|
53 * RTestStepMILIFBase |
|
54 * |
|
55 */ |
|
56 class RTestStepMILIFBase : public RAsyncTestStep, |
|
57 public MILIfObserver |
|
58 { |
|
59 public: |
|
60 // From RAsyncTestStep |
|
61 virtual void KickoffTestL(); |
|
62 virtual void CloseTest(); |
|
63 |
|
64 // from MILIfObserver |
|
65 virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); |
|
66 virtual TInt BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer); |
|
67 |
|
68 protected: |
|
69 RTestStepMILIFBase(const TDesC& aTestName); |
|
70 |
|
71 virtual void DoTestBody(); |
|
72 virtual void DoKickoffTestL(); |
|
73 |
|
74 protected: |
|
75 MILComponentIf* iDummyComponent; |
|
76 MILComponentPortIf* iComponentInPortIf; // Not owned |
|
77 MILComponentPortIf* iComponentOutPortIf;// Not owned |
|
78 TTestState iTestState; |
|
79 }; |
|
80 |
|
81 /* |
|
82 * |
|
83 * RTestStepMILIFPorts |
|
84 * |
|
85 */ |
|
86 class RTestStepMILIFPorts : public RTestStepMILIFBase |
|
87 { |
|
88 public: |
|
89 static RTestStepMILIFPorts* NewL(const TDesC& aTestName); |
|
90 |
|
91 private: |
|
92 RTestStepMILIFPorts(const TDesC& aTestName); |
|
93 |
|
94 virtual void DoKickoffTestL(); |
|
95 virtual void DoTestBody(); |
|
96 }; |
|
97 |
|
98 /* |
|
99 * |
|
100 * RTestStepMILIFConfig |
|
101 * |
|
102 */ |
|
103 class RTestStepMILIFConfig : public RTestStepMILIFBase |
|
104 { |
|
105 public: |
|
106 static RTestStepMILIFConfig* NewL(const TDesC& aTestName); |
|
107 |
|
108 private: |
|
109 RTestStepMILIFConfig(const TDesC& aTestName); |
|
110 |
|
111 virtual void DoTestBody(); |
|
112 virtual void DoKickoffTestL(); |
|
113 }; |
|
114 |
|
115 /* |
|
116 * |
|
117 * RTestStepMILIFStates |
|
118 * |
|
119 */ |
|
120 class RTestStepMILIFStates : public RTestStepMILIFBase |
|
121 { |
|
122 public: |
|
123 static RTestStepMILIFStates* NewL(const TDesC& aTestName); |
|
124 |
|
125 private: |
|
126 RTestStepMILIFStates(const TDesC& aTestName); |
|
127 |
|
128 virtual void DoKickoffTestL(); |
|
129 virtual void DoTestBody(); |
|
130 |
|
131 virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); |
|
132 virtual void Fsm(TTestEvents aEvent, TInt aError); |
|
133 }; |
|
134 |
|
135 /* |
|
136 * |
|
137 * RTestStepMILIFCommands |
|
138 * |
|
139 */ |
|
140 class RTestStepMILIFCommands : public RTestStepMILIFBase |
|
141 { |
|
142 public: |
|
143 static RTestStepMILIFCommands* NewL(const TDesC& aTestName); |
|
144 |
|
145 private: |
|
146 RTestStepMILIFCommands(const TDesC& aTestName); |
|
147 |
|
148 virtual void DoKickoffTestL(); |
|
149 virtual void DoTestBody(); |
|
150 |
|
151 virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); |
|
152 virtual void Fsm(TTestEvents aEvent, TInt aError); |
|
153 }; |
|
154 |
|
155 /* |
|
156 * |
|
157 * RTestStepMILIFExtensions |
|
158 * |
|
159 */ |
|
160 class RTestStepMILIFExtensions : public RTestStepMILIFBase |
|
161 { |
|
162 public: |
|
163 static RTestStepMILIFExtensions* NewL(const TDesC& aTestName); |
|
164 |
|
165 private: |
|
166 RTestStepMILIFExtensions(const TDesC& aTestName); |
|
167 |
|
168 virtual void DoKickoffTestL(); |
|
169 virtual void DoTestBody(); |
|
170 }; |
|
171 |
|
172 /* |
|
173 * |
|
174 * RTestStepMILIFComponentRole |
|
175 * |
|
176 */ |
|
177 class RTestStepMILIFComponentRole : public RTestStepMILIFBase |
|
178 { |
|
179 public: |
|
180 static RTestStepMILIFComponentRole* NewL(const TDesC& aTestName); |
|
181 |
|
182 private: |
|
183 RTestStepMILIFComponentRole(const TDesC& aTestName); |
|
184 |
|
185 virtual void DoKickoffTestL(); |
|
186 virtual void DoTestBody(); |
|
187 }; |
|
188 |
|
189 #endif // TSI_MILIF_OMXILIFTESTS_H |