73
|
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: Item decorator of the message list view.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "unittest_msgaudiopreview.h"
|
|
19 |
#include <QtTest/QtTest>
|
|
20 |
#include <HbMainWindow>
|
|
21 |
#include <XQConversions>
|
|
22 |
#include "msguitest.h"
|
|
23 |
|
|
24 |
#include <audiopreference.h>
|
|
25 |
TestMsgAudioPreview::TestMsgAudioPreview()
|
|
26 |
{
|
|
27 |
|
|
28 |
}
|
|
29 |
TestMsgAudioPreview::~TestMsgAudioPreview()
|
|
30 |
{
|
|
31 |
|
|
32 |
}
|
|
33 |
|
|
34 |
void TestMsgAudioPreview::initTestCase()
|
|
35 |
{
|
|
36 |
mMsgAudioPreview = new MsgAudioPreview(this);
|
|
37 |
QVERIFY(mMsgAudioPreview != NULL);
|
|
38 |
}
|
|
39 |
|
|
40 |
void TestMsgAudioPreview::test_Constructor()
|
|
41 |
{
|
|
42 |
QVERIFY(mMsgAudioPreview->iMediaType == KErrNotFound);
|
|
43 |
QVERIFY(mMsgAudioPreview->iRingingVolume == KErrNotFound);
|
|
44 |
QVERIFY(mMsgAudioPreview->iRingingType == KErrNotFound);
|
|
45 |
QVERIFY(mMsgAudioPreview->iVibra == KErrNotFound);
|
|
46 |
QVERIFY(mMsgAudioPreview->i3DEffect == KErrNotFound);
|
|
47 |
QVERIFY(mMsgAudioPreview->i3DEcho == KErrNotFound);
|
|
48 |
QVERIFY(mMsgAudioPreview->iFileSize == KErrNotFound);
|
|
49 |
QVERIFY(mMsgAudioPreview->iFullName == 0);
|
|
50 |
QVERIFY(mMsgAudioPreview->iActiveProfileRead == EFalse);
|
|
51 |
QVERIFY(mMsgAudioPreview->iPlayerStatus == MsgAudioPreview::EPlayerNotCreated);
|
|
52 |
QVERIFY(mMsgAudioPreview->iAudioPlayerStatus == MsgAudioPreview::EPlayerNotCreated);
|
|
53 |
QVERIFY(mMsgAudioPreview->iTonePlayerStatus == MsgAudioPreview::EPlayerNotCreated);
|
|
54 |
}
|
|
55 |
|
|
56 |
void TestMsgAudioPreview::test_PlayL_IsPlaying()
|
|
57 |
{
|
|
58 |
QString str("c:\\data\\testAudioFetcher\\drm.amr");
|
|
59 |
mMsgAudioPreview->SetAttr(str);
|
|
60 |
QVERIFY(XQConversions::s60DescToQString( mMsgAudioPreview->iFullName->Des()) == str);
|
|
61 |
mMsgAudioPreview->Play();
|
|
62 |
QVERIFY(mMsgAudioPreview->IsPlaying() == true);
|
|
63 |
}
|
|
64 |
|
|
65 |
void TestMsgAudioPreview::test_Stop()
|
|
66 |
{
|
|
67 |
mMsgAudioPreview->Stop();
|
|
68 |
QVERIFY(mMsgAudioPreview->iAudioPlayer == 0);
|
|
69 |
QVERIFY(mMsgAudioPreview->iAudioPlayerStatus == MsgAudioPreview::EPlayerNotCreated);
|
|
70 |
QVERIFY(mMsgAudioPreview->iTonePlayer == 0);
|
|
71 |
QVERIFY(mMsgAudioPreview->iTonePlayerStatus == MsgAudioPreview::EPlayerNotCreated);
|
|
72 |
}
|
|
73 |
|
|
74 |
|
|
75 |
void TestMsgAudioPreview::cleanupTestCase()
|
|
76 |
{
|
|
77 |
if(mMsgAudioPreview)
|
|
78 |
{
|
|
79 |
delete mMsgAudioPreview;
|
|
80 |
}
|
|
81 |
}
|
|
82 |
MSGUI_TEST_MAIN(TestMsgAudioPreview)
|