183 |
183 |
184 // |
184 // |
185 // 1. test with mVideoEnabled = false |
185 // 1. test with mVideoEnabled = false |
186 // |
186 // |
187 mControlsController->mFileDetails->mVideoEnabled = false; |
187 mControlsController->mFileDetails->mVideoEnabled = false; |
188 |
188 |
189 mControlConfig->updateControlsWithFileDetails(); |
189 mControlConfig->updateControlsWithFileDetails(); |
190 |
190 |
191 QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
191 QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
192 |
192 |
193 QVERIFY( controlsList.contains( EControlBar ) ); |
193 QVERIFY( controlsList.contains( EControlBar ) ); |
194 |
194 |
195 // |
195 // |
196 // 2. test with mVideoEnabled = true |
196 // 2. test with mVideoEnabled = true |
197 // |
197 // |
198 mControlsController->mFileDetails->mVideoEnabled = false; |
198 mControlsController->mFileDetails->mVideoEnabled = false; |
199 |
199 |
200 mControlConfig->updateControlsWithFileDetails(); |
200 mControlConfig->updateControlsWithFileDetails(); |
201 |
201 |
202 QVERIFY( controlsList.contains( EControlBar ) ); |
202 QVERIFY( controlsList.contains( EControlBar ) ); |
203 |
203 |
204 QGraphicsWidget *widget = |
204 QGraphicsWidget *widget = |
205 mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) ); |
205 mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) ); |
206 |
206 |
207 QVERIFY( widget->isVisible() ); |
207 QVERIFY( widget->isVisible() ); |
208 |
208 |
209 cleanup(); |
209 cleanup(); |
215 // |
215 // |
216 void TestControlConfiguration::testUpdateControlList() |
216 void TestControlConfiguration::testUpdateControlList() |
217 { |
217 { |
218 MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()")); |
218 MPX_ENTER_EXIT(_L("TestControlConfiguration::testUpdateControlList()")); |
219 |
219 |
220 setup(); |
220 setup(); |
221 mControlConfig->createControlList(); |
221 mControlConfig->createControlList(); |
222 |
222 |
|
223 QGraphicsWidget *widget = |
|
224 mControlConfig->mControlsController->layoutLoader()->findWidget( QString( "transparentWindow" ) ); |
223 // |
225 // |
224 // 1. Test for Details View |
226 // 1. Test for Details View |
225 // |
227 // |
226 mControlConfig->updateControlList( EControlCmdDetailsViewOpened ); |
228 mControlConfig->updateControlList( EControlCmdDetailsViewOpened ); |
227 QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
229 QList<TVideoPlaybackControls> controlsList = mControlConfig->controlList(); |
228 |
230 |
229 QVERIFY( controlsList.contains( EFileDetailsWidget ) ); |
231 QVERIFY( ! widget->isVisible() ); |
|
232 QVERIFY( controlsList.contains( EFileDetailsWidget ) ); |
230 QVERIFY( controlsList.contains( EDetailsViewPlaybackWindow ) ); |
233 QVERIFY( controlsList.contains( EDetailsViewPlaybackWindow ) ); |
231 QVERIFY( ! controlsList.contains( EIndicatorBitmap ) ); |
234 QVERIFY( ! controlsList.contains( EIndicatorBitmap ) ); |
232 |
235 |
233 |
236 // |
234 // |
237 // 2-1. Test for Fullscreen View |
235 // 2. Test for Fullscreen View |
238 // |
236 // |
239 mControlConfig->mSurfaceAttached = false; |
237 mControlConfig->updateControlList( EControlCmdFullScreenViewOpened ); |
240 mControlConfig->updateControlList( EControlCmdFullScreenViewOpened ); |
238 controlsList = mControlConfig->controlList(); |
241 controlsList = mControlConfig->controlList(); |
239 |
242 |
240 QVERIFY( ! controlsList.contains( EFileDetailsWidget ) ); |
243 QVERIFY( ! widget->isVisible() ); |
241 QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) ); |
244 QVERIFY( ! controlsList.contains( EFileDetailsWidget ) ); |
|
245 QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) ); |
242 QVERIFY( ! controlsList.contains( EIndicatorBitmap ) ); |
246 QVERIFY( ! controlsList.contains( EIndicatorBitmap ) ); |
243 |
247 |
244 // |
248 // |
|
249 // 2-2. Test for Fullscreen View |
|
250 // |
|
251 mControlConfig->mSurfaceAttached = true; |
|
252 mControlConfig->updateControlList( EControlCmdFullScreenViewOpened ); |
|
253 controlsList = mControlConfig->controlList(); |
|
254 |
|
255 QVERIFY( widget->isVisible() ); |
|
256 QVERIFY( ! controlsList.contains( EFileDetailsWidget ) ); |
|
257 QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) ); |
|
258 QVERIFY( ! controlsList.contains( EIndicatorBitmap ) ); |
|
259 |
|
260 // |
245 // 3. Test for Audio Only View |
261 // 3. Test for Audio Only View |
246 // |
262 // |
247 mControlConfig->updateControlList( EControlCmdAudionOnlyViewOpened ); |
263 mControlConfig->updateControlList( EControlCmdAudionOnlyViewOpened ); |
248 controlsList = mControlConfig->controlList(); |
264 controlsList = mControlConfig->controlList(); |
249 |
265 |
250 QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) ); |
266 QVERIFY( ! widget->isVisible() ); |
|
267 QVERIFY( ! controlsList.contains( EDetailsViewPlaybackWindow ) ); |
251 QVERIFY( controlsList.contains( EIndicatorBitmap ) ); |
268 QVERIFY( controlsList.contains( EIndicatorBitmap ) ); |
252 QVERIFY( controlsList.contains( EFileDetailsWidget ) ); |
269 QVERIFY( controlsList.contains( EFileDetailsWidget ) ); |
253 |
270 |
254 // |
271 // |
255 // 4. RN log gets removed |
272 // 4. RN log gets removed |
256 // |
273 // |
257 mControlConfig->updateControlList( EControlCmdAudionOnlyViewOpened ); |
274 mControlConfig->updateControlList( EControlCmdAudionOnlyViewOpened ); |
258 controlsList = mControlConfig->controlList(); |
275 controlsList = mControlConfig->controlList(); |
259 |
276 |
260 QVERIFY( ! controlsList.contains( ERealLogoBitmap ) ); |
277 QVERIFY( ! controlsList.contains( ERealLogoBitmap ) ); |
261 |
278 |
|
279 // |
|
280 // 5. Surface attached |
|
281 // |
|
282 mControlConfig->updateControlList( EControlCmdSurfaceAttached ); |
|
283 controlsList = mControlConfig->controlList(); |
|
284 |
|
285 QVERIFY( widget->isVisible() ); |
|
286 |
|
287 // |
|
288 // 6. Surface detached |
|
289 // |
|
290 mControlConfig->updateControlList( EControlCmdSurfaceDetached ); |
|
291 controlsList = mControlConfig->controlList(); |
|
292 |
|
293 QVERIFY( ! widget->isVisible() ); |
262 cleanup(); |
294 cleanup(); |
263 } |
295 } |
264 |
296 |
265 // End of file |
297 // End of file |