|
1 /** |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: tester for methods in VideoListSelectionDialog |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __TESTVIDEOLISTSELECTIONDIALOG_H__ |
|
19 #define __TESTVIDEOLISTSELECTIONDIALOG_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <QtTest/QtTest> |
|
23 |
|
24 class VideoListSelectionDialog; |
|
25 class VideoCollectionUiLoader; |
|
26 class VideoListDataModel; |
|
27 class VideoSortFilterProxyModel; |
|
28 class VideoListWidget; |
|
29 class VideoListSelectionDialogTesterHelper; |
|
30 |
|
31 class TestVideoListSelectionDialog : public QObject |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 private: |
|
36 |
|
37 void setRowCount(int count, int type = 0, VideoListDataModel *model = 0); |
|
38 |
|
39 // test functions for the test framework |
|
40 |
|
41 private slots: |
|
42 |
|
43 /** |
|
44 * called before anything else when test starts |
|
45 */ |
|
46 void initTestCase(); |
|
47 |
|
48 /** |
|
49 * will be called after testing ends |
|
50 * |
|
51 */ |
|
52 void cleanupTestCase(); |
|
53 |
|
54 /** |
|
55 * will be called before each testfunction is executed. |
|
56 * |
|
57 */ |
|
58 void init(); |
|
59 |
|
60 /** |
|
61 * will be called after every testfunction. |
|
62 * |
|
63 */ |
|
64 void cleanup(); |
|
65 |
|
66 /** |
|
67 * Tests constructor and destructor. |
|
68 */ |
|
69 void testConstructDestruct(); |
|
70 |
|
71 /** |
|
72 * tests VideoListSelectionDialog::setupContent |
|
73 */ |
|
74 void testSetupContent(); |
|
75 |
|
76 /** |
|
77 * verifies failure cases in initDialog |
|
78 */ |
|
79 void testSetupInitFailures(); |
|
80 |
|
81 /** |
|
82 * tests VideoListSelectionDialog::exec |
|
83 */ |
|
84 void testExec(); |
|
85 |
|
86 /** |
|
87 * tests finishedSlot |
|
88 */ |
|
89 void testFinishedSlot(); |
|
90 |
|
91 /** |
|
92 * tests VideoListSelectionDialog::markAllStateChangedSlot |
|
93 */ |
|
94 void testMarkAllStateChangedSlot(); |
|
95 |
|
96 /** |
|
97 * tests VideoListSelectionDialog::selectionChangedSlot |
|
98 */ |
|
99 void testSelectionChangedSlot(); |
|
100 |
|
101 /** |
|
102 * tests VideoListSelectionDialog::singleItemSelectedSlot |
|
103 */ |
|
104 void testSingleItemSelectedSlot(); |
|
105 |
|
106 /** |
|
107 * tests VideoListSelectionDialog::initDialog |
|
108 */ |
|
109 void testModelReadySlot(); |
|
110 |
|
111 /** |
|
112 * tests VideoListSelectionDialog::updateCounterSlot |
|
113 */ |
|
114 void testUpdateCounterSlot(); |
|
115 |
|
116 /** |
|
117 * tests VideoListSelectionDialog::primaryActionTriggeredSlot |
|
118 */ |
|
119 void testPrimaryActionTriggeredSlot(); |
|
120 |
|
121 /** |
|
122 * tests VideoListSelectionDialog::getSelectedName |
|
123 */ |
|
124 void testGetSelectedName(); |
|
125 |
|
126 private: |
|
127 |
|
128 /** |
|
129 * test helper |
|
130 */ |
|
131 VideoListSelectionDialogTesterHelper *mTestHelper; |
|
132 |
|
133 /** |
|
134 * object under test |
|
135 */ |
|
136 VideoListSelectionDialog *mTestObject; |
|
137 |
|
138 /** |
|
139 * dummy UI loader object |
|
140 */ |
|
141 VideoCollectionUiLoader *mTestUiLoader; |
|
142 |
|
143 /** |
|
144 * dummy source model |
|
145 */ |
|
146 VideoListDataModel *mSourceModel; |
|
147 |
|
148 /** |
|
149 * dummy model |
|
150 */ |
|
151 VideoSortFilterProxyModel *mModel; |
|
152 |
|
153 /** |
|
154 * dummy widget |
|
155 */ |
|
156 VideoListWidget *mTestWidget; |
|
157 |
|
158 /** |
|
159 * flag indicating if last call to init succeeded. |
|
160 */ |
|
161 bool mInitOk; |
|
162 }; |
|
163 |
|
164 |
|
165 #endif // __TESTVIDEOCOLLECTIONVIEWUTILS_H__ |
|
166 |
|
167 // End of file |
|
168 |
|
169 |
|
170 |