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 // |
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 { |