13 * |
13 * |
14 * Description: tester for methods in VideoSortFilterProxyModel |
14 * Description: tester for methods in VideoSortFilterProxyModel |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // Version : %version: % |
18 // Version : %version: 4 % |
19 |
19 |
20 #include <hbapplication.h> |
20 #include <hbapplication.h> |
21 #include <hbinstance.h> |
21 #include <hbinstance.h> |
22 #include <qdebug> |
22 #include <qdebug> |
23 #include <qgraphicswidget> |
23 #include <qgraphicswidget> |
80 mFileDetails = new QMPXVideoPlaybackViewFileDetails(); |
80 mFileDetails = new QMPXVideoPlaybackViewFileDetails(); |
81 |
81 |
82 mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails ); |
82 mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails ); |
83 |
83 |
84 mControlConfig = new QMPXVideoPlaybackControlConfiguration( mControlsController ); |
84 mControlConfig = new QMPXVideoPlaybackControlConfiguration( mControlsController ); |
85 mControlConfig->createControlList(); |
|
86 } |
85 } |
87 |
86 |
88 // --------------------------------------------------------------------------- |
87 // --------------------------------------------------------------------------- |
89 // cleanup |
88 // cleanup |
90 // --------------------------------------------------------------------------- |
89 // --------------------------------------------------------------------------- |
119 void TestControlConfiguration::testControlList() |
118 void TestControlConfiguration::testControlList() |
120 { |
119 { |
121 MPX_ENTER_EXIT(_L("TestControlConfiguration::testControlList()")); |
120 MPX_ENTER_EXIT(_L("TestControlConfiguration::testControlList()")); |
122 |
121 |
123 setup(); |
122 setup(); |
124 |
123 |
|
124 // |
|
125 // Streaming case |
|
126 // |
|
127 mFileDetails->mPlaybackMode = EMPXVideoStreaming; |
|
128 |
|
129 mControlConfig->createControlList(); |
125 QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
130 QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
126 |
131 |
127 QVERIFY( controlsList.contains( EMPXStatusPane ) ); |
132 QVERIFY( controlsList.contains( EMPXStatusPane ) ); |
128 |
133 QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) ); |
|
134 QVERIFY( controlsList.contains( EMPXBufferingAnimation ) ); |
|
135 |
|
136 cleanup(); |
|
137 |
|
138 // |
|
139 // local + RN |
|
140 // |
|
141 setup(); |
|
142 |
|
143 mFileDetails->mPlaybackMode = EMPXVideoLocal; |
|
144 mFileDetails->mRNFormat = true; |
|
145 |
|
146 mControlConfig->createControlList(); |
|
147 controlsList = mControlConfig->controlList(); |
|
148 |
|
149 QVERIFY( controlsList.contains( EMPXStatusPane ) ); |
|
150 QVERIFY( controlsList.contains( EMPXRealLogoBitmap ) ); |
|
151 QVERIFY( ! controlsList.contains( EMPXBufferingAnimation ) ); |
|
152 |
|
153 cleanup(); |
|
154 |
|
155 // |
|
156 // local + non RN |
|
157 // |
|
158 setup(); |
|
159 |
|
160 mFileDetails->mPlaybackMode = EMPXVideoLocal; |
|
161 mFileDetails->mRNFormat = false; |
|
162 |
|
163 mControlConfig->createControlList(); |
|
164 controlsList = mControlConfig->controlList(); |
|
165 |
|
166 QVERIFY( controlsList.contains( EMPXStatusPane ) ); |
|
167 QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) ); |
|
168 QVERIFY( ! controlsList.contains( EMPXBufferingAnimation ) ); |
|
169 |
|
170 cleanup(); |
129 } |
171 } |
130 |
172 |
131 // --------------------------------------------------------------------------- |
173 // --------------------------------------------------------------------------- |
132 // testUpdateControlsWithFileDetails |
174 // testUpdateControlsWithFileDetails |
133 // --------------------------------------------------------------------------- |
175 // --------------------------------------------------------------------------- |
135 void TestControlConfiguration::testUpdateControlsWithFileDetails() |
177 void TestControlConfiguration::testUpdateControlsWithFileDetails() |
136 { |
178 { |
137 MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlsWithFileDetails()")); |
179 MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlsWithFileDetails()")); |
138 |
180 |
139 setup(); |
181 setup(); |
140 |
182 mControlConfig->createControlList(); |
|
183 |
|
184 // |
141 // 1. test with mVideoEnabled = false |
185 // 1. test with mVideoEnabled = false |
|
186 // |
142 mControlsController->mFileDetails->mVideoEnabled = false; |
187 mControlsController->mFileDetails->mVideoEnabled = false; |
143 |
188 |
144 mControlConfig->updateControlsWithFileDetails(); |
189 mControlConfig->updateControlsWithFileDetails(); |
145 |
190 |
146 QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
191 QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
147 |
192 |
148 QVERIFY( controlsList.contains( EMPXControlBar ) ); |
193 QVERIFY( controlsList.contains( EMPXControlBar ) ); |
149 |
194 |
|
195 // |
150 // 2. test with mVideoEnabled = true |
196 // 2. test with mVideoEnabled = true |
|
197 // |
151 mControlsController->mFileDetails->mVideoEnabled = false; |
198 mControlsController->mFileDetails->mVideoEnabled = false; |
152 |
199 |
153 mControlConfig->updateControlsWithFileDetails(); |
200 mControlConfig->updateControlsWithFileDetails(); |
154 |
201 |
155 QVERIFY( controlsList.contains( EMPXControlBar ) ); |
202 QVERIFY( controlsList.contains( EMPXControlBar ) ); |
156 |
203 |
157 QGraphicsWidget *widget = |
204 QGraphicsWidget *widget = |
158 mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) ); |
205 mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) ); |
159 |
206 |
160 QVERIFY( widget->isVisible() ); |
207 QVERIFY( widget->isVisible() ); |
|
208 |
|
209 cleanup(); |
161 } |
210 } |
162 |
211 |
163 // --------------------------------------------------------------------------- |
212 // --------------------------------------------------------------------------- |
164 // testUpdateControlList |
213 // testUpdateControlList |
165 // --------------------------------------------------------------------------- |
214 // --------------------------------------------------------------------------- |
167 void TestControlConfiguration::testUpdateControlList() |
216 void TestControlConfiguration::testUpdateControlList() |
168 { |
217 { |
169 MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()")); |
218 MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()")); |
170 |
219 |
171 setup(); |
220 setup(); |
172 |
221 mControlConfig->createControlList(); |
|
222 |
|
223 // |
173 // 1. Test for Details View |
224 // 1. Test for Details View |
|
225 // |
174 mControlConfig->updateControlList( EMPXControlCmdDetailsViewOpened ); |
226 mControlConfig->updateControlList( EMPXControlCmdDetailsViewOpened ); |
175 |
|
176 QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
227 QList<TMPXVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
177 |
228 |
178 QVERIFY( controlsList.contains( EMPXFileDetailsWidget ) ); |
229 QVERIFY( controlsList.contains( EMPXFileDetailsWidget ) ); |
179 |
230 QVERIFY( controlsList.contains( EMPXDetailsViewPlaybackWindow ) ); |
180 |
231 QVERIFY( ! controlsList.contains( EMPXIndicatorBitmap ) ); |
|
232 |
|
233 |
|
234 // |
181 // 2. Test for Fullscreen View |
235 // 2. Test for Fullscreen View |
|
236 // |
182 mControlConfig->updateControlList( EMPXControlCmdFullScreenViewOpened ); |
237 mControlConfig->updateControlList( EMPXControlCmdFullScreenViewOpened ); |
183 |
|
184 controlsList = mControlConfig->controlList(); |
238 controlsList = mControlConfig->controlList(); |
185 |
239 |
186 QVERIFY( ! controlsList.contains( EMPXFileDetailsWidget ) ); |
240 QVERIFY( ! controlsList.contains( EMPXFileDetailsWidget ) ); |
187 |
241 QVERIFY( ! controlsList.contains( EMPXDetailsViewPlaybackWindow ) ); |
188 |
242 QVERIFY( ! controlsList.contains( EMPXIndicatorBitmap ) ); |
|
243 |
|
244 // |
189 // 3. Test for Audio Only View |
245 // 3. Test for Audio Only View |
|
246 // |
190 mControlConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened ); |
247 mControlConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened ); |
191 |
|
192 controlsList = mControlConfig->controlList(); |
248 controlsList = mControlConfig->controlList(); |
193 |
249 |
194 QVERIFY( ! controlsList.contains( EMPXDetailsViewPlaybackWindow ) ); |
250 QVERIFY( ! controlsList.contains( EMPXDetailsViewPlaybackWindow ) ); |
195 QVERIFY( controlsList.contains( EMPXIndicatorBitmap ) ); |
251 QVERIFY( controlsList.contains( EMPXIndicatorBitmap ) ); |
|
252 QVERIFY( controlsList.contains( EMPXFileDetailsWidget ) ); |
|
253 |
|
254 // |
|
255 // 4. RN log gets removed |
|
256 // |
|
257 mControlConfig->updateControlList( EMPXControlCmdAudionOnlyViewOpened ); |
|
258 controlsList = mControlConfig->controlList(); |
|
259 |
|
260 QVERIFY( ! controlsList.contains( EMPXRealLogoBitmap ) ); |
|
261 |
|
262 cleanup(); |
196 } |
263 } |
197 |
264 |
198 // End of file |
265 // End of file |