videoplayback/hbvideoplaybackview/tsrc/testvideoplaybackview/src/testvideoplaybackview.cpp
changeset 24 7d93ee07fb27
parent 15 cf5481c2bc0b
child 46 adbe7d5ba2f5
equal deleted inserted replaced
20:b9e04db066d4 24:7d93ee07fb27
    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: 9 %
    19 
    19 
    20 #include <e32err.h>
    20 #include <e32err.h>
    21 #include <w32std.h>
    21 #include <w32std.h>
    22 
    22 
    23 #include <mmf/common/mmferrors.h>
    23 #include <mmf/common/mmferrors.h>
   132     verifyHandlePluginError( KErrAbort );
   132     verifyHandlePluginError( KErrAbort );
   133     verifyHandlePluginError( KErrCancel ); 
   133     verifyHandlePluginError( KErrCancel ); 
   134     verifyHandlePluginError( KErrMMDRMNotAuthorized );
   134     verifyHandlePluginError( KErrMMDRMNotAuthorized );
   135     verifyHandlePluginError( KErrCANoRights );
   135     verifyHandlePluginError( KErrCANoRights );
   136     verifyHandlePluginError( KErrCANoPermission );
   136     verifyHandlePluginError( KErrCANoPermission );
   137     verifyHandlePluginError( KMPXVideoTvOutPlaybackNotAllowedClose );
       
   138     
   137     
   139     //
   138     //
   140     // playback view remains open after displaying these error notes
   139     // playback view remains open after displaying these error notes
   141     //
   140     //
   142     verifyHandlePluginError( KMPXVideoCallOngoingError, false );
   141     verifyHandlePluginError( KMPXVideoCallOngoingError, false );
   143     verifyHandlePluginError( KMPXVideoTvOutPlaybackNotAllowed, false );
       
   144     verifyHandlePluginError( KMPXVideoPlayOver2GDuringVoiceCallError, false );
   142     verifyHandlePluginError( KMPXVideoPlayOver2GDuringVoiceCallError, false );
   145             
   143             
   146     //
   144     //
   147     // default error case, playback view is closed after displaying error note
   145     // default error case, playback view is closed after displaying error note
   148     //
   146     //
   209     QVERIFY( mVideoView->isEnabled() );
   207     QVERIFY( mVideoView->isEnabled() );
   210     
   208     
   211     cleanup();
   209     cleanup();
   212 }
   210 }
   213 
   211 
   214 void TestVideoPlaybackView::testEvent()
   212 void TestVideoPlaybackView::testEventFilter()
   215 {
   213 {
   216     setup();
   214     setup();
   217     
   215     
   218     //
   216     //
   219     // ensure default foreground is false
   217     // ensure default foreground is false
   221     QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
   219     QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
   222 
   220 
   223     //
   221     //
   224     // declare foreground/background event
   222     // declare foreground/background event
   225     //
   223     //
   226     QEvent* windowActivate   = new QEvent( QEvent::WindowActivate );
   224     QEvent* appActivate   = new QEvent( QEvent::ApplicationActivate );
   227     QEvent* windowDeactivate = new QEvent( QEvent::WindowDeactivate );
   225     QEvent* appDeactivate = new QEvent( QEvent::ApplicationDeactivate );
   228     
   226     
   229     //
   227     //
   230     // verify the returned value (consumed) of HbVideoBasePlaybackView::event() 
   228     // verify the returned value (consumed) of HbVideoBasePlaybackView::event() 
   231     // for QEvent::WindowActivate is false
   229     // for QEvent::ApplicationActivate is false
   232     //
   230     //
   233     QVERIFY( ! mVideoView->event( windowActivate ) );  
   231     QVERIFY( ! mVideoView->eventFilter( NULL, appActivate ) );  
   234     
   232     
   235     //
   233     //
   236     // verify view is in foreground
   234     // verify view is in foreground
   237     //
   235     //
   238     QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 1 );
   236     QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 1 );
   239 
   237 
   240     //
   238     //
   241     // verify the returned value (consumed) of HbVideoBasePlaybackView::event() 
   239     // verify the returned value (consumed) of HbVideoBasePlaybackView::event() 
   242     // for QEvent::WindowDeactivate is false
   240     // for QEvent::ApplicationDeactivate is false
   243     //
   241     //
   244     QVERIFY( ! mVideoView->event( windowDeactivate ) );   
   242     QVERIFY( ! mVideoView->eventFilter( NULL, appDeactivate ) );   
   245     
   243     
   246     //
   244     //
   247     // verify view is in background
   245     // verify view is in background
   248     //
   246     //
   249     QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
   247     QCOMPARE( mVideoView->mVideoMpxWrapper->iForeground, 0 );
   250     
   248     
   251     //
   249     //
   252     // clean up
   250     // clean up
   253     //
   251     //
   254     delete windowActivate;
   252     if ( appActivate )
   255     windowActivate = NULL;
   253     {
   256     delete windowDeactivate;
   254         delete appActivate;
   257     windowDeactivate = NULL;
   255         appActivate = NULL;
       
   256     }
       
   257 
       
   258     if ( appDeactivate )
       
   259     {
       
   260         delete appDeactivate;
       
   261         appDeactivate = NULL;
       
   262     }
       
   263 
   258     cleanup();
   264     cleanup();
   259 }
   265 }
   260 
   266 
   261 void TestVideoPlaybackView::testClosePlaybackView()
   267 void TestVideoPlaybackView::testClosePlaybackView()
   262 {
   268 {