34
|
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: tester for methods in Video Playback Controls Controller
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
39
|
18 |
// Version : %version: 9 %
|
34
|
19 |
|
|
20 |
#include <e32err.h>
|
|
21 |
#include <w32std.h>
|
|
22 |
#include <qobject>
|
|
23 |
|
|
24 |
#include <hbapplication.h>
|
|
25 |
#include <hbinstance.h>
|
|
26 |
#include <hblabel.h>
|
|
27 |
#include <MMFScalingCustomCommandConstants.h>
|
|
28 |
|
|
29 |
#include "mpxvideo_debug.h"
|
|
30 |
#include "mpxvideoplaybackcontrol.hrh"
|
|
31 |
#include "mpxcommonvideoplaybackview.hrh"
|
|
32 |
#include "testmpxvideoplaybackcontrolscontroller.h"
|
|
33 |
#include "hbvideobaseplaybackview.h"
|
|
34 |
#include "mpxvideoplaybackviewfiledetails.h"
|
|
35 |
#include "mpxvideoviewwrapper.h"
|
|
36 |
#include "mpxvideoplaybackfullscreencontrol.h"
|
|
37 |
#include "mpxvideoplaybackcontrolconfiguration.h"
|
|
38 |
#include "thumbnailmanager_qt.h"
|
|
39 |
#include "mpxvideoplaybackdocumentloader.h"
|
36
|
40 |
#include "hbvolumesliderpopup.h"
|
|
41 |
#include "videoservices.h"
|
|
42 |
#include "xqserviceutilxtra.h"
|
34
|
43 |
|
|
44 |
#define private public
|
|
45 |
#include "mpxvideoplaybackcontrolscontroller.h"
|
|
46 |
#undef private
|
|
47 |
|
|
48 |
const TInt KControlListsUpdated = 12; // additional extension of TMPXPlaybackState
|
|
49 |
|
|
50 |
// ---------------------------------------------------------------------------
|
|
51 |
// main
|
|
52 |
// ---------------------------------------------------------------------------
|
|
53 |
//
|
|
54 |
int main(int argc, char *argv[])
|
|
55 |
{
|
|
56 |
HbApplication app(argc, argv);
|
|
57 |
HbMainWindow window;
|
|
58 |
TestMPXVideoPlaybackControlsController tv;
|
|
59 |
|
|
60 |
char *pass[3];
|
|
61 |
pass[0] = argv[0];
|
|
62 |
pass[1] = "-o";
|
|
63 |
pass[2] = "c:\\data\\TestMPXVideoPlaybackControlsController.txt";
|
|
64 |
|
|
65 |
int res = QTest::qExec(&tv, 3, pass);
|
|
66 |
|
|
67 |
return res;
|
|
68 |
}
|
|
69 |
|
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
// init
|
|
72 |
// ---------------------------------------------------------------------------
|
|
73 |
//
|
|
74 |
void TestMPXVideoPlaybackControlsController::init()
|
|
75 |
{
|
|
76 |
MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlsController::init()"));
|
|
77 |
|
|
78 |
mBaseVideoView = new HbVideoBasePlaybackView();
|
39
|
79 |
|
|
80 |
if ( ! mFileDetails )
|
|
81 |
{
|
|
82 |
mFileDetails = new QMPXVideoPlaybackViewFileDetails();
|
|
83 |
}
|
34
|
84 |
mViewWrapper = CMPXVideoViewWrapper::NewL( mBaseVideoView );
|
|
85 |
mController = new QMPXVideoPlaybackControlsController( mBaseVideoView,
|
|
86 |
mViewWrapper,
|
|
87 |
mFileDetails );
|
|
88 |
}
|
|
89 |
|
|
90 |
// ---------------------------------------------------------------------------
|
|
91 |
// cleanup
|
|
92 |
// ---------------------------------------------------------------------------
|
|
93 |
//
|
|
94 |
void TestMPXVideoPlaybackControlsController::cleanup()
|
|
95 |
{
|
|
96 |
MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackControlsController::cleanup()"));
|
|
97 |
|
|
98 |
delete mController;
|
|
99 |
mController = NULL;
|
|
100 |
|
|
101 |
delete mFileDetails;
|
|
102 |
mFileDetails = NULL;
|
|
103 |
|
|
104 |
delete mViewWrapper;
|
|
105 |
mViewWrapper = NULL;
|
|
106 |
|
|
107 |
delete mBaseVideoView;
|
|
108 |
mBaseVideoView = NULL;
|
|
109 |
}
|
|
110 |
|
|
111 |
// -------------------------------------------------------------------------------------------------
|
|
112 |
// TestMPXVideoPlaybackControlsController::testAddFileDetails
|
|
113 |
// -------------------------------------------------------------------------------------------------
|
|
114 |
//
|
|
115 |
void TestMPXVideoPlaybackControlsController::testAddFileDetails()
|
|
116 |
{
|
|
117 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testAddFileDetails()") );
|
39
|
118 |
|
34
|
119 |
//
|
|
120 |
// local real media with no video
|
|
121 |
//
|
39
|
122 |
mFileDetails = new QMPXVideoPlaybackViewFileDetails();
|
|
123 |
mFileDetails->mClipName = QString( "testClip.rm" );
|
|
124 |
mFileDetails->mMimeType = QString( "video/x-pn-realvideo" );
|
|
125 |
|
|
126 |
init();
|
|
127 |
|
34
|
128 |
mController->addFileDetails( mFileDetails );
|
|
129 |
|
|
130 |
QVERIFY( mController->mFileDetails->mRNFormat == true );
|
|
131 |
QVERIFY( mController->mViewMode == EAudioOnlyView );
|
|
132 |
QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
|
|
133 |
QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected );
|
39
|
134 |
|
|
135 |
cleanup();
|
|
136 |
|
34
|
137 |
//
|
|
138 |
// local 3GPP media with video-only
|
39
|
139 |
//
|
|
140 |
mFileDetails = new QMPXVideoPlaybackViewFileDetails();
|
|
141 |
|
34
|
142 |
mFileDetails->mClipName = QString("testClip.3gp");
|
|
143 |
mFileDetails->mMimeType = QString("video/3gpp");
|
|
144 |
mFileDetails->mVideoEnabled = true;
|
39
|
145 |
mFileDetails->mTvOutConnected = true;
|
|
146 |
|
|
147 |
init();
|
|
148 |
|
34
|
149 |
mController->mViewMode = EFullScreenView;
|
|
150 |
QFileInfo videoOnlyFile( mFileDetails->mClipName );
|
39
|
151 |
|
34
|
152 |
mController->addFileDetails( mFileDetails );
|
|
153 |
|
|
154 |
QVERIFY( mController->mFileDetails->mRNFormat == false );
|
|
155 |
QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
|
|
156 |
|
|
157 |
//
|
|
158 |
// validate 'TvOutConnected'
|
|
159 |
//
|
|
160 |
verifyHandleEventTvOutResult(true, true);
|
|
161 |
|
|
162 |
//
|
|
163 |
// video-only, validate volume control is dimmed
|
|
164 |
//
|
|
165 |
QVERIFY( mController->mVolumeControl->mValue == 0 );
|
|
166 |
QVERIFY( mController->mVolumeControl->isEnabled() == false );
|
|
167 |
|
|
168 |
//
|
|
169 |
// verify 'title' (via mClipName) is set properly
|
|
170 |
//
|
|
171 |
for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
|
|
172 |
{
|
|
173 |
if( mController->mLoader->mWidgets[i]->objectName() == QString( "title" ) )
|
|
174 |
{
|
|
175 |
HbLabel *titleLabel = qobject_cast<HbLabel*>( mController->mLoader->mWidgets[i] );
|
|
176 |
QVERIFY( titleLabel->plainText() == videoOnlyFile.baseName() );
|
|
177 |
break;
|
|
178 |
}
|
|
179 |
}
|
39
|
180 |
cleanup();
|
|
181 |
|
34
|
182 |
//
|
|
183 |
// non-local audio-video media, TvOut is not connected
|
|
184 |
//
|
39
|
185 |
mFileDetails = new QMPXVideoPlaybackViewFileDetails();
|
|
186 |
|
34
|
187 |
mFileDetails->mClipName = QString("rtsp:://www.youtube.com/testClip.rm");
|
|
188 |
mFileDetails->mPlaybackMode = EMPXVideoStreaming;
|
|
189 |
mFileDetails->mTvOutConnected = false;
|
|
190 |
mFileDetails->mAudioEnabled = true;
|
|
191 |
mFileDetails->mTitle = QString("Clip Title");
|
39
|
192 |
|
|
193 |
init();
|
|
194 |
|
34
|
195 |
mController->addFileDetails( mFileDetails );
|
|
196 |
|
|
197 |
QVERIFY( mController->mFileDetails->mRNFormat == true );
|
|
198 |
QVERIFY( mController->mControlsConfig->mUpdateControlsWithFileDetails == true );
|
|
199 |
|
|
200 |
//
|
|
201 |
// verify 'title' (via mTitle) is set properly
|
|
202 |
//
|
|
203 |
for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
|
|
204 |
{
|
|
205 |
if( mController->mLoader->mWidgets[i]->objectName() == QString( "title" ) )
|
|
206 |
{
|
|
207 |
HbLabel *titleLabel = qobject_cast<HbLabel*>( mController->mLoader->mWidgets[i] );
|
|
208 |
QVERIFY( titleLabel->plainText() == mFileDetails->mTitle );
|
|
209 |
break;
|
|
210 |
}
|
|
211 |
}
|
|
212 |
|
|
213 |
cleanup();
|
|
214 |
}
|
|
215 |
|
|
216 |
// -------------------------------------------------------------------------------------------------
|
|
217 |
// TestMPXVideoPlaybackControlsController::testHandleEventSetPosition
|
|
218 |
// -------------------------------------------------------------------------------------------------
|
|
219 |
//
|
|
220 |
void TestMPXVideoPlaybackControlsController::testHandleEventSetPosition()
|
|
221 |
{
|
|
222 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetPosition()"));
|
|
223 |
|
|
224 |
init();
|
|
225 |
int value = 20000;
|
|
226 |
|
|
227 |
mController->handleEvent( EMPXControlCmdSetPosition, value );
|
39
|
228 |
|
|
229 |
QVERIFY( mController->mControls[0]->mPosition == ( value / KPbMilliMultiplier ) );
|
34
|
230 |
|
|
231 |
cleanup();
|
|
232 |
}
|
|
233 |
|
|
234 |
// -------------------------------------------------------------------------------------------------
|
|
235 |
// TestMPXVideoPlaybackControlsController::testHandleEventSetDuration
|
|
236 |
// -------------------------------------------------------------------------------------------------
|
|
237 |
//
|
|
238 |
void TestMPXVideoPlaybackControlsController::testHandleEventSetDuration()
|
|
239 |
{
|
|
240 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDuration()"));
|
|
241 |
|
|
242 |
init();
|
|
243 |
int value = 30000;
|
|
244 |
|
|
245 |
mController->handleEvent( EMPXControlCmdSetDuration, value );
|
39
|
246 |
|
|
247 |
QVERIFY( mController->mControls[0]->mDuration == ( value / KPbMilliMultiplier ) );
|
34
|
248 |
|
|
249 |
cleanup();
|
|
250 |
}
|
|
251 |
|
|
252 |
// -------------------------------------------------------------------------------------------------
|
|
253 |
// TestMPXVideoPlaybackControlsController::testHandleEventStateChanged
|
|
254 |
// -------------------------------------------------------------------------------------------------
|
|
255 |
//
|
|
256 |
void TestMPXVideoPlaybackControlsController::testHandleEventStateChanged()
|
|
257 |
{
|
|
258 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventStateChanged()"));
|
|
259 |
|
|
260 |
init();
|
|
261 |
TMPXVideoPlaybackControlCommandIds event = EMPXControlCmdStateChanged;
|
39
|
262 |
mController->mOrientation = Qt::Horizontal;
|
|
263 |
|
34
|
264 |
//
|
|
265 |
// state change (EPbStateInitialising)
|
|
266 |
//
|
36
|
267 |
int value = EPbStateInitialising;
|
34
|
268 |
mController->handleEvent( event, value );
|
|
269 |
verifyHandleEventStateChangedResult( value );
|
|
270 |
|
|
271 |
//
|
|
272 |
// state change (EPbStateBuffering)
|
|
273 |
//
|
|
274 |
value = EPbStateBuffering;
|
|
275 |
mController->handleEvent( event, value );
|
|
276 |
verifyHandleEventStateChangedResult( value );
|
|
277 |
|
|
278 |
//
|
|
279 |
// state change (EPbStatePlaying)
|
|
280 |
//
|
|
281 |
value = EPbStatePlaying;
|
|
282 |
mController->handleEvent( event, value );
|
|
283 |
verifyHandleEventStateChangedResult( value );
|
|
284 |
|
|
285 |
//
|
|
286 |
// state change (EPbStatePaused)
|
|
287 |
//
|
|
288 |
value = EPbStatePaused;
|
|
289 |
mController->handleEvent( event, value );
|
|
290 |
verifyHandleEventStateChangedResult( value );
|
|
291 |
|
|
292 |
//
|
|
293 |
// state change (EPbStateNotInitialised)
|
|
294 |
//
|
|
295 |
value = EPbStateNotInitialised;
|
|
296 |
mController->handleEvent( event, value );
|
|
297 |
verifyHandleEventStateChangedResult( value );
|
|
298 |
|
|
299 |
//
|
|
300 |
// state change (EPbStateStopped)
|
|
301 |
//
|
|
302 |
value = EPbStateStopped;
|
|
303 |
mController->handleEvent( event, value );
|
|
304 |
verifyHandleEventStateChangedResult( value );
|
|
305 |
|
|
306 |
//
|
|
307 |
// state change (EPbStateSeekingForward)
|
|
308 |
//
|
|
309 |
value = EPbStateSeekingForward;
|
|
310 |
mController->handleEvent( event, value );
|
|
311 |
verifyHandleEventStateChangedResult( value );
|
|
312 |
|
|
313 |
//
|
|
314 |
// state change (EPbStateSeekingBackward)
|
|
315 |
//
|
|
316 |
value = EPbStateSeekingBackward;
|
|
317 |
mController->handleEvent( event, value );
|
|
318 |
verifyHandleEventStateChangedResult( value );
|
|
319 |
|
|
320 |
//
|
|
321 |
// state change (EPbStateShuttingDown)
|
|
322 |
//
|
|
323 |
value = EPbStateShuttingDown;
|
|
324 |
mController->handleEvent( event, value );
|
|
325 |
verifyHandleEventStateChangedResult( value );
|
|
326 |
|
|
327 |
//
|
|
328 |
// state change (EPbStateDownloading)
|
|
329 |
//
|
|
330 |
value = EPbStateDownloading;
|
|
331 |
mController->handleEvent( event, value );
|
|
332 |
verifyHandleEventStateChangedResult( value );
|
|
333 |
|
|
334 |
//
|
|
335 |
// state change (EPbStatePluginSeeking)
|
|
336 |
//
|
|
337 |
value = EPbStatePluginSeeking;
|
|
338 |
mController->handleEvent( event, value );
|
|
339 |
verifyHandleEventStateChangedResult( value );
|
|
340 |
|
|
341 |
cleanup();
|
|
342 |
}
|
|
343 |
|
|
344 |
// -------------------------------------------------------------------------------------------------
|
|
345 |
// TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult
|
|
346 |
// -------------------------------------------------------------------------------------------------
|
|
347 |
//
|
|
348 |
void TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult( int value )
|
|
349 |
{
|
|
350 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventStateChangedResult()"));
|
|
351 |
|
38
|
352 |
mController->mOrientation = Qt::Horizontal;
|
|
353 |
|
34
|
354 |
if ( value == EPbStateInitialised &&
|
|
355 |
( mController->mFileDetails->mPlaybackMode == EMPXVideoStreaming ||
|
|
356 |
mController->mFileDetails->mPlaybackMode == EMPXVideoLiveStreaming ) )
|
|
357 |
{
|
|
358 |
QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdPluginInitialized );
|
|
359 |
}
|
|
360 |
else if ( value == EPbStatePlaying || value == EPbStateInitialising ||
|
|
361 |
value == EPbStateBuffering || value == EPbStatePaused ||
|
|
362 |
value == EPbStateNotInitialised )
|
|
363 |
{
|
|
364 |
for ( int i = 0 ; i < mController->mControls.count() ; i++ )
|
|
365 |
{
|
|
366 |
QVERIFY( mController->mControls[i]->mState == value );
|
|
367 |
QVERIFY( mController->mControls[i]->mVisibilityState == value );
|
|
368 |
}
|
|
369 |
}
|
|
370 |
else
|
|
371 |
{
|
|
372 |
QVERIFY( mController->mState == value );
|
|
373 |
}
|
|
374 |
}
|
|
375 |
|
|
376 |
// -------------------------------------------------------------------------------------------------
|
|
377 |
// TestMPXVideoPlaybackControlsController::testHandleEventSetVolume
|
|
378 |
// -------------------------------------------------------------------------------------------------
|
|
379 |
//
|
|
380 |
void TestMPXVideoPlaybackControlsController::testHandleEventSetVolume()
|
|
381 |
{
|
|
382 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetVolume()"));
|
|
383 |
|
|
384 |
init();
|
|
385 |
int value = 40;
|
|
386 |
|
|
387 |
mController->handleEvent( EMPXControlCmdSetVolume, value );
|
|
388 |
QVERIFY( mController->mVolumeControl->mValue == value );
|
|
389 |
|
|
390 |
cleanup();
|
|
391 |
}
|
|
392 |
|
|
393 |
// -------------------------------------------------------------------------------------------------
|
|
394 |
// TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio
|
|
395 |
// -------------------------------------------------------------------------------------------------
|
|
396 |
//
|
|
397 |
void TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio()
|
|
398 |
{
|
|
399 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetAspectRatio()"));
|
|
400 |
|
|
401 |
init();
|
|
402 |
int numScalingType = 5;
|
|
403 |
|
|
404 |
for ( int i = 0; i < numScalingType; i++ )
|
|
405 |
{
|
|
406 |
mController->handleEvent( EMPXControlCmdSetAspectRatio, i );
|
|
407 |
|
39
|
408 |
QVERIFY( mController->mControls[0]->mAspectRatio == i );
|
34
|
409 |
}
|
|
410 |
|
|
411 |
cleanup();
|
|
412 |
}
|
|
413 |
|
|
414 |
// -------------------------------------------------------------------------------------------------
|
|
415 |
// TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadSize
|
|
416 |
// -------------------------------------------------------------------------------------------------
|
|
417 |
//
|
|
418 |
void TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadSize()
|
|
419 |
{
|
|
420 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadSize()") );
|
|
421 |
|
|
422 |
init();
|
|
423 |
int value = 50;
|
|
424 |
|
|
425 |
mController->handleEvent( EMPXControlCmdSetDownloadSize, value );
|
|
426 |
|
39
|
427 |
QVERIFY( mController->mControls[0]->mDownloadSize == value );
|
34
|
428 |
|
|
429 |
cleanup();
|
|
430 |
}
|
|
431 |
|
|
432 |
// -------------------------------------------------------------------------------------------------
|
|
433 |
// TestMPXVideoPlaybackControlsController::testHandleEventDownloadUpdated
|
|
434 |
// -------------------------------------------------------------------------------------------------
|
|
435 |
//
|
|
436 |
void TestMPXVideoPlaybackControlsController::testHandleEventDownloadUpdated()
|
|
437 |
{
|
|
438 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventDownloadUpdated()") );
|
|
439 |
|
|
440 |
init();
|
|
441 |
int value = 55;
|
|
442 |
|
|
443 |
mController->handleEvent( EMPXControlCmdDownloadUpdated, value );
|
39
|
444 |
|
|
445 |
QVERIFY( mController->mControls[0]->mDownloadPosition == value );
|
34
|
446 |
|
|
447 |
cleanup();
|
|
448 |
}
|
|
449 |
|
|
450 |
// -------------------------------------------------------------------------------------------------
|
|
451 |
// TestMPXVideoPlaybackControlsController::testHandleEventDownloadComplete
|
|
452 |
// -------------------------------------------------------------------------------------------------
|
|
453 |
//
|
|
454 |
void TestMPXVideoPlaybackControlsController::testHandleEventDownloadComplete()
|
|
455 |
{
|
|
456 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventDownloadComplete()") );
|
|
457 |
|
|
458 |
init();
|
|
459 |
int value = 60;
|
|
460 |
|
|
461 |
mController->handleEvent( EMPXControlCmdDownloadComplete, value );
|
39
|
462 |
|
|
463 |
QVERIFY( mController->mControls[0]->mDownloadPosition == value );
|
34
|
464 |
|
|
465 |
cleanup();
|
|
466 |
}
|
|
467 |
|
|
468 |
// -------------------------------------------------------------------------------------------------
|
|
469 |
// TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadPaused
|
|
470 |
// -------------------------------------------------------------------------------------------------
|
|
471 |
//
|
|
472 |
void TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadPaused()
|
|
473 |
{
|
|
474 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventSetDownloadPaused()") );
|
|
475 |
|
|
476 |
init();
|
|
477 |
int value = 0;
|
|
478 |
|
|
479 |
mController->handleEvent( EMPXControlCmdSetDownloadPaused, value );
|
|
480 |
|
|
481 |
QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
|
|
482 |
|
|
483 |
cleanup();
|
|
484 |
}
|
|
485 |
|
|
486 |
// -------------------------------------------------------------------------------------------------
|
|
487 |
// TestMPXVideoPlaybackControlsController::testHandleEventClearDownloadPaused
|
|
488 |
// -------------------------------------------------------------------------------------------------
|
|
489 |
//
|
|
490 |
void TestMPXVideoPlaybackControlsController::testHandleEventClearDownloadPaused()
|
|
491 |
{
|
|
492 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventClearDownloadPaused()") );
|
|
493 |
|
|
494 |
init();
|
|
495 |
int value = 0;
|
|
496 |
|
|
497 |
mController->handleEvent( EMPXControlCmdClearDownloadPaused, value );
|
|
498 |
|
|
499 |
QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
|
|
500 |
|
|
501 |
cleanup();
|
|
502 |
}
|
|
503 |
|
|
504 |
// -------------------------------------------------------------------------------------------------
|
|
505 |
// TestMPXVideoPlaybackControlsController::testHandleEventTvOutConnected
|
|
506 |
// -------------------------------------------------------------------------------------------------
|
|
507 |
//
|
|
508 |
void TestMPXVideoPlaybackControlsController::testHandleEventTvOutConnected()
|
|
509 |
{
|
|
510 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventTvOutConnected()") );
|
|
511 |
|
|
512 |
init();
|
|
513 |
|
|
514 |
//
|
|
515 |
// TV-Out Connected, value = true, EMPXVideoLocal
|
|
516 |
//
|
|
517 |
mController->handleEvent( EMPXControlCmdTvOutConnected, true );
|
|
518 |
verifyHandleEventTvOutResult( true, true );
|
|
519 |
|
|
520 |
//
|
|
521 |
// TV-Out Connected, value = false, EMPXVideoLocal
|
|
522 |
//
|
|
523 |
mController->handleEvent( EMPXControlCmdTvOutConnected, false );
|
|
524 |
verifyHandleEventTvOutResult( true, false );
|
|
525 |
|
|
526 |
//
|
|
527 |
// TV-Out Connected, value = false, non-EMPXVideoLocal
|
|
528 |
//
|
|
529 |
mController->mFileDetails->mPlaybackMode = EMPXVideoStreaming;
|
|
530 |
mController->handleEvent( EMPXControlCmdTvOutConnected, false );
|
|
531 |
verifyHandleEventTvOutResult( true, false );
|
|
532 |
|
|
533 |
cleanup();
|
|
534 |
}
|
|
535 |
|
|
536 |
// -------------------------------------------------------------------------------------------------
|
|
537 |
// TestMPXVideoPlaybackControlsController::verifyHandleEventTvOutResult
|
|
538 |
// -------------------------------------------------------------------------------------------------
|
|
539 |
//
|
|
540 |
void TestMPXVideoPlaybackControlsController::verifyHandleEventTvOutResult( bool tvOutConnected,
|
|
541 |
bool value )
|
|
542 |
{
|
|
543 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::verifyHandleEventTvOutResult(%d,%d)"),
|
|
544 |
tvOutConnected, value );
|
|
545 |
|
|
546 |
QVERIFY( mController->mFileDetails->mTvOutConnected == tvOutConnected );
|
|
547 |
|
|
548 |
//
|
|
549 |
// validate setDefaultBitmap()
|
|
550 |
//
|
|
551 |
for ( int i=0 ; i < mController->mLoader->mWidgets.count() ; i++ )
|
|
552 |
{
|
|
553 |
bool val = mController->mLoader->isVisible(i);
|
|
554 |
|
|
555 |
if( mController->mLoader->mWidgets[i]->objectName() == QString( "tvOutBitmap" ) )
|
|
556 |
{
|
|
557 |
QVERIFY( tvOutConnected? val == true : val == false );
|
|
558 |
}
|
|
559 |
else if( mController->mLoader->mWidgets[i]->objectName() == QString( "realAudioOnlyBitmap" ) )
|
|
560 |
{
|
|
561 |
QVERIFY( mFileDetails->mRNFormat? val == true : val == false );
|
|
562 |
}
|
|
563 |
else if( mController->mLoader->mWidgets[i]->objectName() == QString( "partialAudioOnlyBitmap" ) )
|
|
564 |
{
|
|
565 |
QVERIFY( mFileDetails->mPartialPlayback? val == true : val == false );
|
|
566 |
}
|
|
567 |
else if( mController->mLoader->mWidgets[i]->objectName() == QString( "audioOnlyBitmap" ) )
|
|
568 |
{
|
|
569 |
QVERIFY( tvOutConnected? val == false : val == true );
|
|
570 |
}
|
|
571 |
}
|
|
572 |
|
|
573 |
//
|
|
574 |
// validate generateThumbNail()
|
|
575 |
//
|
|
576 |
if ( tvOutConnected )
|
|
577 |
{
|
|
578 |
QVERIFY( ( mController->mFileDetails->mPlaybackMode == EMPXVideoLocal )?
|
|
579 |
mController->mThumbNailState == EThumbNailRequsted :
|
|
580 |
mController->mThumbNailState == EThumbNailNotAvailable );
|
|
581 |
QVERIFY( mController->mViewMode == EAudioOnlyView );
|
|
582 |
QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdTvOutConnected );
|
|
583 |
QVERIFY( mController->mThumbnailManager->mThumbSize == ThumbnailManager::ThumbnailLarge );
|
|
584 |
QVERIFY( mController->mThumbnailManager->mQuality == ThumbnailManager::OptimizeForPerformance );
|
|
585 |
QVERIFY( mController->mViewTransitionIsGoingOn == false );
|
|
586 |
}
|
|
587 |
else if ( mController->mFileDetails->mVideoEnabled )
|
|
588 |
{
|
|
589 |
QVERIFY( mController->mViewTransitionIsGoingOn == true );
|
|
590 |
QVERIFY( mController->mViewMode == EFullScreenView );
|
|
591 |
}
|
|
592 |
else if ( ! mController->mFileDetails->mVideoEnabled )
|
|
593 |
{
|
|
594 |
QVERIFY( mController->mViewTransitionIsGoingOn == false );
|
|
595 |
QVERIFY( mController->mViewMode == EAudioOnlyView );
|
|
596 |
}
|
|
597 |
|
|
598 |
}
|
|
599 |
|
|
600 |
// -------------------------------------------------------------------------------------------------
|
|
601 |
// TestMPXVideoPlaybackControlsController::testHandleEventTvOutDisconnected
|
|
602 |
// -------------------------------------------------------------------------------------------------
|
|
603 |
//
|
|
604 |
void TestMPXVideoPlaybackControlsController::testHandleEventTvOutDisconnected()
|
|
605 |
{
|
|
606 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventTvOutDisconnected()") );
|
|
607 |
|
|
608 |
init();
|
|
609 |
|
|
610 |
//
|
|
611 |
// TV-Out Disconnected, value = true
|
|
612 |
//
|
|
613 |
mController->handleEvent( EMPXControlCmdTvOutDisconnected, true );
|
|
614 |
verifyHandleEventTvOutResult( false, true );
|
|
615 |
|
|
616 |
//
|
|
617 |
// TV-Out Disconnected, value = false
|
|
618 |
//
|
|
619 |
mController->handleEvent( EMPXControlCmdTvOutDisconnected, false );
|
|
620 |
verifyHandleEventTvOutResult( false, false );
|
|
621 |
|
|
622 |
cleanup();
|
|
623 |
}
|
|
624 |
|
|
625 |
// -------------------------------------------------------------------------------------------------
|
|
626 |
// TestMPXVideoPlaybackControlsController::testHandleEventHandleErrors
|
|
627 |
// -------------------------------------------------------------------------------------------------
|
|
628 |
//
|
|
629 |
void TestMPXVideoPlaybackControlsController::testHandleEventHandleErrors()
|
|
630 |
{
|
|
631 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventHandleErrors()") );
|
|
632 |
|
|
633 |
init();
|
|
634 |
|
|
635 |
//
|
|
636 |
// handle error
|
|
637 |
//
|
|
638 |
mController->handleEvent( EMPXControlCmdHandleErrors, 0 );
|
|
639 |
|
|
640 |
QVERIFY( mController->mThumbNailState == EThumbNailEmpty );
|
|
641 |
QVERIFY( mController->mState == EPbStateNotInitialised );
|
|
642 |
QVERIFY( mController->mViewMode == EFullScreenView );
|
|
643 |
|
|
644 |
cleanup();
|
|
645 |
}
|
|
646 |
|
|
647 |
// -------------------------------------------------------------------------------------------------
|
|
648 |
// TestMPXVideoPlaybackControlsController::testHandleEventShowVolumeControls
|
|
649 |
// -------------------------------------------------------------------------------------------------
|
|
650 |
//
|
|
651 |
void TestMPXVideoPlaybackControlsController::testHandleEventShowVolumeControls()
|
|
652 |
{
|
|
653 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleEventShowVolumeControls()") );
|
|
654 |
|
|
655 |
init();
|
|
656 |
|
|
657 |
mController->handleEvent( EMPXControlCmdShowVolumeControls, 0 );
|
|
658 |
|
|
659 |
QVERIFY( mController->mVolumeControl->mVisible == true );
|
|
660 |
|
|
661 |
cleanup();
|
|
662 |
}
|
|
663 |
|
|
664 |
// -------------------------------------------------------------------------------------------------
|
|
665 |
// TestMPXVideoPlaybackControlsController::testHandleCommand
|
|
666 |
// -------------------------------------------------------------------------------------------------
|
|
667 |
//
|
|
668 |
void TestMPXVideoPlaybackControlsController::testHandleCommand()
|
|
669 |
{
|
|
670 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleCommand()") );
|
|
671 |
|
|
672 |
init();
|
|
673 |
|
|
674 |
mController->handleCommand( EMPXPbvCmdSetPosition, 0 );
|
|
675 |
QVERIFY( mViewWrapper->mProperty == EPbPropertyPosition );
|
|
676 |
|
|
677 |
mController->handleCommand( EMPXPbvCmdSetVolume, 0 );
|
|
678 |
QVERIFY( mViewWrapper->mProperty == EPbPropertyVolume );
|
|
679 |
|
|
680 |
mController->handleCommand( EMPXPbvCmdPlay, 0 );
|
|
681 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPlay );
|
|
682 |
|
|
683 |
mController->handleCommand( EMPXPbvCmdPause, 0 );
|
|
684 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPause );
|
|
685 |
|
|
686 |
mController->handleCommand( EMPXPbvCmdPlayPause, 0 );
|
|
687 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPlayPause );
|
|
688 |
|
|
689 |
mController->handleCommand( EMPXPbvCmdStop, 0 );
|
|
690 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdStop );
|
|
691 |
|
|
692 |
mController->handleCommand( EMPXPbvCmdClose, 0 );
|
|
693 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdClose );
|
|
694 |
|
|
695 |
mController->handleCommand( EMPXPbvCmdMute, 0 );
|
|
696 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdMute );
|
|
697 |
|
|
698 |
mController->handleCommand( EMPXPbvCmdUnMute, 0 );
|
|
699 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdUnMute );
|
|
700 |
|
|
701 |
mController->handleCommand( EMPXPbvCmdChangeAspectRatio, 0 );
|
|
702 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdChangeAspectRatio );
|
|
703 |
|
|
704 |
mController->handleCommand( EMPXPbvCmdNaturalAspectRatio, 0 );
|
|
705 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNaturalAspectRatio );
|
|
706 |
|
|
707 |
mController->handleCommand( EMPXPbvCmdZoomAspectRatio, 0 );
|
|
708 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdZoomAspectRatio );
|
|
709 |
|
|
710 |
mController->handleCommand( EMPXPbvCmdStretchAspectRatio, 0 );
|
|
711 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdStretchAspectRatio );
|
|
712 |
|
|
713 |
mController->handleCommand( EMPXPbvCmdSeekForward, 0 );
|
|
714 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSeekForward );
|
|
715 |
|
|
716 |
mController->handleCommand( EMPXPbvCmdSeekBackward, 0 );
|
|
717 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSeekBackward );
|
|
718 |
|
|
719 |
mController->handleCommand( EMPXPbvCmdEndSeek, 0 );
|
|
720 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdEndSeek );
|
|
721 |
|
|
722 |
mController->handleCommand( EMPXPbvCmdNextListItem, 0 );
|
|
723 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNextListItem );
|
|
724 |
|
|
725 |
mController->handleCommand( EMPXPbvCmdPreviousListItem, 0 );
|
|
726 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPreviousListItem );
|
|
727 |
|
|
728 |
mController->handleCommand( EMPXPbvCmdDecreaseVolume, 0 );
|
|
729 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdDecreaseVolume );
|
|
730 |
|
|
731 |
mController->handleCommand( EMPXPbvCmdIncreaseVolume, 0 );
|
|
732 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdIncreaseVolume );
|
|
733 |
|
|
734 |
mController->handleCommand( EMPXPbvCmdPosition, 0 );
|
|
735 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPosition );
|
|
736 |
|
|
737 |
mController->handleCommand( EMPXPbvCmdSave, 0 );
|
|
738 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdSave );
|
|
739 |
|
|
740 |
mController->handleCommand( EMPXPbvCmdResetControls, 0 );
|
|
741 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdResetControls );
|
|
742 |
|
|
743 |
mController->handleCommand( EMPXPbvCmdShortPressForward, 0 );
|
|
744 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShortPressForward );
|
|
745 |
|
|
746 |
mController->handleCommand( EMPXPbvCmdShortPressBackward, 0 );
|
|
747 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShortPressBackward );
|
|
748 |
|
|
749 |
mController->handleCommand( EMPXPbvCmdShowFileDetails, 0 );
|
|
750 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdShowFileDetails );
|
|
751 |
|
|
752 |
mController->handleCommand( EMPXPbvCmdEndOfClip, 0 );
|
|
753 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdEndOfClip );
|
|
754 |
|
|
755 |
mController->handleCommand( EMPXPbvCmdCustomPause, 0 );
|
|
756 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdCustomPause );
|
|
757 |
|
|
758 |
mController->handleCommand( EMPXPbvCmdCustomPlay, 0 );
|
|
759 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdCustomPlay );
|
|
760 |
|
|
761 |
mController->handleCommand( EMPXPbvCmdExit, 0 );
|
|
762 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdExit );
|
|
763 |
|
|
764 |
mController->handleCommand( EMPXPbvLaunchDRMDetails, 0 );
|
|
765 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvLaunchDRMDetails );
|
|
766 |
|
|
767 |
mController->handleCommand( EMPXPbvSurfaceCreated, 0 );
|
|
768 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvSurfaceCreated );
|
|
769 |
|
|
770 |
cleanup();
|
|
771 |
}
|
|
772 |
|
|
773 |
// -------------------------------------------------------------------------------------------------
|
|
774 |
// TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen
|
|
775 |
// -------------------------------------------------------------------------------------------------
|
|
776 |
//
|
|
777 |
void TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen()
|
|
778 |
{
|
|
779 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testHandleTappedOnScreen()") );
|
|
780 |
|
|
781 |
init();
|
38
|
782 |
mController->mOrientation = Qt::Horizontal;
|
|
783 |
|
34
|
784 |
//
|
|
785 |
// preset variables
|
|
786 |
//
|
|
787 |
mFileDetails->mVideoEnabled = true;
|
|
788 |
mController->mViewMode = EFullScreenView;
|
|
789 |
|
|
790 |
//
|
|
791 |
// playing state
|
|
792 |
//
|
38
|
793 |
mController->mState = EPbStatePlaying;
|
|
794 |
mBaseVideoView->mouseReleaseEvent(0);
|
34
|
795 |
QVERIFY( mController->mControlsTimer->isActive() == true );
|
|
796 |
for ( int i = 0 ; i < mController->mControls.count() ; i++ )
|
|
797 |
{
|
38
|
798 |
QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
|
34
|
799 |
}
|
|
800 |
|
|
801 |
//
|
|
802 |
// pause state
|
|
803 |
//
|
|
804 |
mController->mState = EPbStatePaused;
|
38
|
805 |
mBaseVideoView->mouseReleaseEvent(0);
|
34
|
806 |
QVERIFY( mController->mControlsTimer->isActive() == false );
|
|
807 |
for ( int i = 0 ; i < mController->mControls.count() ; i++ )
|
|
808 |
{
|
38
|
809 |
QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
|
34
|
810 |
}
|
|
811 |
|
|
812 |
cleanup();
|
|
813 |
}
|
|
814 |
|
|
815 |
// -------------------------------------------------------------------------------------------------
|
|
816 |
// TestMPXVideoPlaybackControlsController::testUpdateVideoRectDone
|
|
817 |
// -------------------------------------------------------------------------------------------------
|
|
818 |
//
|
|
819 |
void TestMPXVideoPlaybackControlsController::testUpdateVideoRectDone()
|
|
820 |
{
|
|
821 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testUpdateVideoRectDone()") );
|
|
822 |
|
|
823 |
init();
|
|
824 |
|
|
825 |
mController->updateVideoRectDone();
|
|
826 |
|
|
827 |
//
|
|
828 |
// default is full-screen
|
|
829 |
//
|
|
830 |
QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdFullScreenViewOpened );
|
|
831 |
|
|
832 |
//
|
|
833 |
// validate Details view
|
|
834 |
//
|
|
835 |
mController->mViewMode = EDetailsView;
|
|
836 |
|
|
837 |
mController->updateVideoRectDone();
|
|
838 |
|
|
839 |
QVERIFY( mController->mControlsConfig->mState == EMPXControlCmdDetailsViewOpened );
|
|
840 |
|
|
841 |
cleanup();
|
|
842 |
}
|
|
843 |
|
|
844 |
// -------------------------------------------------------------------------------------------------
|
36
|
845 |
// TestMPXVideoPlaybackControlsController::testIsAttachOperation
|
|
846 |
// -------------------------------------------------------------------------------------------------
|
|
847 |
//
|
|
848 |
void TestMPXVideoPlaybackControlsController::testIsAttachOperation()
|
|
849 |
{
|
|
850 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testIsAttachOperation()") );
|
|
851 |
|
|
852 |
//
|
|
853 |
// get access to XQServiceUtilXtra stub
|
|
854 |
//
|
|
855 |
XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
|
|
856 |
|
|
857 |
//
|
|
858 |
// set service enable
|
|
859 |
//
|
|
860 |
extraUtil->setCurrentService( true );
|
|
861 |
|
|
862 |
//
|
|
863 |
// initialize controlscontroller
|
|
864 |
//
|
|
865 |
init();
|
|
866 |
|
|
867 |
//
|
|
868 |
// verify 'mIsAttachOperation' flag is enabled
|
|
869 |
//
|
|
870 |
QVERIFY( mController->mIsAttachOperation == true );
|
|
871 |
|
|
872 |
//
|
|
873 |
// clean up
|
|
874 |
//
|
|
875 |
cleanup();
|
|
876 |
|
|
877 |
//
|
|
878 |
// set service disable
|
|
879 |
//
|
|
880 |
extraUtil->setCurrentService( false );
|
|
881 |
|
|
882 |
//
|
|
883 |
// initialize controlscontroller
|
|
884 |
//
|
|
885 |
init();
|
|
886 |
|
|
887 |
//
|
|
888 |
// verify 'mIsAttachOperation' flag is disabled
|
|
889 |
//
|
|
890 |
QVERIFY( mController->mIsAttachOperation == false );
|
|
891 |
|
|
892 |
//
|
|
893 |
// clean up
|
|
894 |
//
|
|
895 |
cleanup();
|
|
896 |
|
|
897 |
//
|
|
898 |
// dereference extraUtil count
|
|
899 |
//
|
|
900 |
extraUtil->decreaseReferenceCount();
|
|
901 |
|
|
902 |
}
|
|
903 |
|
|
904 |
// -------------------------------------------------------------------------------------------------
|
34
|
905 |
// TestMPXVideoPlaybackControlsController::testslot_skipToNextVideoItem
|
|
906 |
// -------------------------------------------------------------------------------------------------
|
|
907 |
//
|
|
908 |
void TestMPXVideoPlaybackControlsController::testslot_skipToNextVideoItem()
|
|
909 |
{
|
|
910 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_skipToNextVideoItem()") );
|
|
911 |
|
|
912 |
init();
|
|
913 |
|
|
914 |
connect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToNextVideoItem() ) );
|
|
915 |
|
|
916 |
emit commandSignal();
|
|
917 |
|
|
918 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdNextListItem );
|
|
919 |
|
|
920 |
disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToNextVideoItem() ) );
|
|
921 |
|
|
922 |
cleanup();
|
|
923 |
}
|
|
924 |
|
|
925 |
// -------------------------------------------------------------------------------------------------
|
|
926 |
// TestMPXVideoPlaybackControlsController::testslot_skipToPreviousVideoItem
|
|
927 |
// -------------------------------------------------------------------------------------------------
|
|
928 |
//
|
|
929 |
void TestMPXVideoPlaybackControlsController::testslot_skipToPreviousVideoItem()
|
|
930 |
{
|
|
931 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_skipToPreviousVideoItem()") );
|
|
932 |
|
|
933 |
init();
|
|
934 |
|
|
935 |
connect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToPreviousVideoItem() ) );
|
|
936 |
|
|
937 |
emit commandSignal();
|
|
938 |
|
|
939 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPreviousListItem );
|
|
940 |
|
|
941 |
disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( skipToPreviousVideoItem() ) );
|
|
942 |
|
|
943 |
cleanup();
|
|
944 |
}
|
|
945 |
|
36
|
946 |
// -------------------------------------------------------------------------------------------------
|
|
947 |
// TestMPXVideoPlaybackControlsController::testslot_attachVideo
|
|
948 |
// -------------------------------------------------------------------------------------------------
|
|
949 |
//
|
|
950 |
void TestMPXVideoPlaybackControlsController::testslot_attachVideo()
|
|
951 |
{
|
|
952 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_attachVideo()") );
|
|
953 |
|
|
954 |
//
|
|
955 |
// get access to XQServiceUtilXtra stub to enable XQServiceUtil::isService() method
|
|
956 |
//
|
|
957 |
XQServiceUtilXtra* extraUtil = XQServiceUtilXtra::instance();
|
|
958 |
|
|
959 |
//
|
|
960 |
// set service enable
|
|
961 |
//
|
|
962 |
extraUtil->setCurrentService( true );
|
|
963 |
|
|
964 |
//
|
|
965 |
// initialize controlscontroller
|
|
966 |
//
|
|
967 |
init();
|
|
968 |
|
|
969 |
//
|
37
|
970 |
// verify view closePlaybackView() slot is not yet called
|
|
971 |
//
|
|
972 |
QVERIFY( mController->mView->mViewClosed == false );
|
|
973 |
|
|
974 |
//
|
36
|
975 |
// connect signal with controller attachVideo() slot
|
|
976 |
//
|
|
977 |
bool res = connect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
|
|
978 |
|
|
979 |
//
|
|
980 |
// emit signal, this will in turns invoke videoservices itemSelected() slot
|
|
981 |
//
|
|
982 |
emit commandSignal();
|
|
983 |
|
|
984 |
//
|
37
|
985 |
// verify view closePlaybackView() slot is called
|
36
|
986 |
//
|
37
|
987 |
QVERIFY( mController->mView->mViewClosed == true );
|
|
988 |
|
36
|
989 |
//
|
|
990 |
// verify videoservices itemSelected() slot is called
|
|
991 |
//
|
|
992 |
QVERIFY( mController->mVideoServices->mItemSelected == true );
|
|
993 |
|
|
994 |
//
|
|
995 |
// disconnect signal
|
|
996 |
//
|
|
997 |
disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( attachVideo() ) );
|
|
998 |
|
|
999 |
//
|
|
1000 |
// clean up
|
|
1001 |
//
|
|
1002 |
cleanup();
|
|
1003 |
|
|
1004 |
//
|
|
1005 |
// dereference extraUtil count
|
|
1006 |
//
|
|
1007 |
extraUtil->decreaseReferenceCount();
|
|
1008 |
|
|
1009 |
}
|
|
1010 |
|
37
|
1011 |
// -------------------------------------------------------------------------------------------------
|
|
1012 |
// TestMPXVideoPlaybackControlsController::testslot_sendVideo
|
|
1013 |
// -------------------------------------------------------------------------------------------------
|
|
1014 |
//
|
|
1015 |
void TestMPXVideoPlaybackControlsController::testslot_sendVideo()
|
|
1016 |
{
|
|
1017 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_sendVideo()") );
|
|
1018 |
|
|
1019 |
//
|
|
1020 |
// initialize controlscontroller
|
|
1021 |
//
|
|
1022 |
init();
|
|
1023 |
|
|
1024 |
//
|
|
1025 |
// connect signal with controller sendVideoo() slot
|
|
1026 |
//
|
|
1027 |
bool res = connect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
|
|
1028 |
|
|
1029 |
//
|
|
1030 |
// emit signal, this will in turns invoke mController sendVideo() slot
|
|
1031 |
//
|
|
1032 |
emit commandSignal();
|
|
1033 |
|
|
1034 |
//
|
|
1035 |
// verify command EMPXPbvCmdClose has been issued
|
|
1036 |
//
|
|
1037 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdPause );
|
|
1038 |
|
|
1039 |
//
|
|
1040 |
// disconnect signal
|
|
1041 |
//
|
|
1042 |
disconnect( this, SIGNAL( commandSignal() ), mController, SLOT( sendVideo() ) );
|
|
1043 |
|
|
1044 |
//
|
|
1045 |
// clean up
|
|
1046 |
//
|
|
1047 |
cleanup();
|
|
1048 |
}
|
|
1049 |
|
38
|
1050 |
// -------------------------------------------------------------------------------------------------
|
|
1051 |
// TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged
|
|
1052 |
// -------------------------------------------------------------------------------------------------
|
|
1053 |
//
|
|
1054 |
void TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged()
|
|
1055 |
{
|
|
1056 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleOrientationChanged()") );
|
|
1057 |
|
|
1058 |
//
|
|
1059 |
// initialize controlscontroller
|
|
1060 |
//
|
|
1061 |
init();
|
|
1062 |
|
|
1063 |
//
|
|
1064 |
// connect signal with controller handleOrientationChanged() slot
|
|
1065 |
//
|
|
1066 |
bool res = connect( this, SIGNAL( commandSignal( Qt::Orientation ) ),
|
|
1067 |
mController, SLOT( handleOrientationChanged( Qt::Orientation ) ) );
|
|
1068 |
|
|
1069 |
//
|
|
1070 |
// emit signal, this will in turns invoke mController handleOrientationChanged() slot
|
|
1071 |
//
|
|
1072 |
mController->mOrientation = Qt::Vertical;
|
39
|
1073 |
mController->mState = EPbStatePlaying;
|
38
|
1074 |
|
|
1075 |
emit commandSignal( Qt::Horizontal );
|
39
|
1076 |
|
38
|
1077 |
QVERIFY( mController->mOrientation == Qt::Horizontal );
|
|
1078 |
|
|
1079 |
for ( int i = 0 ; i < mController->mControls.count() ; i++ )
|
|
1080 |
{
|
|
1081 |
QVERIFY( mController->mControls[i]->mVisibilityState == mController->mState );
|
|
1082 |
}
|
|
1083 |
|
|
1084 |
//
|
|
1085 |
// disconnect signal
|
|
1086 |
//
|
|
1087 |
disconnect( this, SIGNAL( commandSignal( Qt::Orientation ) ),
|
|
1088 |
mController, SLOT( handleOrientationChanged( Qt::Orientation ) ) );
|
|
1089 |
|
|
1090 |
//
|
|
1091 |
// clean up
|
|
1092 |
//
|
|
1093 |
cleanup();
|
|
1094 |
}
|
36
|
1095 |
|
39
|
1096 |
// -------------------------------------------------------------------------------------------------
|
|
1097 |
// TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged
|
|
1098 |
// -------------------------------------------------------------------------------------------------
|
|
1099 |
//
|
|
1100 |
void TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged()
|
|
1101 |
{
|
|
1102 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleRNLogoVisibleChanged()") );
|
|
1103 |
|
|
1104 |
//
|
|
1105 |
// initialize controlscontroller
|
|
1106 |
//
|
|
1107 |
init();
|
|
1108 |
|
|
1109 |
//
|
|
1110 |
// connect signal with controller handleRNLogoVisibleChanged() slot
|
|
1111 |
//
|
|
1112 |
bool res = connect( this, SIGNAL( commandSignal() ),
|
|
1113 |
mController, SLOT( handleRNLogoVisibleChanged() ) );
|
|
1114 |
|
|
1115 |
//
|
|
1116 |
// emit signal, this will in turns invoke mController handleRNLogoVisibleChanged() slot
|
|
1117 |
//
|
|
1118 |
emit commandSignal();
|
|
1119 |
|
|
1120 |
QVERIFY( mController->mRNLogoTimer->isActive() );
|
|
1121 |
QVERIFY( mController->mRNLogoTimer->interval() == KMPXRNLogoTimeOut );
|
|
1122 |
|
|
1123 |
//
|
|
1124 |
// disconnect signal
|
|
1125 |
//
|
|
1126 |
disconnect( this, SIGNAL( commandSignal() ),
|
|
1127 |
mController, SLOT( handleRNLogoVisibleChanged() ) );
|
|
1128 |
|
|
1129 |
//
|
|
1130 |
// clean up
|
|
1131 |
//
|
|
1132 |
cleanup();
|
|
1133 |
}
|
|
1134 |
|
|
1135 |
// -------------------------------------------------------------------------------------------------
|
|
1136 |
// TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout
|
|
1137 |
// -------------------------------------------------------------------------------------------------
|
|
1138 |
//
|
|
1139 |
void TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout()
|
|
1140 |
{
|
|
1141 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testslot_handleRNLogoTimeout()") );
|
|
1142 |
|
|
1143 |
//
|
|
1144 |
// initialize controlscontroller
|
|
1145 |
//
|
|
1146 |
init();
|
|
1147 |
|
|
1148 |
if ( ! mController->mRNLogoTimer )
|
|
1149 |
{
|
|
1150 |
mController->mRNLogoTimer = new QTimer( mController );
|
|
1151 |
}
|
|
1152 |
|
|
1153 |
//
|
|
1154 |
// connect signal with controller handleRNLogoTimeout() slot
|
|
1155 |
//
|
|
1156 |
bool res = connect( this, SIGNAL( commandSignal() ),
|
|
1157 |
mController, SLOT( handleRNLogoTimeout() ) );
|
|
1158 |
|
|
1159 |
//
|
|
1160 |
// emit signal, this will in turns invoke mController handleRNLogoTimeout() slot
|
|
1161 |
//
|
|
1162 |
emit commandSignal();
|
|
1163 |
|
|
1164 |
QVERIFY( ! mController->mRNLogoTimer->isActive() );
|
|
1165 |
QVERIFY( mController->mControlsConfig->mState == KControlListsUpdated );
|
|
1166 |
QVERIFY( mViewWrapper->mCommandId == EMPXPbvCmdRealOneBitmapTimeout );
|
|
1167 |
|
|
1168 |
//
|
|
1169 |
// disconnect signal
|
|
1170 |
//
|
|
1171 |
disconnect( this, SIGNAL( commandSignal() ),
|
|
1172 |
mController, SLOT( handleRNLogoTimeout() ) );
|
|
1173 |
|
|
1174 |
//
|
|
1175 |
// clean up
|
|
1176 |
//
|
|
1177 |
cleanup();
|
|
1178 |
}
|
|
1179 |
|
|
1180 |
// -------------------------------------------------------------------------------------------------
|
|
1181 |
// TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible
|
|
1182 |
// -------------------------------------------------------------------------------------------------
|
|
1183 |
//
|
|
1184 |
void TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible()
|
|
1185 |
{
|
|
1186 |
MPX_DEBUG(_L("TestMPXVideoPlaybackControlsController::testIsRNLogoBitmapVisible()"));
|
|
1187 |
|
|
1188 |
init();
|
|
1189 |
|
|
1190 |
QVERIFY( mController->isRNLogoBitmapInControlList() );
|
|
1191 |
|
|
1192 |
//
|
|
1193 |
// Remove RN logo from the list
|
|
1194 |
//
|
|
1195 |
for ( int i = 0 ; i < mController->mControls.count() ; i++ )
|
|
1196 |
{
|
|
1197 |
if( mController->mControls[i]->mControlIndex == EMPXRealLogoBitmap )
|
|
1198 |
{
|
|
1199 |
mController->mControls.removeAt( i );
|
|
1200 |
}
|
|
1201 |
}
|
|
1202 |
|
|
1203 |
QVERIFY( ! mController->isRNLogoBitmapInControlList() );
|
|
1204 |
|
|
1205 |
cleanup();
|
|
1206 |
}
|
|
1207 |
|
34
|
1208 |
// End of file
|