63
|
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 VideoListToolbar
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __TESTLISTTOOLBAR_H__
|
|
19 |
#define __TESTLISTTOOLBAR_H__
|
|
20 |
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <QtTest/QtTest>
|
|
24 |
#include <qlist.h>
|
|
25 |
|
|
26 |
class VideoListToolbar;
|
|
27 |
class VideoListView;
|
|
28 |
class VideoCollectionUiLoader;
|
|
29 |
class VideoProxyModelGeneric;
|
|
30 |
class QAction;
|
|
31 |
class HbToolBarExtension;
|
|
32 |
|
|
33 |
class TestListToolbar : public QObject
|
|
34 |
{
|
|
35 |
Q_OBJECT
|
|
36 |
|
|
37 |
private slots:
|
|
38 |
|
|
39 |
/**
|
|
40 |
* called automatically before anything else when test starts
|
|
41 |
*/
|
|
42 |
void initTestCase();
|
|
43 |
|
|
44 |
/**
|
|
45 |
* will be called automatically before each testfunction is executed.
|
|
46 |
*/
|
|
47 |
void init();
|
|
48 |
|
|
49 |
/**
|
|
50 |
* will be called automatically after every testfunction.
|
|
51 |
*/
|
|
52 |
void cleanup();
|
|
53 |
|
|
54 |
/**
|
|
55 |
* will be called automatically after testing ends
|
|
56 |
*/
|
|
57 |
void cleanupTestCase();
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Tests initializing normal toolbar
|
|
61 |
*/
|
|
62 |
void testInitialize();
|
|
63 |
|
|
64 |
/**
|
|
65 |
* Test initializing service
|
|
66 |
*/
|
|
67 |
void testInitializeService();
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Test viewStateChanged -slot,
|
|
71 |
* No service extension, stand alone
|
|
72 |
*/
|
|
73 |
void testViewStateChanged();
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Test viewStateChanged -slot,
|
|
77 |
* service application
|
|
78 |
*/
|
|
79 |
void testViewStateChangedService();
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Test viewStateChanged -slot,
|
|
83 |
* with service extension, stand alone
|
|
84 |
*/
|
|
85 |
void testViewStateChangedWithServiceExt();
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Tests addVideosToCollectionSlot
|
|
89 |
*/
|
|
90 |
void testAddVideosToCollectionSlot();
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Tests removeVideosFromCollectionSlot
|
|
94 |
*/
|
|
95 |
void testRemoveVideosFromCollectionSlot();
|
|
96 |
|
|
97 |
private slots:
|
|
98 |
|
|
99 |
/**
|
|
100 |
* slot can be conected to VideoListToolbar::actionsChanged signal,
|
|
101 |
* will save provided qlist into mLastChangedActions
|
|
102 |
*/
|
|
103 |
void testActionsChangedSlot(QList<QAction*>);
|
|
104 |
|
|
105 |
/**
|
|
106 |
* slot can be conected to VideoListToolbar::toolbarExtensionChanged signal,
|
|
107 |
* will save provided HbToolBarExtension into
|
|
108 |
*/
|
|
109 |
void testToolbarExtensionChangedSlot(HbToolBarExtension*);
|
|
110 |
|
|
111 |
private:
|
|
112 |
|
|
113 |
/**
|
|
114 |
* sets provided row count to provided model
|
|
115 |
*/
|
|
116 |
void setRowCount(int count, VideoProxyModelGeneric *model);
|
|
117 |
|
|
118 |
/**
|
|
119 |
* object under test
|
|
120 |
*/
|
|
121 |
VideoListToolbar *mTestObject;
|
|
122 |
|
|
123 |
/**
|
|
124 |
* stub listview
|
|
125 |
*/
|
|
126 |
VideoListView *mStubListView;
|
|
127 |
|
|
128 |
/**
|
|
129 |
* stub -uiloader
|
|
130 |
*/
|
|
131 |
VideoCollectionUiLoader *mStubUiLoader;
|
|
132 |
|
|
133 |
/**
|
|
134 |
* generic model
|
|
135 |
*/
|
|
136 |
VideoProxyModelGeneric *mStubModel;
|
|
137 |
|
|
138 |
/**
|
|
139 |
* actions provided to testActionsChangedSlot will be saved here
|
|
140 |
*/
|
|
141 |
QList<QAction*> mLastChangedActions;
|
|
142 |
|
|
143 |
/**
|
|
144 |
* extension provided to testToolbarExtensionChangedSlot will
|
|
145 |
* be saved here
|
|
146 |
*/
|
|
147 |
HbToolBarExtension* mLastChangedExtension;
|
|
148 |
|
|
149 |
};
|
|
150 |
|
|
151 |
|
|
152 |
#endif // __TESTCOLLECTIONVIEW_H__
|
|
153 |
|
|
154 |
// End of file
|
|
155 |
|