34
|
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: TestVideoFileDetails class definition
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef TESTVIDEOFILEDETAILS_H
|
|
19 |
#define TESTVIDEOFILEDETAILS_H
|
|
20 |
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <qobject>
|
|
24 |
#include <qabstractitemmodel.h>
|
|
25 |
#include <mpxitemid.h>
|
|
26 |
|
|
27 |
class VideoFileDetailsViewPlugin;
|
|
28 |
class VideoSortFilterProxyModel;
|
|
29 |
class VideoCollectionWrapper;
|
|
30 |
|
|
31 |
class TestVideoFileDetails : public QObject
|
|
32 |
{
|
|
33 |
|
|
34 |
Q_OBJECT
|
|
35 |
|
|
36 |
public:
|
|
37 |
|
|
38 |
/**
|
|
39 |
* Used in testfunctions to init
|
|
40 |
*/
|
|
41 |
void init();
|
|
42 |
|
|
43 |
/**
|
|
44 |
* used in testfunctions to cleanup
|
|
45 |
*/
|
|
46 |
void cleanup();
|
|
47 |
|
|
48 |
/**
|
|
49 |
* common view activation call
|
|
50 |
*/
|
|
51 |
void activateView();
|
|
52 |
|
|
53 |
/**
|
|
54 |
* creates some metadata to be "shown" in tests
|
|
55 |
*/
|
|
56 |
QMap<QString, QVariant> createDummyMetadata();
|
|
57 |
|
|
58 |
/**
|
|
59 |
* runned when checking view activation related things
|
|
60 |
*/
|
|
61 |
void activateViewTestRound();
|
|
62 |
|
|
63 |
signals: // test signals to emit
|
|
64 |
|
|
65 |
/**
|
|
66 |
* short details test signal
|
|
67 |
*/
|
|
68 |
void shortDetailsReady(TMPXItemId index);
|
|
69 |
|
|
70 |
/**
|
|
71 |
* full details test signal
|
|
72 |
*/
|
36
|
73 |
void fullDetailsReady(QVariant& variant);
|
34
|
74 |
|
|
75 |
/**
|
|
76 |
* data changed test signal
|
|
77 |
*/
|
|
78 |
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Row removal test signal
|
|
82 |
*/
|
|
83 |
void rowsRemoved(const QModelIndex &parent, int first, int last);
|
|
84 |
|
|
85 |
/**
|
|
86 |
* generic test signal
|
|
87 |
*/
|
|
88 |
void testSignal();
|
|
89 |
|
|
90 |
/**
|
|
91 |
* for testing error signal slots
|
|
92 |
*/
|
|
93 |
void testErrorSignal(int, QVariant&);
|
|
94 |
|
|
95 |
public slots:
|
|
96 |
|
|
97 |
void handleCommand(int);
|
|
98 |
|
|
99 |
private slots:
|
|
100 |
|
|
101 |
/**
|
|
102 |
* called at the very beginning of the test
|
|
103 |
*/
|
|
104 |
void initTestCase();
|
|
105 |
|
|
106 |
/**
|
|
107 |
* called at the very end of the test
|
|
108 |
*/
|
|
109 |
void cleanupTestCase();
|
|
110 |
|
|
111 |
/**
|
|
112 |
* verifies createView -method
|
|
113 |
*/
|
|
114 |
void testCreateView();
|
|
115 |
|
|
116 |
/**
|
|
117 |
* verifies destroyView -method
|
|
118 |
*/
|
|
119 |
void testDestroyView();
|
|
120 |
|
|
121 |
/**
|
|
122 |
* verifies activate in portrait mode
|
|
123 |
*/
|
|
124 |
void testActivateViewPortrait();
|
|
125 |
|
|
126 |
/**
|
|
127 |
* verifies activate in landscape
|
|
128 |
*/
|
|
129 |
void testActivateViewLandscape();
|
|
130 |
|
|
131 |
/**
|
|
132 |
* verifies deactivateView
|
|
133 |
*/
|
|
134 |
void testDeactivateView();
|
|
135 |
|
|
136 |
/**
|
|
137 |
* verifies orientation changed datas
|
|
138 |
*/
|
|
139 |
void testOrientationChange_data();
|
|
140 |
|
|
141 |
/**
|
|
142 |
* veries orienation changed method
|
|
143 |
*/
|
|
144 |
void testOrientationChange();
|
|
145 |
|
|
146 |
/**
|
|
147 |
* verifies back -method
|
|
148 |
*/
|
|
149 |
void testBack();
|
|
150 |
|
|
151 |
/**
|
|
152 |
* verifies shortdetails ready
|
|
153 |
*/
|
|
154 |
void testShortDetailsReadySlot();
|
|
155 |
|
|
156 |
/**
|
|
157 |
* verifies fulldetailsready
|
|
158 |
*/
|
|
159 |
void testFullDetailsReadySlot();
|
|
160 |
|
|
161 |
/**
|
|
162 |
* verifies startPlayback
|
|
163 |
*/
|
|
164 |
void testStartPlaybackSlot();
|
|
165 |
|
|
166 |
/**
|
|
167 |
* verifies sendvideo -method
|
|
168 |
*/
|
|
169 |
void testSendVideoSlot();
|
|
170 |
|
|
171 |
/**
|
|
172 |
* verifies delete video
|
|
173 |
*/
|
|
174 |
void testDeleteVideoSlot();
|
|
175 |
|
|
176 |
/**
|
|
177 |
* verifies rowsRemoved
|
|
178 |
*/
|
|
179 |
void testRowsRemovedSlot();
|
|
180 |
|
|
181 |
/**
|
|
182 |
* verifies error handling
|
|
183 |
*/
|
|
184 |
void testHandleErrorSlot();
|
|
185 |
|
|
186 |
/**
|
|
187 |
* verifies thumbnail ready.
|
|
188 |
*/
|
|
189 |
void testThumbnailReadySlot();
|
|
190 |
|
|
191 |
private:
|
|
192 |
|
|
193 |
/**
|
|
194 |
* widget finder used when reading objetc from XML
|
|
195 |
*/
|
|
196 |
template <class T>
|
|
197 |
T* findWidget(QString name);
|
|
198 |
|
|
199 |
/**
|
|
200 |
* Qobject finder used when reading objetc from XML
|
|
201 |
*/
|
|
202 |
template<class T>
|
|
203 |
T* findObject(QString name);
|
|
204 |
|
|
205 |
private:
|
|
206 |
|
|
207 |
/**
|
|
208 |
* stub model
|
|
209 |
*/
|
|
210 |
VideoSortFilterProxyModel* mDummyModel;
|
|
211 |
|
|
212 |
/**
|
|
213 |
* Testable object
|
|
214 |
*/
|
|
215 |
VideoFileDetailsViewPlugin* mPlugin;
|
|
216 |
|
|
217 |
/**
|
|
218 |
* indicate client has emitted signle received
|
|
219 |
* in handleCommand
|
|
220 |
*/
|
|
221 |
bool mCommandReceived;
|
|
222 |
|
|
223 |
/**
|
|
224 |
* id of command recently received
|
|
225 |
*/
|
|
226 |
int mReceivedCommand;
|
|
227 |
|
|
228 |
public:
|
|
229 |
|
|
230 |
VideoCollectionWrapper *mWrapper;
|
|
231 |
|
|
232 |
};
|
|
233 |
|
|
234 |
#endif // TESTVIDEOFILEDETAILS_H
|
|
235 |
|
|
236 |
// End of File
|