40
|
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: TestVideoSettingsPlugin class implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include <QtTest/QtTest>
|
|
20 |
#include <qdebug.h>
|
|
21 |
#include <hbapplication.h>
|
|
22 |
#include <cpitemdatahelper.h>
|
|
23 |
|
|
24 |
#include "videosettingsgroup.h"
|
|
25 |
#include "testvideosettingsplugin.h"
|
|
26 |
|
|
27 |
// trick to get access to protected/private members.
|
|
28 |
#define private public
|
|
29 |
#include "videosettingsplugin.h"
|
|
30 |
#undef private
|
|
31 |
|
|
32 |
// ---------------------------------------------------------------------------
|
|
33 |
// initTestCase
|
|
34 |
// ---------------------------------------------------------------------------
|
|
35 |
//
|
|
36 |
void TestVideoSettingsPlugin::initTestCase()
|
|
37 |
{
|
|
38 |
mItemHelper = new CpItemDataHelper;
|
|
39 |
}
|
|
40 |
|
|
41 |
// ---------------------------------------------------------------------------
|
|
42 |
// cleanupTestCase
|
|
43 |
// ---------------------------------------------------------------------------
|
|
44 |
//
|
|
45 |
void TestVideoSettingsPlugin::cleanupTestCase()
|
|
46 |
{
|
|
47 |
delete mItemHelper;
|
|
48 |
mItemHelper = 0;
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
// init
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
void TestVideoSettingsPlugin::init()
|
|
56 |
{
|
|
57 |
mPlugin = new VideoSettingsPlugin();
|
|
58 |
}
|
|
59 |
|
|
60 |
// ---------------------------------------------------------------------------
|
|
61 |
// cleanup
|
|
62 |
// ---------------------------------------------------------------------------
|
|
63 |
//
|
|
64 |
void TestVideoSettingsPlugin::cleanup()
|
|
65 |
{
|
|
66 |
delete mPlugin;
|
|
67 |
mPlugin = 0;
|
|
68 |
}
|
|
69 |
|
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
// testCreateSettingFormItemData
|
|
72 |
// ---------------------------------------------------------------------------
|
|
73 |
//
|
|
74 |
void TestVideoSettingsPlugin::testCreateSettingFormItemData()
|
|
75 |
{
|
|
76 |
QList<CpSettingFormItemData*> list = mPlugin->createSettingFormItemData(*mItemHelper);
|
|
77 |
QCOMPARE( list.count(), 1 );
|
|
78 |
VideoSettingsGroup* group = static_cast<VideoSettingsGroup*>(list.at(0));
|
|
79 |
QVERIFY( group );
|
|
80 |
QVERIFY( &(group->mItemDataHelper) == mItemHelper );
|
|
81 |
}
|
|
82 |
|
|
83 |
// ---------------------------------------------------------------------------
|
|
84 |
// main
|
|
85 |
// ---------------------------------------------------------------------------
|
|
86 |
//
|
|
87 |
int main(int argc, char *argv[])
|
|
88 |
{
|
|
89 |
HbApplication app(argc, argv);
|
|
90 |
/* HbApplication::setKeypadNavigationEnabled(false);
|
|
91 |
HbMainWindow mainWindow;
|
|
92 |
mainWindow.show();*/
|
|
93 |
|
|
94 |
TestVideoSettingsPlugin tc;
|
|
95 |
|
|
96 |
char *pass[3];
|
|
97 |
pass[0] = argv[0];
|
|
98 |
pass[1] = "-o";
|
|
99 |
pass[2] = "c:\\data\\testvideosettingsplugin.txt";
|
|
100 |
|
|
101 |
return QTest::qExec(&tc, 3, pass);
|
|
102 |
}
|
|
103 |
|
|
104 |
// end of file
|