equal
deleted
inserted
replaced
18 #include <QSignalSpy> |
18 #include <QSignalSpy> |
19 #include <qnamespace.h> |
19 #include <qnamespace.h> |
20 #include <hbapplication.h> |
20 #include <hbapplication.h> |
21 #include <hbmainwindow.h> |
21 #include <hbmainwindow.h> |
22 #include <hbInstance.h> |
22 #include <hbInstance.h> |
|
23 #include <hbicon.h> |
23 |
24 |
24 #include "unittest_mpplaybackdata.h" |
25 #include "unittest_mpplaybackdata.h" |
25 #include "stub/inc/thumbnailmanager_qt.h" |
26 #include "stub/inc/thumbnailmanager_qt.h" |
26 |
27 |
27 |
28 |
99 { |
100 { |
100 QVERIFY(mTest->mThumbnailManager != 0); |
101 QVERIFY(mTest->mThumbnailManager != 0); |
101 QCOMPARE(mTest->mThumbnailManager->getInitCounter(), 1); |
102 QCOMPARE(mTest->mThumbnailManager->getInitCounter(), 1); |
102 QVERIFY(mTest->mDuration == 0); |
103 QVERIFY(mTest->mDuration == 0); |
103 QVERIFY(mTest->mPosition == 0); |
104 QVERIFY(mTest->mPosition == 0); |
104 QVERIFY(!mTest->mDefaultAlbumArt); |
105 QVERIFY(mTest->mDefaultAlbumArt != 0); |
105 |
106 |
106 } |
107 } |
107 |
108 |
108 /*! |
109 /*! |
109 test setDuration and duration |
110 test setDuration and duration |
265 { |
266 { |
266 void* temp; |
267 void* temp; |
267 temp=0; |
268 temp=0; |
268 QSignalSpy spy(mTest, SIGNAL(albumArtReady())); |
269 QSignalSpy spy(mTest, SIGNAL(albumArtReady())); |
269 QPixmap albumArt(100,100); |
270 QPixmap albumArt(100,100); |
270 QPixmap albumArt2; |
271 HbIcon albumArtIcon; |
271 |
272 |
272 //Error |
273 //Error |
273 mTest->thumbnailReady(albumArt,temp,KUndefined,KUndefined); |
274 mTest->thumbnailReady(albumArt,temp,KUndefined,KUndefined); |
274 QCOMPARE(mTest->mAlbumArt, mTest->mDefaultAlbumArt); |
275 QCOMPARE(mTest->mAlbumArt, mTest->mDefaultAlbumArt); |
275 QCOMPARE(mTest->mReqId, KUndefined); |
276 QCOMPARE(mTest->mReqId, KUndefined); |
287 //Update album art |
288 //Update album art |
288 mTest->mReqId = 1; |
289 mTest->mReqId = 1; |
289 mTest->thumbnailReady(albumArt,temp,1,0); |
290 mTest->thumbnailReady(albumArt,temp,1,0); |
290 QCOMPARE(mTest->mReqId, KUndefined); |
291 QCOMPARE(mTest->mReqId, KUndefined); |
291 QCOMPARE(spy.count(),1); |
292 QCOMPARE(spy.count(),1); |
292 mTest->albumArt(albumArt2); |
293 mTest->albumArt(albumArtIcon); |
293 QCOMPARE(albumArt,albumArt2); |
294 QVERIFY(!albumArtIcon.isNull()); |
|
295 } |
|
296 |
|
297 /*! |
|
298 test SeAlbumId and albumId |
|
299 */ |
|
300 void TestMpPlaybackData::testSeAlbumId() |
|
301 { |
|
302 mTest->setAlbumId(65535); |
|
303 QCOMPARE(mTest->mAlbumId, 65535); |
|
304 QCOMPARE(mTest->albumId(), 65535); |
294 } |
305 } |
295 |
306 |
296 /*! |
307 /*! |
297 test setPlaybackState and playbackState |
308 test setPlaybackState and playbackState |
298 */ |
309 */ |