videoplayback/hbvideoplaybackview/tsrc/testfullscreencontrol/src/testfullscreencontrol.cpp
changeset 36 8aed59de29f9
parent 35 3738fe97f027
equal deleted inserted replaced
35:3738fe97f027 36:8aed59de29f9
    13 *
    13 *
    14 * Description:   tester for methods in QMPXVideoPlaybackFullScreenControl
    14 * Description:   tester for methods in QMPXVideoPlaybackFullScreenControl
    15 * 
    15 * 
    16 */
    16 */
    17 
    17 
    18 // Version : %version:  2 %
    18 // Version : %version:  3 %
    19 
    19 
    20 
    20 
    21 #include <hbapplication.h>
    21 #include <hbapplication.h>
    22 #include <hbinstance.h>
    22 #include <hbinstance.h>
    23 #include <qdebug>
    23 #include <qdebug>
    76 //
    76 //
    77 void TestFullScreenControl::setup(TMPXVideoPlaybackControls control)
    77 void TestFullScreenControl::setup(TMPXVideoPlaybackControls control)
    78 {
    78 {
    79     MPX_ENTER_EXIT(_L("TestFullScreenControl::setup()"));
    79     MPX_ENTER_EXIT(_L("TestFullScreenControl::setup()"));
    80 
    80 
    81     mFileDetails = new QMPXVideoPlaybackViewFileDetails();  
    81 
    82     
    82     mControlsController = new QMPXVideoPlaybackControlsController();
    83     mControlsController = new QMPXVideoPlaybackControlsController( mFileDetails );
       
    84     
    83     
    85     createControl( control );                                                                                                                                           
    84     createControl( control );                                                                                                                                           
    86 }
    85 }
    87 
    86 
    88 // ---------------------------------------------------------------------------
    87 // ---------------------------------------------------------------------------
   128 //
   127 //
   129 void TestFullScreenControl::cleanup()
   128 void TestFullScreenControl::cleanup()
   130 {
   129 {
   131     MPX_ENTER_EXIT(_L("TestFullScreenControl::cleanup()"));
   130     MPX_ENTER_EXIT(_L("TestFullScreenControl::cleanup()"));
   132 
   131 
   133     if ( mFileDetails )
       
   134     {
       
   135         delete mFileDetails;
       
   136         mFileDetails = NULL;    
       
   137     }
       
   138     
       
   139     if ( mControlsController )
   132     if ( mControlsController )
   140     {
   133     {
   141         delete mControlsController;
   134         delete mControlsController;
   142         mControlsController = NULL;    
   135         mControlsController = NULL;    
   143     }
   136     }
   158     MPX_ENTER_EXIT(_L("TestFullScreenControl::testControlIndex()"));
   151     MPX_ENTER_EXIT(_L("TestFullScreenControl::testControlIndex()"));
   159 
   152 
   160     setup( EMPXStatusPane );
   153     setup( EMPXStatusPane );
   161     
   154     
   162     QVERIFY( mFullScreenControl->controlIndex() == EMPXStatusPane );
   155     QVERIFY( mFullScreenControl->controlIndex() == EMPXStatusPane );
   163 }
       
   164 
       
   165 // ---------------------------------------------------------------------------
       
   166 // main
       
   167 // ---------------------------------------------------------------------------
       
   168 //
       
   169 void TestFullScreenControl::testVolumeChanged()
       
   170 {  
       
   171     setup( EMPXStatusPane );
       
   172     
       
   173     QVERIFY( ! mFullScreenControl->volumeChanged( 50 ) );
       
   174         
       
   175 }
   156 }
   176 
   157 
   177 // ---------------------------------------------------------------------------
   158 // ---------------------------------------------------------------------------
   178 // testDurationChanged
   159 // testDurationChanged
   179 // ---------------------------------------------------------------------------
   160 // ---------------------------------------------------------------------------
   262 //
   243 //
   263 void TestFullScreenControl::testUpdateControlsWithFileDetails()
   244 void TestFullScreenControl::testUpdateControlsWithFileDetails()
   264 {
   245 {
   265     MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateControlsWithFileDetails()"));
   246     MPX_ENTER_EXIT(_L("TestFullScreenControl::testUpdateControlsWithFileDetails()"));
   266 
   247 
   267     delete mFullScreenControl;
   248     QMPXVideoPlaybackViewFileDetails *fileDetails = new QMPXVideoPlaybackViewFileDetails(); 
   268     mFullScreenControl = NULL;     
   249     
   269     setup( EMPXControlBar );
   250     setup( EMPXControlBar );
   270     
   251     
   271     mFileDetails->mPausableStream = true;
   252     fileDetails->mPausableStream = true;
   272     
   253     
   273     mFullScreenControl->updateControlsWithFileDetails(mFileDetails);
   254     mFullScreenControl->updateControlsWithFileDetails( fileDetails );
   274     
   255     
   275     QVERIFY( static_cast<QMPXVideoPlaybackControlBar*>(mFullScreenControl->mControl)->mFileDetails->mPausableStream );    
   256     QVERIFY( static_cast<QMPXVideoPlaybackControlBar*>(mFullScreenControl->mControl)->mFileDetails->mPausableStream );    
       
   257 
       
   258     if ( fileDetails )
       
   259     {
       
   260         delete fileDetails;
       
   261         fileDetails = NULL;    
       
   262     }
   276 }
   263 }
   277 
   264 
   278 // ---------------------------------------------------------------------------
   265 // ---------------------------------------------------------------------------
   279 // testUpdateControlProperties
   266 // testUpdateControlProperties
   280 // ---------------------------------------------------------------------------
   267 // ---------------------------------------------------------------------------