61 #include "videolistselectiondialogdata.h" |
61 #include "videolistselectiondialogdata.h" |
62 #include "videosortfilterproxymodeldata.h" |
62 #include "videosortfilterproxymodeldata.h" |
63 #include "videocollectionuiloaderdata.h" |
63 #include "videocollectionuiloaderdata.h" |
64 #include "videolistdatamodeldata.h" |
64 #include "videolistdatamodeldata.h" |
65 #include "xqserviceutilxtra.h" |
65 #include "xqserviceutilxtra.h" |
|
66 #include "videooperatorservicedata.h" |
66 |
67 |
67 // --------------------------------------------------------------------------- |
68 // --------------------------------------------------------------------------- |
68 // main |
69 // main |
69 // --------------------------------------------------------------------------- |
70 // --------------------------------------------------------------------------- |
70 // |
71 // |
95 |
96 |
96 // --------------------------------------------------------------------------- |
97 // --------------------------------------------------------------------------- |
97 // init |
98 // init |
98 // --------------------------------------------------------------------------- |
99 // --------------------------------------------------------------------------- |
99 // |
100 // |
100 void TestListView::init(bool initTestView ) |
101 void TestListView::init(bool initTestView) |
101 { |
102 { |
102 XQServiceUtilXtra::service = false; |
103 XQServiceUtilXtra::service = false; |
103 mUiLoader = new VideoCollectionUiLoader(); |
104 mUiLoader = new VideoCollectionUiLoader(); |
104 mUiLoader->reset(); |
105 mUiLoader->reset(); |
105 |
106 |
291 // --------------------------------------------------------------------------- |
294 // --------------------------------------------------------------------------- |
292 // |
295 // |
293 void TestListView::testMenus() |
296 void TestListView::testMenus() |
294 { |
297 { |
295 init(); |
298 init(); |
|
299 |
296 TMPXItemId tmpId = TMPXItemId::InvalidId(); |
300 TMPXItemId tmpId = TMPXItemId::InvalidId(); |
297 mTestView->activateView(tmpId); |
301 mTestView->activateView(tmpId); |
298 |
302 |
299 HbAction* action = 0; |
303 HbAction* action = 0; |
300 QList<QAction*> tbActions = mTestView->toolBar()->actions(); |
304 QList<QAction*> tbActions = mTestView->toolBar()->actions(); |
301 QList<QAction*> tbGroupActions; |
305 QList<QAction*> tbGroupActions; |
302 QList<QAction*> tbGroupActions2; |
306 QList<QAction*> tbGroupActions2; |
303 |
307 |
304 // All videos is open for default, verify. |
308 // All videos is open for default, verify. |
305 QVERIFY( mTestView->mToolbarViewsActionGroup != 0 ); |
309 QVERIFY( mTestView->mToolbarViewsActionGroup != 0 ); |
306 QVERIFY( mTestView->mToolbarCollectionActionGroup != 0 ); |
310 QVERIFY( mTestView->mToolbarCollectionActionGroup != 0 ); |
307 tbGroupActions = mTestView->mToolbarViewsActionGroup->actions(); |
311 tbGroupActions = mTestView->mToolbarViewsActionGroup->actions(); |
308 tbGroupActions2 = mTestView->mToolbarCollectionActionGroup->actions(); |
312 tbGroupActions2 = mTestView->mToolbarCollectionActionGroup->actions(); |
309 QCOMPARE( mTestView->mToolbarActions.count(), 5 ); |
313 QCOMPARE( mTestView->mToolbarActions.count(), 5 ); |
310 QCOMPARE( tbActions.count(), 3 ); |
314 QCOMPARE( tbActions.count(), 3 ); |
311 QCOMPARE( tbGroupActions.count(), 3 ); |
315 QCOMPARE( tbGroupActions.count(), 3 ); |
312 QCOMPARE( tbGroupActions2.count(), 2 ); |
316 QCOMPARE( tbGroupActions2.count(), 2 ); |
313 QVERIFY( tbGroupActions.at(0)->isChecked() ); // First is checked. |
317 QVERIFY( tbGroupActions.at(0)->isChecked() ); // First is checked. |
|
318 QCOMPARE( VideoOperatorServiceData::mLoadCallCount, 6); |
314 |
319 |
315 // Verify checkable and visible toolbar actions. |
320 // Verify checkable and visible toolbar actions. |
316 HbAction* allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos]; |
321 HbAction* allVideosAction = mTestView->mToolbarActions[VideoListView::ETBActionAllVideos]; |
317 HbAction* collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections]; |
322 HbAction* collectionsAction = mTestView->mToolbarActions[VideoListView::ETBActionCollections]; |
318 HbAction* servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices]; |
323 HbAction* servicesAction = mTestView->mToolbarActions[VideoListView::ETBActionServices]; |
786 QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 ); |
791 QCOMPARE( VideoListWidgetData::mDeactivateCount, 1 ); |
787 |
792 |
788 cleanup(); |
793 cleanup(); |
789 } |
794 } |
790 // --------------------------------------------------------------------------- |
795 // --------------------------------------------------------------------------- |
791 // Slot: test open services view slot |
796 // Slot: test open operator service slot |
792 // --------------------------------------------------------------------------- |
797 // --------------------------------------------------------------------------- |
793 // |
798 // |
794 void TestListView::testOpenServicesViewSlot() |
799 void TestListView::testOpenOperatorServiceSlot() |
795 { |
800 { |
796 QFAIL("Feature not yet implemented!"); |
801 init(); |
|
802 |
|
803 TMPXItemId tmpId = TMPXItemId::InvalidId(); |
|
804 mTestView->activateView(tmpId); |
|
805 |
|
806 VideoOperatorServiceData::mLaunchServiceCallCount = 0; |
|
807 connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openOperatorServiceSlot())); |
|
808 emit testSignal2(); |
|
809 QCOMPARE(VideoOperatorServiceData::mLaunchServiceCallCount, 1); |
|
810 cleanup(); |
|
811 |
|
812 init(); |
|
813 VideoOperatorServiceData::mLaunchServiceCallCount = 0; |
|
814 connect(this, SIGNAL(testSignal2()), mTestView, SLOT(openOperatorServiceSlot())); |
|
815 emit testSignal2(); |
|
816 QCOMPARE(VideoOperatorServiceData::mLaunchServiceCallCount, 0); |
|
817 cleanup(); |
797 } |
818 } |
798 |
819 |
799 // --------------------------------------------------------------------------- |
820 // --------------------------------------------------------------------------- |
800 // testStartSorting |
821 // testStartSorting |
801 // --------------------------------------------------------------------------- |
822 // --------------------------------------------------------------------------- |