34
|
1 |
|
|
2 |
/**
|
|
3 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
* All rights reserved.
|
|
5 |
* This component and the accompanying materials are made available
|
|
6 |
* under the terms of "Eclipse Public License v1.0"
|
|
7 |
* which accompanies this distribution, and is available
|
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
9 |
*
|
|
10 |
* Initial Contributors:
|
|
11 |
* Nokia Corporation - initial contribution.
|
|
12 |
*
|
|
13 |
* Contributors:
|
|
14 |
*
|
|
15 |
* Description: tester for methods in CVideoCollectionListener
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef __TESTVIDEOCOLLECTIONLISTENER_H__
|
|
20 |
#define __TESTVIDEOCOLLECTIONLISTENER_H__
|
|
21 |
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <QtTest/QtTest>
|
|
25 |
#include "stub/inc/videocollectionclient.h"
|
|
26 |
|
|
27 |
class StubSignalReceiver;
|
|
28 |
class StubCollection;
|
|
29 |
class VideoCollectionListener;
|
|
30 |
class VideoCollectionClient;
|
|
31 |
class MediaObjectFactory;
|
|
32 |
|
|
33 |
class TestVideoCollectionListener : public QObject
|
|
34 |
{
|
|
35 |
Q_OBJECT
|
|
36 |
|
|
37 |
// test functions for the test framework
|
|
38 |
private slots:
|
|
39 |
|
|
40 |
|
|
41 |
/**
|
|
42 |
* called before anything else when test starts
|
|
43 |
*/
|
|
44 |
void initTestCase();
|
|
45 |
|
|
46 |
/**
|
|
47 |
* will be called before each testfunction is executed.
|
|
48 |
*
|
|
49 |
*/
|
|
50 |
void init();
|
|
51 |
|
|
52 |
/**
|
|
53 |
* will be called after every testfunction.
|
|
54 |
*
|
|
55 |
*/
|
|
56 |
void cleanup();
|
|
57 |
|
|
58 |
/**
|
|
59 |
* will be called after testing ends
|
|
60 |
*
|
|
61 |
*/
|
|
62 |
void cleanupTestCase();
|
|
63 |
|
|
64 |
/**
|
|
65 |
* verifies HandleCollectionMediaL
|
|
66 |
*/
|
|
67 |
void testHandleCollectionMediaLFunc();
|
|
68 |
|
|
69 |
/**
|
|
70 |
* verifies HandleOpenL with param
|
|
71 |
* - const CMPXMedia&
|
|
72 |
* - TInt
|
|
73 |
* - TBool
|
|
74 |
* - TInt
|
|
75 |
*/
|
|
76 |
void testHandleOpenLMediaFunc();
|
|
77 |
|
|
78 |
/**
|
|
79 |
* verifies HandleOpenL with param
|
|
80 |
* - const CMPXCollectionPlaylist&
|
|
81 |
* - TInt
|
|
82 |
*/
|
|
83 |
void testHandleOpenLPlaylistFunc();
|
|
84 |
|
|
85 |
/**
|
36
|
86 |
* verifies HandleCommandComplete with invalid
|
|
87 |
* params
|
34
|
88 |
*/
|
36
|
89 |
void testHandleCommandCompleteInvalid();
|
|
90 |
|
|
91 |
/**
|
|
92 |
* verifies HandleCommandComplete (and handleGetVideoDetailsResp) for
|
|
93 |
* KVcxCommandMyVideosGetMediaFullDetailsByMpxId command
|
|
94 |
*/
|
|
95 |
void testHandleCommandCompleteGetDetails();
|
|
96 |
|
|
97 |
/**
|
|
98 |
* verifies HandleCommandComplete for
|
|
99 |
* KVcxCommandMyVideosRemoveAlbums command
|
|
100 |
*/
|
|
101 |
void testHandleCommandCompleteRemoveAlbums();
|
34
|
102 |
|
|
103 |
/**
|
|
104 |
* verifies HandleCollectionMessage
|
|
105 |
* error case, empty message
|
|
106 |
*/
|
|
107 |
void testCollectionMessageError();
|
|
108 |
|
|
109 |
/**
|
|
110 |
* verifies HandleCollectionMessage during
|
|
111 |
* collection openening phase
|
|
112 |
*/
|
|
113 |
void testCollectionMessageNotOpened();
|
|
114 |
|
|
115 |
/**
|
|
116 |
* verifies HandleCollectionMessage when
|
|
117 |
* collection has opened and
|
|
118 |
* receiving message id == KVcxCommandIdMyVideos
|
|
119 |
*/
|
|
120 |
void testCollectionMessageMyVidCommandId();
|
|
121 |
|
|
122 |
/**
|
|
123 |
* verifies handleMyVideosMessageArray method
|
|
124 |
* collection has opened and
|
|
125 |
* receiving message id == KVcxCommandIdMyVideos and
|
|
126 |
* KVcxMediaMyVideosCommandId == KVcxMessageMyVideosMessageArray
|
|
127 |
*/
|
|
128 |
void testHandleMyVideosMessageArray();
|
|
129 |
|
|
130 |
/**
|
|
131 |
* verifies handleMyVideosMPXMessage method
|
|
132 |
* collection has opened and
|
|
133 |
* receiving message id == KVcxCommandIdMyVideos and
|
|
134 |
* KVcxMediaMyVideosCommandId != KVcxMessageMyVideosMessageArray
|
|
135 |
*/
|
|
136 |
void testHandleMyVideosMPXMessage();
|
|
137 |
|
|
138 |
/**
|
|
139 |
* verifies handleMyVideosMPXMessage method
|
|
140 |
* collection has opened and
|
|
141 |
* receiving message id == KVcxCommandIdMyVideos and
|
|
142 |
* KVcxMediaMyVideosCommandId == KVcxMessageMyVideosDeleteResp
|
|
143 |
*/
|
|
144 |
void testMyVideosDeleteMsgArray();
|
|
145 |
|
|
146 |
/**
|
|
147 |
* verifies handleMPXMessage method
|
|
148 |
* collection has opened and
|
|
149 |
* receiving message id != KVcxCommandIdMyVideos
|
|
150 |
*/
|
|
151 |
void testHandleMPXMessage();
|
|
152 |
|
|
153 |
private:
|
|
154 |
|
|
155 |
/**
|
|
156 |
* testobject
|
|
157 |
*/
|
|
158 |
VideoCollectionListener *mTestObject;
|
|
159 |
|
|
160 |
/**
|
|
161 |
* stub collection client
|
|
162 |
*/
|
|
163 |
VideoCollectionClient *mStubCollectionClient;
|
|
164 |
|
|
165 |
/**
|
|
166 |
* stub collection
|
|
167 |
*/
|
|
168 |
StubCollection *mStubCollection;
|
|
169 |
|
|
170 |
/**
|
|
171 |
* media object factory
|
|
172 |
*/
|
|
173 |
MediaObjectFactory *mMediaFactory;
|
|
174 |
|
|
175 |
/**
|
|
176 |
* stubbed signal receiver
|
|
177 |
*/
|
|
178 |
StubSignalReceiver *mSignalReceiver;
|
|
179 |
|
|
180 |
|
|
181 |
};
|
|
182 |
|
|
183 |
|
|
184 |
|
|
185 |
|
|
186 |
#endif // __TESTVIDEOCOLLECTIONWRAPPER_H__
|
|
187 |
|
|
188 |
// End of file
|
|
189 |
|
|
190 |
|
|
191 |
|