69 QVERIFY( !mRepository->mAllInOneView ); |
68 QVERIFY( !mRepository->mAllInOneView ); |
70 QVERIFY( !mRepository->mAcceptQuery ); |
69 QVERIFY( !mRepository->mAcceptQuery ); |
71 QVERIFY( !mRepository->mInvitingNote ); |
70 QVERIFY( !mRepository->mInvitingNote ); |
72 QVERIFY( !mRepository->mWaitingNote ); |
71 QVERIFY( !mRepository->mWaitingNote ); |
73 QVERIFY( !mRepository->mRecipientQuery ); |
72 QVERIFY( !mRepository->mRecipientQuery ); |
74 QVERIFY( !mRepository->mZoomSlider ); |
|
75 |
73 |
76 } |
74 } |
77 |
75 |
78 void UT_LcUiComponentRepository::testIdleView() |
76 void UT_LcUiComponentRepository::testIdleView() |
79 { |
77 { |
80 // View not yet loaded |
78 // View not yet loaded |
81 // Portrait layout |
79 UT_SET_ORIENTATION( Qt::Horizontal ); |
82 UT_SET_ORIENTATION( Qt::Vertical ); |
80 QVERIFY( !mRepository->mIdleView ); |
83 QVERIFY( !mRepository->mIdleView ); |
|
84 LcView* view = mRepository->idleView(); |
81 LcView* view = mRepository->idleView(); |
85 QVERIFY( mRepository->mIdleView ); |
82 QVERIFY( mRepository->mIdleView ); |
86 QCOMPARE( view->objectName(), QString( lcViewIdleId ) ); |
83 QCOMPARE( view->objectName(), QString( lcViewIdleId ) ); |
87 |
84 |
88 // View loaded |
85 // View loaded |
147 } |
144 } |
148 |
145 |
149 void UT_LcUiComponentRepository::testAllInOneView() |
146 void UT_LcUiComponentRepository::testAllInOneView() |
150 { |
147 { |
151 // View not yet loaded |
148 // View not yet loaded |
152 UT_SET_ORIENTATION( Qt::Vertical ); |
149 UT_SET_ORIENTATION( Qt::Horizontal ); |
153 QVERIFY( !mRepository->mAllInOneView ); |
150 QVERIFY( !mRepository->mAllInOneView ); |
154 LcView* view = mRepository->allInOneView(); |
151 LcView* view = mRepository->allInOneView(); |
155 QVERIFY( mRepository->mAllInOneView ); |
152 QVERIFY( mRepository->mAllInOneView ); |
156 QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); |
153 QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); |
157 QCOMPARE( mRepository->mLayoutSection, QString( lcLayoutPortraitDefaultId ) ); |
154 QCOMPARE( mRepository->mLayoutSection, QString( lcLayoutLandscapeDefaultId ) ); |
158 // View loaded |
155 // View loaded |
159 LcView* view2 = mRepository->allInOneView(); |
156 LcView* view2 = mRepository->allInOneView(); |
160 QVERIFY( view == view2 ); |
157 QVERIFY( view == view2 ); |
161 |
|
162 // Try fresh loading in landscape orientation |
|
163 UT_SET_ORIENTATION( Qt::Horizontal ); |
|
164 mRepository->mAllInOneView = 0; |
|
165 view = mRepository->allInOneView(); |
|
166 QVERIFY( mRepository->mAllInOneView ); |
|
167 QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); |
|
168 QCOMPARE( mRepository->mLayoutSection, QString( lcLayoutLandscapeDefaultId ) ); |
|
169 } |
158 } |
170 |
159 |
171 void UT_LcUiComponentRepository::testAcceptQuery() |
160 void UT_LcUiComponentRepository::testAcceptQuery() |
172 { |
161 { |
173 // Query created and returned |
162 // Query created and returned |
240 HbDialog* query2 = mRepository->shareOwnVideoQuery(); |
229 HbDialog* query2 = mRepository->shareOwnVideoQuery(); |
241 QVERIFY( query2 ); |
230 QVERIFY( query2 ); |
242 QVERIFY( query2 == query ); |
231 QVERIFY( query2 == query ); |
243 } |
232 } |
244 |
233 |
245 void UT_LcUiComponentRepository::testZoomSlider() |
|
246 { |
|
247 int sliderTimeout = 3000; // 3 Seconds Timeout |
|
248 // slider created and returned |
|
249 QVERIFY( !mRepository->mZoomSlider ); |
|
250 HbDialog* slider = mRepository->zoomSlider(); |
|
251 QVERIFY( mRepository->mZoomSlider ); |
|
252 //QCOMPARE( slider, mRepository->mZoomSlider ); |
|
253 QVERIFY( slider == mRepository->mZoomSlider ); |
|
254 QVERIFY( !slider->isVisible() ); |
|
255 QCOMPARE( sliderTimeout, slider->timeout() ); |
|
256 |
|
257 // Existing slider returned |
|
258 HbDialog* slider2 = mRepository->zoomSlider(); |
|
259 QVERIFY( slider2 == slider ); |
|
260 |
|
261 } |
|
262 |
|
263 void UT_LcUiComponentRepository::testSharedVideoContextMenu() |
234 void UT_LcUiComponentRepository::testSharedVideoContextMenu() |
264 { |
235 { |
265 HbMenu* menu = new HbMenu(); |
236 HbMenu* menu = new HbMenu(); |
266 QVERIFY( menu->isEmpty() ); |
237 QVERIFY( menu->isEmpty() ); |
267 |
238 |
268 QVERIFY( !mRepository->mAllInOneView ); |
239 QVERIFY( !mRepository->mAllInOneView ); |
269 LcView* view = mRepository->allInOneView(); |
240 LcView* view = mRepository->allInOneView(); |
270 QVERIFY( mRepository->mAllInOneView ); |
241 QVERIFY( mRepository->mAllInOneView ); |
271 QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); |
242 QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); |
272 |
243 |
273 HbAction zoom( lcActZoomId ); |
|
274 HbAction changeCamera( lcActChangeCameraId ); |
244 HbAction changeCamera( lcActChangeCameraId ); |
275 HbAction disableCam( lcActMenuDisableCameraId ); |
245 HbAction disableCam( lcActMenuDisableCameraId ); |
|
246 HbAction enableCam( lcActEnableCameraId ); |
276 HbAction changeCam( lcActMenuChangeCameraId ); |
247 HbAction changeCam( lcActMenuChangeCameraId ); |
277 |
248 |
278 mRepository->mActions.append( &zoom ); |
|
279 mRepository->mActions.append( &changeCamera ); |
249 mRepository->mActions.append( &changeCamera ); |
280 mRepository->mActions.append( &disableCam ); |
250 mRepository->mActions.append( &disableCam ); |
|
251 mRepository->mActions.append( &enableCam ); |
281 mRepository->mActions.append( &changeCam ); |
252 mRepository->mActions.append( &changeCam ); |
282 |
253 |
283 mRepository->sharedVideoContextMenuActions( menu, *view ); |
254 mRepository->sharedVideoContextMenuActions( menu, *view ); |
284 //TBD stub implementation of void QGraphicsWidget::addAction(QAction *action); |
255 //TODO: stub implementation of void QGraphicsWidget::addAction(QAction *action); |
285 //QVERIFY( !menu->isEmpty() ); |
256 //QVERIFY( !menu->isEmpty() ); |
286 } |
257 } |
287 |
258 |
288 |
259 |
289 void UT_LcUiComponentRepository::testLoadView_FileNotFound() |
260 void UT_LcUiComponentRepository::testLoadView_FileNotFound() |
314 { |
285 { |
315 bool ok( false ); |
286 bool ok( false ); |
316 |
287 |
317 // View not yet loaded |
288 // View not yet loaded |
318 QVERIFY( mRepository->mLastLoadedView.length() == 0 ); |
289 QVERIFY( mRepository->mLastLoadedView.length() == 0 ); |
319 ok = mRepository->loadLayout( lcLayoutPortraitDefaultId ); |
290 ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); |
320 QVERIFY( !ok ); |
291 QVERIFY( !ok ); |
321 |
292 |
322 // View is loaded |
293 // View is loaded |
323 mRepository->mLastLoadedView = lcIdleViewFile; |
294 mRepository->mLastLoadedView = lcIdleViewFile; |
324 ok = mRepository->loadLayout( lcLayoutPortraitDefaultId ); |
295 ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); |
325 QVERIFY( ok ); |
296 QVERIFY( ok ); |
326 |
297 |
327 // Changing layout |
298 // Changing layout |
328 ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); |
299 ok = mRepository->loadLayout( lcLayoutLandscapeSwappedId ); |
|
300 QVERIFY( ok ); |
|
301 ok = mRepository->loadLayout( lcLayoutFullscreenId ); |
329 QVERIFY( ok ); |
302 QVERIFY( ok ); |
330 |
303 |
331 // Loading non-existing section |
304 // Loading non-existing section |
332 ok = mRepository->loadLayout( QString("dummy_layout") ); |
305 ok = mRepository->loadLayout( QString("dummy_layout") ); |
333 QVERIFY( !ok ); |
306 QVERIFY( !ok ); |