30
|
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 VideoListWidget
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
44
|
18 |
// Version : %version: 58 %
|
36
|
19 |
|
34
|
20 |
#include <qmap.h>
|
|
21 |
#include <vcxmyvideosdefs.h>
|
|
22 |
#include <mpxhbvideocommondefs.h>
|
|
23 |
|
|
24 |
#include "hbglobal.h"
|
30
|
25 |
#include "hblistview.h"
|
|
26 |
#include "hbview.h"
|
|
27 |
#include "videosortfilterproxymodel.h"
|
|
28 |
#include "hbscrollbar.h"
|
|
29 |
#include "hbmenu.h"
|
|
30 |
#include "hbmessagebox.h"
|
|
31 |
#include "hbinstance.h"
|
|
32 |
#include "hbmainwindow.h"
|
35
|
33 |
#include "hbstyleloader.h"
|
36
|
34 |
#include "hbinputdialog.h"
|
30
|
35 |
#include "videothumbnaildata.h"
|
|
36 |
#include "videocollectioncommon.h"
|
34
|
37 |
#include "videocollectionwrapper.h"
|
|
38 |
#include "videocollectionwrapperdata.h"
|
|
39 |
#include "hbmenudata.h"
|
|
40 |
#include "videothumbnailtestdata.h"
|
|
41 |
#include "videolistdatamodel.h"
|
|
42 |
#include "videolistdatamodeldata.h"
|
|
43 |
#include "videosortfilterproxymodeldata.h"
|
35
|
44 |
#include "videocollectionuiloader.h"
|
|
45 |
#include "videocollectionuiloaderdata.h"
|
|
46 |
#include "videolistselectiondialog.h"
|
|
47 |
#include "videolistselectiondialogdata.h"
|
34
|
48 |
#include "hbmessageboxdata.h"
|
30
|
49 |
|
|
50 |
#include "testlistwidget.h"
|
|
51 |
|
|
52 |
#define private public
|
|
53 |
#include "videolistwidget.h"
|
36
|
54 |
#include "videoservices.h"
|
30
|
55 |
#undef private
|
|
56 |
|
|
57 |
static const int CONTEXT_MENU_COUNT = 8;
|
|
58 |
|
|
59 |
/**
|
|
60 |
* helper class to run protected member of the test object
|
|
61 |
*/
|
|
62 |
class ListWidgetTester : public VideoListWidget
|
|
63 |
{
|
|
64 |
public:
|
|
65 |
/**
|
|
66 |
* constructor
|
|
67 |
*/
|
34
|
68 |
ListWidgetTester(VideoCollectionUiLoader* uiLoader, HbView *parent) :
|
|
69 |
VideoListWidget(uiLoader, parent)
|
30
|
70 |
{
|
|
71 |
|
|
72 |
}
|
|
73 |
|
|
74 |
/**
|
|
75 |
* calls emitActivated
|
|
76 |
*/
|
|
77 |
void callEmiteActivated(QModelIndex index)
|
|
78 |
{
|
|
79 |
VideoListWidget::emitActivated(index);
|
|
80 |
}
|
|
81 |
|
|
82 |
/**
|
36
|
83 |
* calls longPressedSlot
|
30
|
84 |
*/
|
36
|
85 |
void callLongPressedSlot(HbAbstractViewItem *item, const QPointF &point)
|
30
|
86 |
{
|
36
|
87 |
VideoListWidget::longPressedSlot(item, point);
|
|
88 |
}
|
44
|
89 |
|
|
90 |
void callRowsInserted(const QModelIndex &parent, int start, int end)
|
|
91 |
{
|
|
92 |
VideoListWidget::rowsInserted(parent, start, end);
|
|
93 |
}
|
|
94 |
|
|
95 |
|
|
96 |
void callRowsRemoved(const QModelIndex &parent, int start, int end)
|
|
97 |
{
|
|
98 |
VideoListWidget::rowsRemoved(parent, start, end);
|
|
99 |
}
|
30
|
100 |
};
|
|
101 |
|
|
102 |
// ---------------------------------------------------------------------------
|
|
103 |
// main
|
|
104 |
// ---------------------------------------------------------------------------
|
|
105 |
//
|
34
|
106 |
int main(int argc, char *argv[])
|
30
|
107 |
{
|
|
108 |
TestListWidget tv;
|
35
|
109 |
QApplication app(argc, argv);
|
34
|
110 |
int res;
|
|
111 |
if(argc > 1)
|
|
112 |
{
|
|
113 |
res = QTest::qExec(&tv, argc, argv);
|
|
114 |
}
|
|
115 |
else
|
|
116 |
{
|
|
117 |
char *pass[3];
|
|
118 |
pass[0] = argv[0];
|
|
119 |
pass[1] = "-o";
|
|
120 |
pass[2] = "c:\\data\\testlistwidget.txt";
|
|
121 |
res = QTest::qExec(&tv, 3, pass);
|
|
122 |
}
|
|
123 |
|
|
124 |
return res;
|
|
125 |
}
|
30
|
126 |
|
34
|
127 |
// ---------------------------------------------------------------------------
|
36
|
128 |
// setRowCount
|
34
|
129 |
// ---------------------------------------------------------------------------
|
|
130 |
//
|
36
|
131 |
void TestListWidget::setRowCount(int count,
|
|
132 |
VideoCollectionCommon::TModelType type,
|
|
133 |
VideoListDataModel *model)
|
34
|
134 |
{
|
|
135 |
if (!model)
|
|
136 |
{
|
|
137 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
|
138 |
VideoSortFilterProxyModel *model = wrapper.getModel(type);
|
|
139 |
QVERIFY(model);
|
|
140 |
|
|
141 |
VideoListDataModel *sourceModel = qobject_cast<VideoListDataModel*>(model->sourceModel());
|
|
142 |
QVERIFY(sourceModel);
|
|
143 |
|
|
144 |
VideoListDataModelData::setRowCount(*sourceModel, count);
|
|
145 |
sourceModel->initialize();
|
|
146 |
}
|
|
147 |
else
|
|
148 |
{
|
|
149 |
VideoListDataModelData::setRowCount(*model, count);
|
|
150 |
model->initialize();
|
|
151 |
}
|
30
|
152 |
}
|
|
153 |
|
|
154 |
// ---------------------------------------------------------------------------
|
35
|
155 |
// initTestCase
|
|
156 |
// ---------------------------------------------------------------------------
|
|
157 |
//
|
|
158 |
void TestListWidget::initTestCase()
|
|
159 |
{
|
|
160 |
qRegisterMetaType<QModelIndex>("QModelIndex");
|
41
|
161 |
qRegisterMetaType<TMPXItemId>("TMPXItemId");
|
35
|
162 |
}
|
|
163 |
|
|
164 |
// ---------------------------------------------------------------------------
|
30
|
165 |
// init
|
|
166 |
// ---------------------------------------------------------------------------
|
|
167 |
//
|
|
168 |
void TestListWidget::init()
|
|
169 |
{
|
|
170 |
mDummyMainWnd = new HbMainWindow;
|
|
171 |
mTempView = new HbView;
|
35
|
172 |
mTestUiLoader = new VideoCollectionUiLoader();
|
|
173 |
hbInstance->mWindowses.append(mDummyMainWnd);
|
|
174 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
30
|
175 |
}
|
|
176 |
|
|
177 |
// ---------------------------------------------------------------------------
|
|
178 |
// cleanup
|
|
179 |
// ---------------------------------------------------------------------------
|
|
180 |
//
|
|
181 |
void TestListWidget::cleanup()
|
|
182 |
{
|
|
183 |
delete mTestWidget;
|
|
184 |
mTestWidget = 0;
|
|
185 |
|
|
186 |
delete mTempView;
|
|
187 |
mTempView = 0;
|
|
188 |
|
|
189 |
delete mDummyMainWnd;
|
|
190 |
mDummyMainWnd = 0;
|
|
191 |
|
|
192 |
hbInstance->mWindowses.clear();
|
34
|
193 |
|
|
194 |
VideoCollectionWrapperData::reset();
|
|
195 |
HbMenuData::reset();
|
|
196 |
VideoThumbnailTestData::reset();
|
|
197 |
VideoListDataModelData::reset();
|
|
198 |
VideoSortFilterProxyModelData::reset();
|
|
199 |
HbMessageBoxData::reset();
|
30
|
200 |
}
|
|
201 |
|
|
202 |
// ---------------------------------------------------------------------------
|
41
|
203 |
// testInitialized
|
30
|
204 |
// ---------------------------------------------------------------------------
|
|
205 |
//
|
|
206 |
void TestListWidget::testInitialize()
|
|
207 |
{
|
34
|
208 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
209 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
30
|
210 |
|
|
211 |
// succeed case ( new operator cannot be stubbed)
|
34
|
212 |
QVERIFY(mTestWidget->initialize(*model) == 0);
|
|
213 |
QVERIFY(mTestWidget->mModel == model);
|
30
|
214 |
QVERIFY(mTestWidget->mVideoServices == 0);
|
35
|
215 |
|
|
216 |
// service initialization
|
|
217 |
VideoServices *service = VideoServices::instance();
|
41
|
218 |
QVERIFY(mTestWidget->initialize(*model, true) == 0);
|
35
|
219 |
QVERIFY(mTestWidget->mModel == model);
|
|
220 |
QVERIFY(mTestWidget->mVideoServices == service);
|
|
221 |
service->decreaseReferenceCount();
|
|
222 |
service = 0;
|
|
223 |
|
30
|
224 |
}
|
|
225 |
|
|
226 |
// ---------------------------------------------------------------------------
|
|
227 |
// testActivate
|
|
228 |
// ---------------------------------------------------------------------------
|
|
229 |
//
|
|
230 |
void TestListWidget::testActivate()
|
|
231 |
{
|
34
|
232 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
233 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
234 |
|
30
|
235 |
// no model: fails
|
|
236 |
QVERIFY(mTestWidget->activate() == -1);
|
34
|
237 |
QCOMPARE(HbMenuData::mEnabledSetted, false);
|
30
|
238 |
QCOMPARE(HbListView::mLatestVisibility, false);
|
35
|
239 |
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
|
30
|
240 |
|
41
|
241 |
// model exist, no current view default level: fails
|
34
|
242 |
QVERIFY(mTestWidget->initialize(*model) == 0);
|
41
|
243 |
QVERIFY(mTestWidget->activate() == -1);
|
34
|
244 |
QCOMPARE(HbMenuData::mEnabledSetted, false);
|
41
|
245 |
QCOMPARE(HbListView::mLatestVisibility, false);
|
|
246 |
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
|
30
|
247 |
|
34
|
248 |
HbMenuData::mEnabledSetted = true;
|
30
|
249 |
HbListView::mLatestVisibility = false;
|
|
250 |
HbListView::mLatestEnableValue = false;
|
34
|
251 |
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
|
41
|
252 |
HbView *tmpView = new HbView();
|
36
|
253 |
// model exists, current view exists, level neither ELevelAlbum nor ELevelDefaultColl
|
41
|
254 |
delete mTestWidget;
|
|
255 |
mTestWidget = 0;
|
|
256 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
|
257 |
model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
|
258 |
|
|
259 |
QVERIFY(mTestWidget->initialize(*model, 0, VideoCollectionCommon::ELevelVideos) == 0);
|
35
|
260 |
hbInstance->allMainWindows().value(0)->addView(tmpView);
|
|
261 |
QVERIFY(mTestWidget->activate() == 0);
|
|
262 |
QCOMPARE(HbMenuData::mEnabledSetted, true);
|
|
263 |
QCOMPARE(HbListView::mLatestVisibility, true);
|
|
264 |
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 1);
|
36
|
265 |
QVERIFY(mTestWidget->mNavKeyAction);
|
|
266 |
QVERIFY(HbAction::mNavAction == Hb::QuitAction);
|
|
267 |
|
35
|
268 |
HbMenuData::mEnabledSetted = true;
|
|
269 |
HbListView::mLatestVisibility = false;
|
|
270 |
HbListView::mLatestEnableValue = false;
|
|
271 |
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
|
|
272 |
|
36
|
273 |
// model exists, current view exists, level is ELevelAlbum
|
|
274 |
delete mTestWidget;
|
|
275 |
mTestWidget = 0;
|
|
276 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
|
277 |
model = wrapper.getModel(VideoCollectionCommon::EModelTypeCollectionContent);
|
35
|
278 |
tmpView->mNavigationAction = 0;
|
36
|
279 |
QVERIFY(mTestWidget->initialize(*model) == 0);
|
35
|
280 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelAlbum) == 0);
|
|
281 |
QCOMPARE(HbMenuData::mEnabledSetted, true);
|
|
282 |
QCOMPARE(HbListView::mLatestVisibility, true);
|
34
|
283 |
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 1);
|
36
|
284 |
QVERIFY(mTestWidget->mNavKeyAction);
|
|
285 |
QVERIFY(HbAction::mNavAction == Hb::BackAction);
|
35
|
286 |
|
|
287 |
HbMenuData::mEnabledSetted = true;
|
|
288 |
HbListView::mLatestVisibility = false;
|
|
289 |
HbListView::mLatestEnableValue = false;
|
|
290 |
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 0;
|
36
|
291 |
|
|
292 |
// activate:
|
|
293 |
// -is service
|
|
294 |
// -current service is browse
|
41
|
295 |
VideoServices *videoServices = VideoServices::instance();
|
|
296 |
delete mTestWidget;
|
|
297 |
mTestWidget = 0;
|
|
298 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
36
|
299 |
videoServices->mCurrentService = VideoServices::EBrowse;
|
41
|
300 |
QVERIFY(mTestWidget->initialize(*model, true) == 0);
|
|
301 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
|
|
302 |
QVERIFY(mTestWidget->mNavKeyAction);
|
|
303 |
QVERIFY(HbAction::mNavAction == Hb::BackAction);
|
|
304 |
|
|
305 |
// activate:
|
|
306 |
// -is service
|
|
307 |
// -current service is fetch
|
|
308 |
// -activating all videos
|
36
|
309 |
delete mTestWidget;
|
|
310 |
mTestWidget = 0;
|
|
311 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
41
|
312 |
videoServices->mCurrentService = VideoServices::EUriFetcher;
|
|
313 |
QVERIFY(mTestWidget->initialize(*model, true) == 0);
|
|
314 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelVideos) == 0);
|
36
|
315 |
QVERIFY(mTestWidget->mNavKeyAction);
|
|
316 |
QVERIFY(HbAction::mNavAction == Hb::QuitAction);
|
35
|
317 |
|
41
|
318 |
// activate:
|
|
319 |
// -is service
|
|
320 |
// -current service is fetch
|
|
321 |
// -activating album
|
|
322 |
delete mTestWidget;
|
|
323 |
mTestWidget = 0;
|
|
324 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
|
325 |
videoServices->mCurrentService = VideoServices::EUriFetcher;
|
|
326 |
QVERIFY(mTestWidget->initialize(*model, true) == 0);
|
|
327 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelAlbum) == 0);
|
|
328 |
QVERIFY(mTestWidget->mNavKeyAction);
|
|
329 |
QVERIFY(HbAction::mNavAction == Hb::BackAction);
|
|
330 |
|
35
|
331 |
hbInstance->allMainWindows().value(0)->removeView(tmpView);
|
|
332 |
delete tmpView;
|
36
|
333 |
|
|
334 |
// final cleanup
|
|
335 |
videoServices->mCurrentService = VideoServices::ENoService;
|
|
336 |
videoServices->decreaseReferenceCount();
|
30
|
337 |
}
|
|
338 |
|
|
339 |
// ---------------------------------------------------------------------------
|
|
340 |
// testDeactivate
|
|
341 |
// ---------------------------------------------------------------------------
|
|
342 |
//
|
|
343 |
void TestListWidget::testDeactivate()
|
|
344 |
{
|
34
|
345 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
346 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
347 |
|
35
|
348 |
HbListView::mLatestVisibility = true;
|
|
349 |
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 1;
|
30
|
350 |
|
|
351 |
mTestWidget->activate();
|
|
352 |
|
|
353 |
// no context menu and activated without model
|
|
354 |
mTestWidget->deactivate();
|
|
355 |
QCOMPARE(HbListView::mLatestVisibility, false);
|
34
|
356 |
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
|
30
|
357 |
|
35
|
358 |
HbListView::mLatestVisibility = true;
|
|
359 |
VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled = 1;
|
|
360 |
|
30
|
361 |
// context menu exists and activated with model
|
|
362 |
mTestWidget->mContextMenu = new HbMenu;
|
34
|
363 |
QVERIFY(mTestWidget->initialize(*model) == 0);
|
30
|
364 |
mTestWidget->activate();
|
|
365 |
mTestWidget->deactivate();
|
35
|
366 |
QCOMPARE(HbListView::mLatestVisibility, false);
|
34
|
367 |
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
|
30
|
368 |
|
36
|
369 |
// deactivate:
|
|
370 |
// -is service
|
|
371 |
// -current service is browse
|
|
372 |
VideoServices *videoServices = VideoServices::instance();
|
|
373 |
videoServices->mCurrentService = VideoServices::EBrowse;
|
|
374 |
delete mTestWidget;
|
|
375 |
mTestWidget = 0;
|
|
376 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
|
377 |
QVERIFY(mTestWidget->initialize(*model, videoServices) == 0);
|
|
378 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
|
|
379 |
mTestWidget->deactivate();
|
|
380 |
QCOMPARE(HbListView::mLatestVisibility, false);
|
|
381 |
QCOMPARE(VideoThumbnailTestData::mBackgroundThumbnailFetchingEnabled, 0);
|
|
382 |
|
|
383 |
// final cleanup
|
|
384 |
videoServices->mCurrentService = VideoServices::ENoService;
|
|
385 |
videoServices->decreaseReferenceCount();
|
30
|
386 |
}
|
|
387 |
|
|
388 |
// ---------------------------------------------------------------------------
|
|
389 |
// testGetLevel
|
|
390 |
// ---------------------------------------------------------------------------
|
|
391 |
//
|
34
|
392 |
void TestListWidget::testGetLevel()
|
30
|
393 |
{
|
34
|
394 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
395 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
396 |
|
|
397 |
mTestWidget->initialize(*model);
|
30
|
398 |
|
34
|
399 |
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
|
|
400 |
QCOMPARE(mTestWidget->getLevel(), VideoCollectionCommon::ELevelVideos);
|
30
|
401 |
}
|
|
402 |
|
|
403 |
// ---------------------------------------------------------------------------
|
|
404 |
// testGetModel
|
|
405 |
// ---------------------------------------------------------------------------
|
|
406 |
//
|
|
407 |
void TestListWidget::testGetModel()
|
|
408 |
{
|
34
|
409 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
410 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
411 |
|
40
|
412 |
QVERIFY(mTestWidget->getModel() == 0);
|
30
|
413 |
|
|
414 |
HbListView::mVScrollBarIsNull = false;
|
|
415 |
HbListView::mReturnNullPrototype = false;
|
34
|
416 |
mTestWidget->initialize(*model);
|
30
|
417 |
|
40
|
418 |
QVERIFY(mTestWidget->getModel() == model);
|
30
|
419 |
}
|
|
420 |
|
|
421 |
// ---------------------------------------------------------------------------
|
|
422 |
// testEmitActivated
|
|
423 |
// ---------------------------------------------------------------------------
|
|
424 |
//
|
|
425 |
void TestListWidget::testEmitActivated()
|
|
426 |
{
|
36
|
427 |
VideoServices *videoServices = VideoServices::instance();
|
34
|
428 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
429 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
430 |
|
41
|
431 |
QSignalSpy spysignal(mTestWidget, SIGNAL(collectionOpened(bool, const QString&, const TMPXItemId&)));
|
35
|
432 |
QSignalSpy spysignalFileUri(mTestWidget, SIGNAL(fileUri(const QString&)));
|
|
433 |
QSignalSpy spysignalActivated(mTestWidget, SIGNAL(activated(const QModelIndex&)));
|
|
434 |
|
34
|
435 |
mTestWidget->initialize(*model);
|
37
|
436 |
mTestWidget->activate();
|
30
|
437 |
|
35
|
438 |
VideoSortFilterProxyModelData::mLastItemId = TMPXItemId::InvalidId();
|
|
439 |
TMPXItemId savedId = TMPXItemId(1,1);
|
|
440 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
441 |
VideoSortFilterProxyModelData::mItemIds.append(savedId);
|
30
|
442 |
QVariant data = QString("test");
|
36
|
443 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
35
|
444 |
setRowCount(2);
|
34
|
445 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0,0));
|
30
|
446 |
|
34
|
447 |
QModelIndex fetchIndex = model->index(0, 0, QModelIndex());
|
30
|
448 |
|
|
449 |
// selection mode == HbAbstractItemView::MultiSelection
|
35
|
450 |
mTestWidget->setSelectionMode(HbAbstractItemView::MultiSelection);
|
30
|
451 |
mTestWidget->callEmiteActivated(fetchIndex);
|
|
452 |
QVERIFY(spysignal.count() == 0);
|
35
|
453 |
QVERIFY(spysignalFileUri.count() == 0);
|
|
454 |
QVERIFY(spysignalActivated.count() == 1);
|
|
455 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
|
456 |
spysignal.clear();
|
|
457 |
spysignalFileUri.clear();
|
|
458 |
spysignalActivated.clear();
|
30
|
459 |
|
|
460 |
// modelIndex is not valid
|
35
|
461 |
mTestWidget->setSelectionMode(HbAbstractItemView::NoSelection);
|
30
|
462 |
fetchIndex = QModelIndex();
|
|
463 |
mTestWidget->callEmiteActivated(fetchIndex);
|
|
464 |
QVERIFY(spysignal.count() == 0);
|
35
|
465 |
QVERIFY(spysignalFileUri.count() == 0);
|
|
466 |
QVERIFY(spysignalActivated.count() == 0);
|
|
467 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
|
468 |
|
|
469 |
// current level is ELevelCategory
|
|
470 |
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
|
|
471 |
// --> variant is not valid
|
36
|
472 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant());
|
34
|
473 |
fetchIndex = model->index(0, 0, QModelIndex());
|
30
|
474 |
mTestWidget->callEmiteActivated(fetchIndex);
|
|
475 |
QVERIFY(spysignal.count() == 0);
|
35
|
476 |
QVERIFY(spysignalFileUri.count() == 0);
|
|
477 |
QVERIFY(spysignalActivated.count() == 0);
|
|
478 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
30
|
479 |
|
34
|
480 |
|
35
|
481 |
// --> variant is valid, collectionOpened -signal should be emitted
|
36
|
482 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
35
|
483 |
fetchIndex = model->index(1, 0, QModelIndex());
|
|
484 |
mTestWidget->callEmiteActivated(fetchIndex);
|
|
485 |
QVERIFY(spysignal.count() == 1);
|
|
486 |
QVERIFY(spysignalFileUri.count() == 0);
|
|
487 |
QVERIFY(spysignalActivated.count() == 0);
|
|
488 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
|
489 |
|
|
490 |
spysignal.clear();
|
|
491 |
spysignalFileUri.clear();
|
|
492 |
spysignalActivated.clear();
|
|
493 |
|
|
494 |
// current level is not ELevelCategory
|
41
|
495 |
// mVideoServices exist, variant gotten is invalid
|
39
|
496 |
mTestWidget->mService = VideoServices::EUriFetcher;
|
36
|
497 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant());
|
35
|
498 |
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
|
36
|
499 |
mTestWidget->mVideoServices = videoServices;
|
39
|
500 |
fetchIndex = model->index(5, 0, QModelIndex());
|
30
|
501 |
mTestWidget->callEmiteActivated(fetchIndex);
|
|
502 |
QVERIFY(spysignal.count() == 0);
|
35
|
503 |
QVERIFY(spysignalFileUri.count() == 0);
|
|
504 |
QVERIFY(spysignalActivated.count() == 0);
|
|
505 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
30
|
506 |
|
35
|
507 |
// current level is not ELevelCategory
|
41
|
508 |
// mVideoServices, variant gotten is valid
|
39
|
509 |
mTestWidget->mService = VideoServices::EUriFetcher;
|
36
|
510 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyFilePath, data);
|
35
|
511 |
fetchIndex = model->index(0, 0, QModelIndex());
|
30
|
512 |
mTestWidget->callEmiteActivated(fetchIndex);
|
|
513 |
QVERIFY(spysignal.count() == 0);
|
35
|
514 |
QVERIFY(spysignalFileUri.count() == 1);
|
|
515 |
QVERIFY(spysignalActivated.count() == 0);
|
|
516 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
|
517 |
|
|
518 |
spysignal.clear();
|
|
519 |
spysignalFileUri.clear();
|
|
520 |
spysignalActivated.clear();
|
|
521 |
|
|
522 |
// current level is not ELevelCategory
|
41
|
523 |
// mVideoServices does not exists
|
|
524 |
mTestWidget->mVideoServices = 0;
|
34
|
525 |
fetchIndex = model->index(0, 0, QModelIndex());
|
30
|
526 |
mTestWidget->callEmiteActivated(fetchIndex);
|
35
|
527 |
QVERIFY(spysignal.count() == 0);
|
|
528 |
QVERIFY(spysignalFileUri.count() == 0);
|
|
529 |
QVERIFY(spysignalActivated.count() == 0);
|
|
530 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == savedId);
|
|
531 |
|
|
532 |
// context menu is visible
|
|
533 |
if (!mTestWidget->mContextMenu)
|
|
534 |
{
|
|
535 |
mTestWidget->mContextMenu = new HbMenu;
|
|
536 |
}
|
|
537 |
mTestWidget->mContextMenu->show();
|
|
538 |
VideoSortFilterProxyModelData::mLastItemId = TMPXItemId::InvalidId();
|
|
539 |
fetchIndex = model->index(0, 0, QModelIndex());
|
|
540 |
mTestWidget->callEmiteActivated(fetchIndex);
|
|
541 |
QVERIFY(spysignal.count() == 0);
|
|
542 |
QVERIFY(spysignalFileUri.count() == 0);
|
|
543 |
QVERIFY(spysignalActivated.count() == 0);
|
|
544 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
36
|
545 |
|
|
546 |
// final cleanup
|
|
547 |
videoServices->decreaseReferenceCount();
|
30
|
548 |
}
|
|
549 |
|
|
550 |
// ---------------------------------------------------------------------------
|
36
|
551 |
// testLongPressedSlot
|
30
|
552 |
// ---------------------------------------------------------------------------
|
|
553 |
//
|
36
|
554 |
void TestListWidget::testLongPressedSlot()
|
30
|
555 |
{
|
34
|
556 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
557 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
558 |
|
30
|
559 |
QVariant data = QString("test");
|
|
560 |
// correct data to index 0
|
36
|
561 |
VideoListDataModelData::setData(Qt::DisplayRole, data);
|
35
|
562 |
setRowCount(2);
|
30
|
563 |
|
|
564 |
QPointF point(1,1);
|
34
|
565 |
mTestWidget->initialize(*model);
|
30
|
566 |
|
36
|
567 |
HbAbstractViewItem *item = new HbAbstractViewItem();
|
|
568 |
item->mModelIndex = mTestWidget->mModel->index(0, 0, QModelIndex());
|
35
|
569 |
mTestWidget->setSelectionMode(HbAbstractItemView::MultiSelection);
|
36
|
570 |
|
30
|
571 |
// mDetailsReady is false
|
36
|
572 |
mTestWidget->callLongPressedSlot(item, point);
|
34
|
573 |
QVERIFY(HbMenuData::mExecPoint != point);
|
30
|
574 |
|
|
575 |
// multiselection is on
|
36
|
576 |
mTestWidget->callLongPressedSlot(item, point);
|
35
|
577 |
QVERIFY(HbMenuData::mExecPoint != point);
|
|
578 |
|
|
579 |
// selection mode is custom
|
|
580 |
mTestWidget->setSelectionMode(-1);
|
36
|
581 |
mTestWidget->callLongPressedSlot(item, point);
|
34
|
582 |
QVERIFY(HbMenuData::mExecPoint != point);
|
30
|
583 |
|
36
|
584 |
// item is null
|
35
|
585 |
mTestWidget->setSelectionMode(HbAbstractItemView::NoSelection);
|
30
|
586 |
HbListView::mCurrentIndex = QModelIndex();
|
36
|
587 |
mTestWidget->callLongPressedSlot(0, point);
|
34
|
588 |
QVERIFY(HbMenuData::mExecPoint != point);
|
30
|
589 |
|
36
|
590 |
// item has invalid index
|
|
591 |
item->mModelIndex = QModelIndex();
|
|
592 |
mTestWidget->callLongPressedSlot(item, point);
|
35
|
593 |
QVERIFY(HbMenuData::mExecPoint != point);
|
|
594 |
|
|
595 |
// item at position is not null, returns current index is valid
|
36
|
596 |
item->mModelIndex = model->index(0, 0, QModelIndex());
|
35
|
597 |
mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ;
|
30
|
598 |
|
36
|
599 |
// model is null
|
30
|
600 |
VideoSortFilterProxyModel *tmp = mTestWidget->mModel;
|
|
601 |
mTestWidget->mModel = 0;
|
36
|
602 |
mTestWidget->callLongPressedSlot(item, point);
|
34
|
603 |
QVERIFY(HbMenuData::mExecPoint != point);
|
30
|
604 |
mTestWidget->mModel = tmp;
|
|
605 |
|
41
|
606 |
VideoServices *videoServices = VideoServices::instance();
|
|
607 |
|
|
608 |
// gotten id != KVcxMvcMediaTypeVideo, service exists true and id != KVcxMvcMediaTypeAlbum
|
35
|
609 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
610 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,1));
|
41
|
611 |
mTestWidget->mVideoServices = videoServices;
|
36
|
612 |
mTestWidget->callLongPressedSlot(item, point);
|
|
613 |
QVERIFY(HbMenuData::mExecPoint == point);
|
30
|
614 |
|
41
|
615 |
// gotten id != KVcxMvcMediaTypeVideo, service does not exists and id != KVcxMvcMediaTypeAlbum
|
35
|
616 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
617 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,1));
|
41
|
618 |
mTestWidget->mVideoServices = 0;
|
36
|
619 |
mTestWidget->callLongPressedSlot(item, point);
|
|
620 |
QVERIFY(HbMenuData::mExecPoint == point);
|
30
|
621 |
|
41
|
622 |
// gotten id != KVcxMvcMediaTypeVideo, service service does not exists and id == KVcxMvcMediaTypeAlbum
|
35
|
623 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
624 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,2));
|
41
|
625 |
mTestWidget->mVideoServices = 0;
|
36
|
626 |
mTestWidget->callLongPressedSlot(item, point);
|
34
|
627 |
QVERIFY(HbMenuData::mExecPoint == point);
|
|
628 |
HbMenuData::mExecPoint = QPointF();
|
30
|
629 |
|
35
|
630 |
// gotten id == KVcxMvcMediaTypeVideo
|
|
631 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
632 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,02));
|
41
|
633 |
mTestWidget->mVideoServices = 0;
|
36
|
634 |
mTestWidget->callLongPressedSlot(item, point);
|
34
|
635 |
QVERIFY(HbMenuData::mExecPoint == point);
|
|
636 |
HbMenuData::mExecPoint = QPointF();
|
30
|
637 |
|
35
|
638 |
// no context menu
|
|
639 |
// (context menu setup fails, due invalid amount of correct actions)
|
36
|
640 |
QMap<VideoListWidget::TContextActionIds, HbAction*>::iterator iter =
|
|
641 |
mTestWidget->mContextMenuActions.begin();
|
30
|
642 |
iter++;
|
|
643 |
HbAction *nullAction = 0;
|
|
644 |
iter.value() = nullAction;
|
36
|
645 |
mTestWidget->callLongPressedSlot(item, point);
|
34
|
646 |
QVERIFY(HbMenuData::mExecPoint != point);
|
36
|
647 |
|
|
648 |
// long press gesture:
|
|
649 |
// -is service
|
|
650 |
// -current service is browse
|
|
651 |
HbMenuData::mExecPoint = QPointF();
|
|
652 |
videoServices->mCurrentService = VideoServices::EBrowse;
|
|
653 |
delete mTestWidget;
|
|
654 |
mTestWidget = 0;
|
|
655 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
41
|
656 |
QVERIFY(mTestWidget->initialize(*model, true) == 0);
|
36
|
657 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
|
|
658 |
mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
|
|
659 |
mTestWidget->callLongPressedSlot(item, point);
|
|
660 |
QCOMPARE(mTestWidget->mContextMenuActions.count(), 3);
|
|
661 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
|
|
662 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDelete]->isVisible());
|
|
663 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
|
|
664 |
|
|
665 |
// long press gesture:
|
41
|
666 |
// - is service
|
|
667 |
// - current service is EUriFetcher
|
|
668 |
// - category view activated
|
36
|
669 |
HbMenuData::mExecPoint = QPointF();
|
|
670 |
videoServices = VideoServices::instance();
|
|
671 |
videoServices->mCurrentService = VideoServices::EUriFetcher;
|
|
672 |
delete mTestWidget;
|
|
673 |
mTestWidget = 0;
|
|
674 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
41
|
675 |
QVERIFY(mTestWidget->initialize(*model, true) == 0);
|
|
676 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelCategory) == 0);
|
|
677 |
mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
|
|
678 |
mTestWidget->callLongPressedSlot(item, point);
|
|
679 |
QCOMPARE(mTestWidget->mContextMenuActions.count(), 4);
|
|
680 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionOpen]->isVisible());
|
|
681 |
QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionAttach]->isVisible());
|
|
682 |
QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
|
|
683 |
QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
|
|
684 |
|
|
685 |
// long press gesture:
|
|
686 |
// - is service
|
|
687 |
// - current service is EUriFetcher
|
|
688 |
// - user defined collection activated
|
|
689 |
HbMenuData::mExecPoint = QPointF();
|
|
690 |
videoServices = VideoServices::instance();
|
|
691 |
videoServices->mCurrentService = VideoServices::EUriFetcher;
|
|
692 |
delete mTestWidget;
|
|
693 |
mTestWidget = 0;
|
|
694 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
|
695 |
QVERIFY(mTestWidget->initialize(*model, true) == 0);
|
|
696 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelAlbum) == 0);
|
|
697 |
mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
|
|
698 |
mTestWidget->callLongPressedSlot(item, point);
|
|
699 |
QCOMPARE(mTestWidget->mContextMenuActions.count(), 4);
|
|
700 |
QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionOpen]->isVisible());
|
|
701 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionAttach]->isVisible());
|
|
702 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
|
|
703 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
|
|
704 |
|
|
705 |
// long press gesture:
|
|
706 |
// - is service
|
|
707 |
// - current service is EUriFetcher
|
|
708 |
// - default collection activated
|
|
709 |
HbMenuData::mExecPoint = QPointF();
|
|
710 |
videoServices = VideoServices::instance();
|
|
711 |
videoServices->mCurrentService = VideoServices::EUriFetcher;
|
|
712 |
delete mTestWidget;
|
|
713 |
mTestWidget = 0;
|
|
714 |
mTestWidget = new ListWidgetTester(mTestUiLoader, mTempView);
|
|
715 |
QVERIFY(mTestWidget->initialize(*model, true) == 0);
|
36
|
716 |
QVERIFY(mTestWidget->activate(VideoCollectionCommon::ELevelDefaultColl) == 0);
|
|
717 |
mTestWidget->mItem->mModelIndex = model->index(0, 0, QModelIndex());
|
|
718 |
mTestWidget->callLongPressedSlot(item, point);
|
41
|
719 |
QCOMPARE(mTestWidget->mContextMenuActions.count(), 4);
|
|
720 |
QVERIFY(!mTestWidget->mContextMenuActions[VideoListWidget::EActionOpen]->isVisible());
|
37
|
721 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionAttach]->isVisible());
|
36
|
722 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionPlay]->isVisible());
|
|
723 |
QVERIFY(mTestWidget->mContextMenuActions[VideoListWidget::EActionDetails]->isVisible());
|
|
724 |
|
|
725 |
// final cleanup
|
|
726 |
videoServices->decreaseReferenceCount();
|
|
727 |
delete item;
|
|
728 |
}
|
|
729 |
|
|
730 |
// ---------------------------------------------------------------------------
|
30
|
731 |
// testSetContextMenu
|
|
732 |
// ---------------------------------------------------------------------------
|
|
733 |
//
|
|
734 |
void TestListWidget::testSetContextMenu()
|
|
735 |
{
|
34
|
736 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
737 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
738 |
VideoListDataModel *sourceModel = qobject_cast<VideoListDataModel*>(model->sourceModel());
|
|
739 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
740 |
mTestWidget->initialize(*model);
|
35
|
741 |
|
|
742 |
setRowCount(1);
|
|
743 |
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
744 |
mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ;
|
41
|
745 |
|
30
|
746 |
TMPXItemId itemId;
|
|
747 |
QPointF point(1,1);
|
|
748 |
itemId.iId2 = 0;
|
34
|
749 |
VideoSortFilterProxyModelData::mItemIds.append(itemId);
|
30
|
750 |
|
36
|
751 |
HbAbstractViewItem *item = new HbAbstractViewItem();
|
|
752 |
item->mModelIndex = model->index(0, 0, QModelIndex());
|
|
753 |
|
30
|
754 |
// no context menu
|
|
755 |
delete mTestWidget->mContextMenu;
|
|
756 |
mTestWidget->mContextMenu = 0;
|
|
757 |
|
|
758 |
// mCurrentLevel == ELevelVideos
|
|
759 |
int visibleCount = 0;
|
34
|
760 |
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
|
36
|
761 |
mTestWidget->callLongPressedSlot(item, point);
|
30
|
762 |
|
|
763 |
QMap<VideoListWidget::TContextActionIds, HbAction*>::iterator iter = mTestWidget->mContextMenuActions.begin();
|
|
764 |
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
|
|
765 |
|
|
766 |
while(iter != mTestWidget->mContextMenuActions.end())
|
|
767 |
{
|
36
|
768 |
if(iter.value()->isVisible())
|
30
|
769 |
{
|
|
770 |
visibleCount++;
|
|
771 |
}
|
|
772 |
++iter;
|
|
773 |
}
|
36
|
774 |
QVERIFY(visibleCount == 4);
|
30
|
775 |
|
|
776 |
// invalid amount of actions -> invalid items gets removed
|
|
777 |
HbAction *nullAction = 0;
|
|
778 |
iter = mTestWidget->mContextMenuActions.begin();
|
|
779 |
iter++;
|
|
780 |
iter.value() = nullAction;
|
36
|
781 |
mTestWidget->callLongPressedSlot(item, point);
|
30
|
782 |
QVERIFY(!mTestWidget->mContextMenu);
|
|
783 |
QVERIFY(mTestWidget->mContextMenuActions.count() == 0);
|
|
784 |
|
|
785 |
// mCurrentLevel == ELevelCategory
|
34
|
786 |
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelCategory;
|
41
|
787 |
// service does not exist
|
|
788 |
mTestWidget->mVideoServices = 0;
|
36
|
789 |
mTestWidget->callLongPressedSlot(item, point);
|
30
|
790 |
iter = mTestWidget->mContextMenuActions.begin();
|
|
791 |
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
|
|
792 |
visibleCount = 0;
|
|
793 |
while(iter != mTestWidget->mContextMenuActions.end())
|
|
794 |
{
|
36
|
795 |
if(iter.value()->isVisible())
|
30
|
796 |
{
|
|
797 |
visibleCount++;
|
|
798 |
}
|
35
|
799 |
++iter;
|
|
800 |
}
|
36
|
801 |
QVERIFY(visibleCount == 1);
|
30
|
802 |
|
41
|
803 |
VideoServices *videoServices = VideoServices::instance();
|
|
804 |
// service exists, mpxId.iId2 != KVcxMvcMediaTypeAlbum
|
|
805 |
mTestWidget->mVideoServices = videoServices;
|
36
|
806 |
mTestWidget->callLongPressedSlot(item, point);
|
35
|
807 |
iter = mTestWidget->mContextMenuActions.begin();
|
|
808 |
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
|
|
809 |
visibleCount = 0;
|
|
810 |
while(iter != mTestWidget->mContextMenuActions.end())
|
|
811 |
{
|
36
|
812 |
if(iter.value()->isVisible())
|
35
|
813 |
{
|
|
814 |
visibleCount++;
|
|
815 |
}
|
|
816 |
++iter;
|
|
817 |
}
|
36
|
818 |
QVERIFY(visibleCount == 1);
|
|
819 |
|
41
|
820 |
// service does not exists , mpxId.iId2 == KVcxMvcMediaTypeAlbum
|
36
|
821 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(1,KVcxMvcMediaTypeAlbum));
|
|
822 |
HbListView::mCurrentIndex = model->index(1, 0, QModelIndex());
|
|
823 |
item->mModelIndex = model->index(1, 0, QModelIndex());
|
41
|
824 |
mTestWidget->mVideoServices = 0;
|
36
|
825 |
mTestWidget->callLongPressedSlot(item, point);
|
|
826 |
iter = mTestWidget->mContextMenuActions.begin();
|
|
827 |
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
|
|
828 |
visibleCount = 0;
|
|
829 |
while(iter != mTestWidget->mContextMenuActions.end())
|
|
830 |
{
|
|
831 |
if(iter.value()->isVisible())
|
|
832 |
{
|
|
833 |
visibleCount++;
|
|
834 |
}
|
|
835 |
++iter;
|
|
836 |
}
|
|
837 |
QVERIFY(visibleCount == 3);
|
|
838 |
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
|
35
|
839 |
|
|
840 |
// mCurrentLevel == ELevelAlbum
|
|
841 |
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
|
41
|
842 |
// service does not exists
|
|
843 |
mTestWidget->mVideoServices = 0;
|
36
|
844 |
mTestWidget->callLongPressedSlot(item, point);
|
35
|
845 |
iter = mTestWidget->mContextMenuActions.begin();
|
|
846 |
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
|
|
847 |
visibleCount = 0;
|
|
848 |
while(iter != mTestWidget->mContextMenuActions.end())
|
|
849 |
{
|
36
|
850 |
if(iter.value()->isVisible())
|
35
|
851 |
{
|
|
852 |
visibleCount++;
|
|
853 |
}
|
|
854 |
++iter;
|
|
855 |
}
|
36
|
856 |
QVERIFY(visibleCount == 4);
|
30
|
857 |
|
41
|
858 |
// service does exists
|
35
|
859 |
// object needs to be resetted for the service use
|
|
860 |
cleanup();
|
|
861 |
init();
|
|
862 |
setRowCount(1);
|
36
|
863 |
model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
41
|
864 |
mTestWidget->mVideoServices = videoServices;
|
39
|
865 |
videoServices->mCurrentService = VideoServices::EUriFetcher;
|
|
866 |
mTestWidget->initialize(*model, videoServices);
|
35
|
867 |
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
868 |
mTestWidget->mItem->mModelIndex = HbListView::mCurrentIndex ;
|
|
869 |
|
|
870 |
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelAlbum;
|
|
871 |
VideoSortFilterProxyModelData::mItemIds.append(itemId);
|
39
|
872 |
|
36
|
873 |
mTestWidget->callLongPressedSlot(item, point);
|
35
|
874 |
iter = mTestWidget->mContextMenuActions.begin();
|
|
875 |
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
|
|
876 |
visibleCount = 0;
|
|
877 |
while(iter != mTestWidget->mContextMenuActions.end())
|
|
878 |
{
|
36
|
879 |
if(iter.value()->isVisible())
|
35
|
880 |
{
|
|
881 |
visibleCount++;
|
|
882 |
}
|
|
883 |
++iter;
|
|
884 |
}
|
37
|
885 |
QVERIFY(visibleCount == 3);
|
35
|
886 |
|
|
887 |
//invalid level
|
|
888 |
mTestWidget->mCurrentLevel = (VideoCollectionCommon::TCollectionLevels)0;
|
36
|
889 |
mTestWidget->callLongPressedSlot(item, point);
|
35
|
890 |
iter = mTestWidget->mContextMenuActions.begin();
|
|
891 |
QVERIFY(iter != mTestWidget->mContextMenuActions.end());
|
|
892 |
visibleCount = 0;
|
|
893 |
while(iter != mTestWidget->mContextMenuActions.end())
|
|
894 |
{
|
36
|
895 |
if(iter.value()->isVisible())
|
35
|
896 |
{
|
|
897 |
visibleCount++;
|
|
898 |
}
|
|
899 |
++iter;
|
|
900 |
}
|
36
|
901 |
QVERIFY(visibleCount == 0);
|
41
|
902 |
videoServices->decreaseReferenceCount();
|
30
|
903 |
}
|
35
|
904 |
|
|
905 |
void TestListWidget::testDoDelayedsSlot()
|
30
|
906 |
{
|
35
|
907 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(doDelayedsSlot()));
|
|
908 |
|
|
909 |
//dodelayed calls create context menu, which is already tested at
|
|
910 |
// testSetContextMenu -method, these tests are just for coverity's sake
|
34
|
911 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
912 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
35
|
913 |
mTestWidget->initialize(*model);
|
|
914 |
|
|
915 |
delete mTestWidget->mContextMenu;
|
|
916 |
mTestWidget->mContextMenu = 0;
|
|
917 |
int visibleCount = 0;
|
|
918 |
mTestWidget->mCurrentLevel = VideoCollectionCommon::ELevelVideos;
|
|
919 |
|
|
920 |
// no context menu
|
|
921 |
emit testSignal();
|
|
922 |
|
36
|
923 |
QVERIFY(mTestWidget->mContextMenuActions.count() == 8);
|
35
|
924 |
|
|
925 |
// context menu exists
|
|
926 |
emit testSignal();
|
|
927 |
|
36
|
928 |
QVERIFY(mTestWidget->mContextMenuActions.count() == 8);
|
35
|
929 |
|
|
930 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingStartedSlot()));
|
|
931 |
}
|
34
|
932 |
|
30
|
933 |
// ---------------------------------------------------------------------------
|
|
934 |
// testDeleteItemSlot
|
|
935 |
// ---------------------------------------------------------------------------
|
|
936 |
//
|
|
937 |
void TestListWidget::testDeleteItemSlot()
|
|
938 |
{
|
34
|
939 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
940 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
941 |
|
|
942 |
HbMessageBoxData::mLatestTxt = "";
|
|
943 |
VideoSortFilterProxyModelData::mLastIndex = QModelIndex();
|
|
944 |
mTestWidget->initialize(*model);
|
30
|
945 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(deleteItemSlot()));
|
|
946 |
|
38
|
947 |
HbMessageBox *box = new HbMessageBox();
|
|
948 |
|
30
|
949 |
// no model
|
38
|
950 |
VideoListDataModelData::mDataAccessCount = 0;
|
30
|
951 |
VideoSortFilterProxyModel *tmp = mTestWidget->mModel;
|
|
952 |
mTestWidget->mModel = 0;
|
|
953 |
emit testSignal();
|
34
|
954 |
QVERIFY(VideoListDataModelData::dataAccessCount() == 0);
|
|
955 |
QVERIFY(HbMessageBoxData::mLatestTxt.isEmpty());
|
|
956 |
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
|
|
957 |
setRowCount(1);
|
30
|
958 |
mTestWidget->mModel = tmp;
|
|
959 |
|
|
960 |
// data fetched from item is invalid
|
38
|
961 |
VideoListDataModelData::mDataAccessCount = 0;
|
34
|
962 |
setRowCount(1);
|
|
963 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
30
|
964 |
emit testSignal();
|
34
|
965 |
QVERIFY(VideoListDataModelData::dataAccessCount() == 1);
|
|
966 |
QVERIFY(HbMessageBoxData::mLatestTxt.isEmpty());
|
|
967 |
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
|
|
968 |
setRowCount(0);
|
30
|
969 |
|
|
970 |
// data is valid
|
38
|
971 |
VideoListDataModelData::mDataAccessCount = 0;
|
34
|
972 |
setRowCount(1);
|
30
|
973 |
QVariant data = QString("test");
|
36
|
974 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
34
|
975 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
30
|
976 |
|
|
977 |
// messagebox question returns false
|
34
|
978 |
HbMessageBoxData::mQuestionReturnValue = false;
|
30
|
979 |
emit testSignal();
|
44
|
980 |
box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(int)), HbMessageBox::No);
|
38
|
981 |
QVERIFY(VideoListDataModelData::dataAccessCount() == 1);
|
34
|
982 |
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
|
35
|
983 |
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
|
34
|
984 |
HbMessageBoxData::mLatestTxt = "";
|
|
985 |
setRowCount(1);
|
30
|
986 |
data = QString("test");
|
36
|
987 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
30
|
988 |
|
|
989 |
// messagebox question returns true
|
38
|
990 |
VideoListDataModelData::mDataAccessCount = 0;
|
35
|
991 |
VideoSortFilterProxyModelData::mDeleteItemsFails = false;
|
34
|
992 |
HbMessageBoxData::mQuestionReturnValue = true;
|
30
|
993 |
emit testSignal();
|
44
|
994 |
box->emitDialogFinished(mTestWidget, SLOT(deleteItemDialogFinished(int)), HbMessageBox::Yes);
|
38
|
995 |
QVERIFY(VideoListDataModelData::dataAccessCount() == 1);
|
34
|
996 |
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
|
|
997 |
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 0);
|
30
|
998 |
|
|
999 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(deleteItemSlot()));
|
|
1000 |
}
|
|
1001 |
|
|
1002 |
// ---------------------------------------------------------------------------
|
|
1003 |
// testRenameSlot
|
|
1004 |
// ---------------------------------------------------------------------------
|
|
1005 |
//
|
|
1006 |
void TestListWidget::testRenameSlot()
|
|
1007 |
{
|
34
|
1008 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1009 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
|
1010 |
|
38
|
1011 |
HbInputDialog *dialog = new HbInputDialog();
|
|
1012 |
|
36
|
1013 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
|
|
1014 |
|
|
1015 |
VideoSortFilterProxyModelData::reset();
|
|
1016 |
VideoSortFilterProxyModelData::mLastIndex = QModelIndex();
|
|
1017 |
mTestWidget->initialize(*model);
|
|
1018 |
|
|
1019 |
// Good case
|
|
1020 |
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
|
38
|
1021 |
HbInputDialog::mValueReturnValue = "renamedVideo";
|
|
1022 |
HbInputDialog::mValueCallCount = 0;
|
39
|
1023 |
HbInputDialog::mOpenCallCount = 0;
|
36
|
1024 |
setRowCount(1);
|
|
1025 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
|
|
1026 |
QVariant data = QString("albumName");
|
|
1027 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
|
1028 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1029 |
emit testSignal();
|
38
|
1030 |
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
|
36
|
1031 |
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "renamedVideo");
|
39
|
1032 |
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
|
38
|
1033 |
QVERIFY(HbInputDialog::mValueCallCount == 1);
|
|
1034 |
|
36
|
1035 |
// New name is same as previous
|
38
|
1036 |
HbInputDialog::mValueReturnValue = "";
|
|
1037 |
HbInputDialog::mValueCallCount = 0;
|
39
|
1038 |
HbInputDialog::mOpenCallCount = 0;
|
36
|
1039 |
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
|
|
1040 |
data = QString("albumName");
|
|
1041 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
|
1042 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1043 |
emit testSignal();
|
38
|
1044 |
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
|
|
1045 |
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
|
39
|
1046 |
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
|
38
|
1047 |
QVERIFY(HbInputDialog::mValueCallCount == 1);
|
|
1048 |
|
|
1049 |
// Dialog canceled
|
|
1050 |
HbInputDialog::mValueReturnValue = "";
|
|
1051 |
HbInputDialog::mValueCallCount = 0;
|
39
|
1052 |
HbInputDialog::mOpenCallCount = 0;
|
38
|
1053 |
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
|
|
1054 |
data = QString("albumName");
|
|
1055 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
|
1056 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1057 |
emit testSignal();
|
|
1058 |
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 1);
|
36
|
1059 |
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
|
39
|
1060 |
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
|
38
|
1061 |
QVERIFY(HbInputDialog::mValueCallCount == 1);
|
36
|
1062 |
|
38
|
1063 |
// New name is empty.
|
36
|
1064 |
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
|
38
|
1065 |
HbInputDialog::mValueReturnValue = "";
|
|
1066 |
HbInputDialog::mValueCallCount = 0;
|
39
|
1067 |
HbInputDialog::mOpenCallCount = 0;
|
38
|
1068 |
data = QString("albumName");
|
|
1069 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
|
1070 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1071 |
emit testSignal();
|
|
1072 |
dialog->emitDialogFinished(mTestWidget, SLOT(renameDialogFinished(HbAction *)), 0);
|
|
1073 |
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
|
39
|
1074 |
QCOMPARE(HbInputDialog::mOpenCallCount, 1);
|
38
|
1075 |
QVERIFY(HbInputDialog::mValueCallCount == 1);
|
|
1076 |
|
|
1077 |
// Item is video
|
|
1078 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1079 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeVideo));
|
|
1080 |
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
|
|
1081 |
HbInputDialog::mValueReturnValue = "";
|
|
1082 |
HbInputDialog::mValueCallCount = 0;
|
39
|
1083 |
HbInputDialog::mOpenCallCount = 0;
|
36
|
1084 |
data = QString("albumName");
|
|
1085 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
|
1086 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1087 |
emit testSignal();
|
|
1088 |
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
|
39
|
1089 |
QCOMPARE(HbInputDialog::mOpenCallCount, 0);
|
38
|
1090 |
QVERIFY(HbInputDialog::mValueCallCount == 0);
|
36
|
1091 |
|
|
1092 |
// No model
|
|
1093 |
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
|
38
|
1094 |
HbInputDialog::mValueReturnValue = "renamedVideo";
|
|
1095 |
HbInputDialog::mValueCallCount = 0;
|
39
|
1096 |
HbInputDialog::mOpenCallCount = 0;
|
36
|
1097 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1098 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
|
|
1099 |
data = QString("albumName");
|
|
1100 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
|
1101 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1102 |
VideoSortFilterProxyModel *tmp = mTestWidget->mModel;
|
|
1103 |
mTestWidget->mModel = 0;
|
|
1104 |
emit testSignal();
|
|
1105 |
mTestWidget->mModel = tmp;
|
|
1106 |
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
|
39
|
1107 |
QCOMPARE(HbInputDialog::mOpenCallCount, 0);
|
36
|
1108 |
|
|
1109 |
// Variant data is invalid
|
|
1110 |
VideoSortFilterProxyModelData::mLastAlbumNameInRename = "";
|
38
|
1111 |
HbInputDialog::mValueReturnValue = "renamedVideo";
|
|
1112 |
HbInputDialog::mValueCallCount = 0;
|
39
|
1113 |
HbInputDialog::mOpenCallCount = 0;
|
36
|
1114 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1115 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId(0, KVcxMvcMediaTypeAlbum));
|
|
1116 |
data = QVariant();
|
|
1117 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, data);
|
|
1118 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1119 |
emit testSignal();
|
|
1120 |
QVERIFY(VideoSortFilterProxyModelData::mLastAlbumNameInRename == "");
|
39
|
1121 |
QCOMPARE(HbInputDialog::mOpenCallCount, 0);
|
36
|
1122 |
|
30
|
1123 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(renameSlot()));
|
|
1124 |
}
|
|
1125 |
|
|
1126 |
// ---------------------------------------------------------------------------
|
36
|
1127 |
// testOpenItemSlot
|
35
|
1128 |
// ---------------------------------------------------------------------------
|
|
1129 |
//
|
36
|
1130 |
void TestListWidget::testOpenItemSlot()
|
35
|
1131 |
{
|
37
|
1132 |
// testEmitActivated has already tested the doEmitActivated functionality.
|
|
1133 |
// Just verify here, that the openItemSlot calls doEmitActivated.
|
|
1134 |
|
35
|
1135 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1136 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
35
|
1137 |
mTestWidget->initialize(*model);
|
36
|
1138 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(openItemSlot()));
|
35
|
1139 |
setRowCount(1);
|
|
1140 |
TMPXItemId savedId = TMPXItemId(1,1);
|
|
1141 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1142 |
VideoSortFilterProxyModelData::mItemIds.append(savedId);
|
|
1143 |
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1144 |
|
37
|
1145 |
// Making the context menu visible ensures that the doEmitActivated is called
|
|
1146 |
// instead of just emitActivated, as emitActivated does nothing if context menu
|
|
1147 |
// is already visible.
|
|
1148 |
if (!mTestWidget->mContextMenu)
|
|
1149 |
{
|
|
1150 |
mTestWidget->mContextMenu = new HbMenu;
|
|
1151 |
}
|
|
1152 |
mTestWidget->mContextMenu->show();
|
|
1153 |
|
35
|
1154 |
emit testSignal();
|
|
1155 |
|
|
1156 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == savedId);
|
|
1157 |
|
36
|
1158 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(openItemSlot()));
|
35
|
1159 |
}
|
|
1160 |
|
|
1161 |
// ---------------------------------------------------------------------------
|
37
|
1162 |
// testPlayItemSlot
|
|
1163 |
// ---------------------------------------------------------------------------
|
|
1164 |
//
|
|
1165 |
void TestListWidget::testPlayItemSlot()
|
|
1166 |
{
|
|
1167 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
|
1168 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
|
1169 |
mTestWidget->initialize(*model);
|
|
1170 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(playItemSlot()));
|
|
1171 |
setRowCount(1);
|
|
1172 |
TMPXItemId savedId = TMPXItemId(1,1);
|
|
1173 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1174 |
VideoSortFilterProxyModelData::mItemIds.append(savedId);
|
|
1175 |
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1176 |
|
|
1177 |
emit testSignal();
|
|
1178 |
|
|
1179 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == savedId);
|
|
1180 |
|
|
1181 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(playItemSlot()));
|
|
1182 |
}
|
|
1183 |
|
|
1184 |
// ---------------------------------------------------------------------------
|
30
|
1185 |
// testAddToCollectionSlot
|
|
1186 |
// ---------------------------------------------------------------------------
|
|
1187 |
//
|
|
1188 |
void TestListWidget::testAddToCollectionSlot()
|
|
1189 |
{
|
34
|
1190 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1191 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
1192 |
|
35
|
1193 |
VideoListSelectionDialogData::mSelectionType = -1;
|
|
1194 |
VideoListSelectionDialogData::mSettedMpxId = TMPXItemId::InvalidId();
|
|
1195 |
|
30
|
1196 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(addToCollectionSlot()));
|
35
|
1197 |
setRowCount(1);
|
|
1198 |
TMPXItemId savedId = TMPXItemId(1,1);
|
|
1199 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1200 |
VideoSortFilterProxyModelData::mItemIds.append(savedId);
|
|
1201 |
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1202 |
|
|
1203 |
// no model
|
30
|
1204 |
emit testSignal();
|
35
|
1205 |
QVERIFY(VideoListSelectionDialogData::mSelectionType == -1 );
|
|
1206 |
QVERIFY(VideoListSelectionDialogData::mSettedMpxId == TMPXItemId::InvalidId());
|
|
1207 |
|
|
1208 |
mTestWidget->initialize(*model);
|
|
1209 |
// dialog finding fails
|
|
1210 |
VideoCollectionUiLoaderData::mFindFailureNameList.append(DOCML_NAME_DIALOG);
|
|
1211 |
emit testSignal();
|
|
1212 |
QVERIFY(VideoListSelectionDialogData::mSelectionType == -1 );
|
|
1213 |
QVERIFY(VideoListSelectionDialogData::mSettedMpxId == TMPXItemId::InvalidId());
|
|
1214 |
VideoCollectionUiLoaderData::mFindFailureNameList.clear();
|
|
1215 |
|
|
1216 |
// invalid id at current index
|
|
1217 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1218 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId::InvalidId());
|
|
1219 |
emit testSignal();
|
|
1220 |
QVERIFY(VideoListSelectionDialogData::mSelectionType == -1 );
|
|
1221 |
QVERIFY(VideoListSelectionDialogData::mSettedMpxId == TMPXItemId::InvalidId());
|
|
1222 |
|
|
1223 |
// valid id at current index
|
|
1224 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1225 |
VideoSortFilterProxyModelData::mItemIds.append(savedId);
|
|
1226 |
emit testSignal();
|
|
1227 |
QVERIFY(VideoListSelectionDialogData::mSelectionType == VideoListSelectionDialog::ESelectCollection );
|
|
1228 |
QVERIFY(VideoListSelectionDialogData::mSettedMpxId == savedId);
|
|
1229 |
|
|
1230 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(addToCollectionSlot()));
|
|
1231 |
|
30
|
1232 |
}
|
|
1233 |
|
|
1234 |
// ---------------------------------------------------------------------------
|
35
|
1235 |
// testRemoveFromCollectionSlot
|
|
1236 |
// ---------------------------------------------------------------------------
|
|
1237 |
//
|
|
1238 |
void TestListWidget::testRemoveFromCollectionSlot()
|
|
1239 |
{
|
|
1240 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1241 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
35
|
1242 |
|
|
1243 |
VideoSortFilterProxyModelData::mRemoveItemsFromAlbumReturnValue = 0;
|
|
1244 |
VideoSortFilterProxyModelData::mLastItemId = TMPXItemId::InvalidId();
|
|
1245 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1246 |
|
|
1247 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(removeFromCollectionSlot()));
|
|
1248 |
setRowCount(2);
|
|
1249 |
TMPXItemId savedId = TMPXItemId(1,1);
|
|
1250 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1251 |
// invalid id at index 0
|
|
1252 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId::InvalidId());
|
|
1253 |
VideoSortFilterProxyModelData::mItemIds.append(savedId);
|
|
1254 |
HbListView::mCurrentIndex = model->index(1, 0, QModelIndex());
|
|
1255 |
|
|
1256 |
// no model
|
|
1257 |
emit testSignal();
|
|
1258 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
|
1259 |
|
|
1260 |
mTestWidget->initialize(*model);
|
|
1261 |
VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId::InvalidId();
|
|
1262 |
|
|
1263 |
// collection id is invalid
|
|
1264 |
emit testSignal();
|
|
1265 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
|
1266 |
VideoSortFilterProxyModelData::mOpenedItemId = TMPXItemId(1,2);
|
|
1267 |
|
|
1268 |
// media at current index is invalid
|
|
1269 |
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1270 |
emit testSignal();
|
|
1271 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId::InvalidId());
|
|
1272 |
|
|
1273 |
// all is ok
|
|
1274 |
HbListView::mCurrentIndex = model->index(1, 0, QModelIndex());
|
|
1275 |
emit testSignal();
|
|
1276 |
|
|
1277 |
QVERIFY(VideoSortFilterProxyModelData::mLastItemId == TMPXItemId(1,2));
|
|
1278 |
// ids are to be saved at VideoSortFilterProxyModelData::mItemIds
|
|
1279 |
QVERIFY(VideoSortFilterProxyModelData::mItemIds.at(0) == savedId);
|
|
1280 |
|
|
1281 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(removeFromCollectionSlot()));
|
|
1282 |
}
|
|
1283 |
|
|
1284 |
// ---------------------------------------------------------------------------
|
|
1285 |
// testRemoveCollectionSlot
|
|
1286 |
// ---------------------------------------------------------------------------
|
|
1287 |
//
|
|
1288 |
void TestListWidget::testRemoveCollectionSlot()
|
|
1289 |
{
|
|
1290 |
VideoSortFilterProxyModelData::mRemoveAlbumsFails = false;
|
|
1291 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1292 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
35
|
1293 |
|
|
1294 |
HbMessageBoxData::mQuestionReturnValue = true;
|
|
1295 |
HbMessageBoxData::mLatestTxt = "";
|
|
1296 |
VideoSortFilterProxyModelData::mLastIndex = QModelIndex();
|
|
1297 |
|
|
1298 |
setRowCount(1);
|
|
1299 |
HbListView::mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1300 |
|
|
1301 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(removeCollectionSlot()));
|
38
|
1302 |
HbMessageBox *box = new HbMessageBox();
|
35
|
1303 |
|
|
1304 |
setRowCount(2);
|
|
1305 |
TMPXItemId savedId = TMPXItemId(1,1);
|
|
1306 |
VideoSortFilterProxyModelData::mItemIds.clear();
|
|
1307 |
// invalid id at index 0
|
|
1308 |
VideoSortFilterProxyModelData::mItemIds.append(TMPXItemId::InvalidId());
|
|
1309 |
VideoSortFilterProxyModelData::mItemIds.append(savedId);
|
|
1310 |
HbListView::mCurrentIndex = model->index(1, 0, QModelIndex());
|
|
1311 |
|
|
1312 |
// no model
|
|
1313 |
emit testSignal();
|
|
1314 |
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
|
|
1315 |
QVERIFY(HbMessageBoxData::mLatestTxt.isEmpty());
|
|
1316 |
|
|
1317 |
mTestWidget->initialize(*model);
|
|
1318 |
|
|
1319 |
// invalid data
|
36
|
1320 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, QVariant());
|
35
|
1321 |
emit testSignal();
|
|
1322 |
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
|
|
1323 |
QVERIFY(HbMessageBoxData::mLatestTxt.isEmpty());
|
|
1324 |
|
|
1325 |
// valid data
|
36
|
1326 |
VideoListDataModelData::setData(VideoCollectionCommon::KeyTitle, "test");
|
35
|
1327 |
emit testSignal();
|
44
|
1328 |
box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(int)), HbMessageBox::Yes);
|
35
|
1329 |
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.isValid());
|
|
1330 |
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 1);
|
|
1331 |
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
|
|
1332 |
|
|
1333 |
// msg box return false (for coverity)
|
|
1334 |
VideoSortFilterProxyModelData::mLastIndex = QModelIndex();
|
|
1335 |
HbMessageBoxData::mLatestTxt = "";
|
|
1336 |
HbMessageBoxData::mQuestionReturnValue = false;
|
|
1337 |
emit testSignal();
|
44
|
1338 |
box->emitDialogFinished(mTestWidget, SLOT(removeCollectionDialogFinished(int)), HbMessageBox::No);
|
35
|
1339 |
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
|
|
1340 |
QVERIFY(!HbMessageBoxData::mLatestTxt.isEmpty());
|
|
1341 |
|
|
1342 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(removeCollectionSlot()));
|
|
1343 |
}
|
|
1344 |
|
|
1345 |
// ---------------------------------------------------------------------------
|
30
|
1346 |
// testOpenDetailsSlot
|
|
1347 |
// ---------------------------------------------------------------------------
|
|
1348 |
//
|
|
1349 |
void TestListWidget::testOpenDetailsSlot()
|
|
1350 |
{
|
34
|
1351 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1352 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
1353 |
|
30
|
1354 |
QSignalSpy spysignal(mTestWidget, SIGNAL(command(int)));
|
34
|
1355 |
HbMessageBoxData::mLatestTxt = "";
|
|
1356 |
VideoSortFilterProxyModelData::mLastIndex = QModelIndex();
|
|
1357 |
setRowCount(0);
|
|
1358 |
mTestWidget->initialize(*model);
|
30
|
1359 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(openDetailsSlot()));
|
|
1360 |
|
|
1361 |
// no model
|
|
1362 |
VideoSortFilterProxyModel *tmp = mTestWidget->mModel;
|
|
1363 |
mTestWidget->mModel = 0;
|
|
1364 |
emit testSignal();
|
|
1365 |
QVERIFY(spysignal.count() == 0);
|
34
|
1366 |
QVERIFY(!VideoSortFilterProxyModelData::mLastIndex.isValid());
|
30
|
1367 |
mTestWidget->mModel = tmp;
|
|
1368 |
|
|
1369 |
// detail fetch fails
|
34
|
1370 |
setRowCount(1);
|
30
|
1371 |
QVariant data = QString("test");
|
36
|
1372 |
VideoListDataModelData::setData(Qt::DisplayRole, data);
|
34
|
1373 |
mTestWidget->mCurrentIndex = model->index(0, 0, QModelIndex());
|
|
1374 |
VideoSortFilterProxyModelData::mDetailsReturnValue = -1;
|
30
|
1375 |
|
|
1376 |
emit testSignal();
|
|
1377 |
QVERIFY(spysignal.count() == 0);
|
34
|
1378 |
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 0);
|
30
|
1379 |
|
|
1380 |
// detail fetch succeeds
|
34
|
1381 |
VideoSortFilterProxyModelData::mDetailsReturnValue = 0;
|
|
1382 |
VideoSortFilterProxyModelData::mLastIndex = QModelIndex();
|
30
|
1383 |
emit testSignal();
|
|
1384 |
QVERIFY(spysignal.count() == 1);
|
|
1385 |
QVERIFY(spysignal.at(0).at(0).isValid());
|
|
1386 |
QVERIFY(spysignal.at(0).at(0).toInt() == MpxHbVideoCommon::ActivateVideoDetailsView);
|
34
|
1387 |
QVERIFY(VideoSortFilterProxyModelData::mLastIndex.row() == 0);
|
30
|
1388 |
|
|
1389 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(openDetailsSlot()));
|
|
1390 |
}
|
|
1391 |
|
|
1392 |
// ---------------------------------------------------------------------------
|
|
1393 |
// testBack
|
|
1394 |
// ---------------------------------------------------------------------------
|
|
1395 |
//
|
|
1396 |
void TestListWidget::testBack()
|
|
1397 |
{
|
34
|
1398 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1399 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
1400 |
|
41
|
1401 |
QSignalSpy spysignal(mTestWidget, SIGNAL(collectionOpened(bool, const QString&, const TMPXItemId&)));
|
30
|
1402 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(back()));
|
|
1403 |
// no model
|
|
1404 |
emit testSignal();
|
|
1405 |
QVERIFY(spysignal.count() == 0);
|
|
1406 |
|
|
1407 |
// model exist
|
34
|
1408 |
mTestWidget->initialize(*model);
|
30
|
1409 |
emit testSignal();
|
|
1410 |
QVERIFY(spysignal.count() == 1);
|
|
1411 |
QVERIFY(spysignal.value(0).at(0).isValid());
|
|
1412 |
QVERIFY(spysignal.value(0).at(0).toBool() == false);
|
|
1413 |
QVERIFY(spysignal.value(0).at(1).isValid());
|
|
1414 |
QVERIFY(spysignal.value(0).at(1).toString().isEmpty());
|
|
1415 |
|
|
1416 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(back()));
|
|
1417 |
}
|
35
|
1418 |
|
|
1419 |
// ---------------------------------------------------------------------------
|
|
1420 |
// testScrollingEndedSlot
|
|
1421 |
// ---------------------------------------------------------------------------
|
|
1422 |
//
|
|
1423 |
void TestListWidget::testScrollingStartedSlot()
|
|
1424 |
{
|
|
1425 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingStartedSlot()));
|
|
1426 |
|
|
1427 |
emit testSignal();
|
|
1428 |
|
|
1429 |
|
|
1430 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingStartedSlot()));
|
|
1431 |
}
|
|
1432 |
|
30
|
1433 |
// ---------------------------------------------------------------------------
|
|
1434 |
// testScrollingEndedSlot
|
|
1435 |
// ---------------------------------------------------------------------------
|
|
1436 |
//
|
|
1437 |
void TestListWidget::testScrollingEndedSlot()
|
|
1438 |
{
|
34
|
1439 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1440 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
1441 |
|
|
1442 |
mTestWidget->initialize(*model);
|
30
|
1443 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingEndedSlot()));
|
|
1444 |
|
|
1445 |
// no visible items
|
|
1446 |
HbListView::mVisibleItems.clear();
|
|
1447 |
emit testSignal();
|
44
|
1448 |
QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
|
|
1449 |
QVERIFY(VideoThumbnailTestData::mFetchIndex == 0);
|
30
|
1450 |
QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
|
|
1451 |
|
|
1452 |
// setup few "visible" items and make sure item count match at thumbnail data
|
|
1453 |
int count = 10;
|
34
|
1454 |
setRowCount(count);
|
30
|
1455 |
HbAbstractViewItem *item = 0;
|
|
1456 |
for(int i = 0; i < count; ++i)
|
|
1457 |
{
|
|
1458 |
item = new HbAbstractViewItem();
|
34
|
1459 |
item->mModelIndex = model->index(i, 0, QModelIndex());
|
30
|
1460 |
HbListView::mVisibleItems.append(item);
|
|
1461 |
}
|
|
1462 |
|
|
1463 |
// Test
|
|
1464 |
emit testSignal();
|
44
|
1465 |
QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 2);
|
30
|
1466 |
QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
|
|
1467 |
|
|
1468 |
// Test again when timer is null.
|
34
|
1469 |
VideoThumbnailTestData::mStartBackgroundFetchingCallCount = 0;
|
30
|
1470 |
QTimer *backup = mTestWidget->mScrollPositionTimer;
|
|
1471 |
mTestWidget->mScrollPositionTimer = 0;
|
|
1472 |
emit testSignal();
|
34
|
1473 |
QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
|
30
|
1474 |
mTestWidget->mScrollPositionTimer = backup;
|
|
1475 |
backup = 0;
|
|
1476 |
|
|
1477 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollingEndedSlot()));
|
|
1478 |
}
|
|
1479 |
|
|
1480 |
// ---------------------------------------------------------------------------
|
35
|
1481 |
// testScrollPositionChangedSlot
|
30
|
1482 |
// ---------------------------------------------------------------------------
|
|
1483 |
//
|
|
1484 |
void TestListWidget::testScrollPositionChangedSlot()
|
|
1485 |
{
|
34
|
1486 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
36
|
1487 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
34
|
1488 |
|
|
1489 |
mTestWidget->initialize(*model);
|
30
|
1490 |
const QPointF point;
|
|
1491 |
|
|
1492 |
connect(this, SIGNAL(testSignal(const QPointF&)), mTestWidget, SLOT(scrollPositionChangedSlot(const QPointF&)));
|
|
1493 |
|
|
1494 |
// Test
|
|
1495 |
emit testSignal(point);
|
|
1496 |
|
|
1497 |
// Test again when timer is running.
|
|
1498 |
mTestWidget->mScrollPositionTimer->start(1000*30);
|
|
1499 |
emit testSignal(point);
|
|
1500 |
|
|
1501 |
// Test when timer is null.
|
|
1502 |
QTimer *backup = mTestWidget->mScrollPositionTimer;
|
|
1503 |
mTestWidget->mScrollPositionTimer = 0;
|
|
1504 |
emit testSignal(point);
|
|
1505 |
mTestWidget->mScrollPositionTimer = backup;
|
|
1506 |
backup = 0;
|
|
1507 |
|
|
1508 |
disconnect(this, SIGNAL(testSignal(const QPointF&)), mTestWidget, SLOT(scrollPositionChangedSlot(const QPointF&)));
|
|
1509 |
}
|
|
1510 |
|
35
|
1511 |
void TestListWidget::testScrollPositionTimerSlot()
|
|
1512 |
{
|
|
1513 |
connect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollPositionTimerSlot()));
|
|
1514 |
emit testSignal();
|
|
1515 |
disconnect(this, SIGNAL(testSignal()), mTestWidget, SLOT(scrollPositionTimerSlot()));
|
44
|
1516 |
}
|
|
1517 |
|
|
1518 |
void TestListWidget::testRowsInsertedSlot()
|
|
1519 |
{
|
|
1520 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
|
1521 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
|
1522 |
|
|
1523 |
mTestWidget->initialize(*model);
|
|
1524 |
|
|
1525 |
// setup few "visible" items to trigger the fetch
|
|
1526 |
int count = 10;
|
|
1527 |
setRowCount(count);
|
|
1528 |
HbAbstractViewItem *item = 0;
|
|
1529 |
for(int i = 0; i < count; ++i)
|
|
1530 |
{
|
|
1531 |
item = new HbAbstractViewItem();
|
|
1532 |
item->mModelIndex = model->index(i, 0, QModelIndex());
|
|
1533 |
HbListView::mVisibleItems.append(item);
|
|
1534 |
}
|
|
1535 |
|
|
1536 |
// Test
|
|
1537 |
QModelIndex parent;
|
|
1538 |
mTestWidget->callRowsInserted(parent, 0, 0);
|
|
1539 |
QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
|
|
1540 |
QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
|
|
1541 |
}
|
|
1542 |
|
|
1543 |
void TestListWidget::testRowsRemovedSlot()
|
|
1544 |
{
|
|
1545 |
VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
|
|
1546 |
VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
|
|
1547 |
|
|
1548 |
mTestWidget->initialize(*model);
|
|
1549 |
|
|
1550 |
// setup few "visible" items to trigger the fetch
|
|
1551 |
int count = 10;
|
|
1552 |
setRowCount(count);
|
|
1553 |
HbAbstractViewItem *item = 0;
|
|
1554 |
for(int i = 0; i < count; ++i)
|
|
1555 |
{
|
|
1556 |
item = new HbAbstractViewItem();
|
|
1557 |
item->mModelIndex = model->index(i, 0, QModelIndex());
|
|
1558 |
HbListView::mVisibleItems.append(item);
|
|
1559 |
}
|
|
1560 |
|
|
1561 |
// Test
|
|
1562 |
QModelIndex parent;
|
|
1563 |
mTestWidget->callRowsRemoved(parent, 0, 0);
|
|
1564 |
QVERIFY(VideoThumbnailTestData::mStartBackgroundFetchingCallCount == 1);
|
|
1565 |
QVERIFY(!mTestWidget->mScrollPositionTimer->isActive());
|
35
|
1566 |
}
|
|
1567 |
|
30
|
1568 |
// end of file
|