44
|
1 |
/**
|
|
2 |
* Copyright (c) 2010 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 TestVideoPlaybackDocumentLoader
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// Version : %version: 7 %
|
|
19 |
|
|
20 |
|
|
21 |
#include <qdebug>
|
|
22 |
#include <qobject>
|
|
23 |
|
|
24 |
#include <hbmainwindow.h>
|
|
25 |
#include <hbapplication.h>
|
|
26 |
|
|
27 |
#include "mpxvideo_debug.h"
|
|
28 |
#include "videoplaybackcontrolscontroller.h"
|
|
29 |
#include "testdocumentloader.h"
|
|
30 |
|
|
31 |
#define private public
|
|
32 |
#include "videoplaybackdocumentloader.h"
|
|
33 |
#undef private
|
|
34 |
|
|
35 |
// ---------------------------------------------------------------------------
|
|
36 |
// main
|
|
37 |
// ---------------------------------------------------------------------------
|
|
38 |
//
|
|
39 |
int main(int argc, char *argv[])
|
|
40 |
{
|
|
41 |
MPX_ENTER_EXIT(_L("TestDocumentLoader::Main()"));
|
|
42 |
|
|
43 |
HbApplication app(argc, argv);
|
|
44 |
HbMainWindow window;
|
|
45 |
|
|
46 |
TestDocumentLoader tv;
|
|
47 |
|
|
48 |
char *pass[3];
|
|
49 |
pass[0] = argv[0];
|
|
50 |
pass[1] = "-o";
|
|
51 |
pass[2] = "c:\\data\\testdocumentloader.txt";
|
|
52 |
|
|
53 |
int res = QTest::qExec(&tv, 3, pass);
|
|
54 |
|
|
55 |
return res;
|
|
56 |
}
|
|
57 |
|
|
58 |
|
|
59 |
// ---------------------------------------------------------------------------
|
|
60 |
// init
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
//
|
|
63 |
void TestDocumentLoader::init()
|
|
64 |
{
|
|
65 |
MPX_ENTER_EXIT(_L("TestDocumentLoader::init()"));
|
|
66 |
|
|
67 |
mController = new VideoPlaybackControlsController();
|
|
68 |
mLoader = new VideoPlaybackDocumentLoader( mController );
|
|
69 |
}
|
|
70 |
|
|
71 |
// ---------------------------------------------------------------------------
|
|
72 |
// cleanup
|
|
73 |
// ---------------------------------------------------------------------------
|
|
74 |
//
|
|
75 |
void TestDocumentLoader::cleanup()
|
|
76 |
{
|
|
77 |
MPX_ENTER_EXIT(_L("TestDocumentLoader::cleanup()"));
|
|
78 |
|
|
79 |
if ( mLoader )
|
|
80 |
{
|
|
81 |
delete mLoader;
|
|
82 |
mLoader = NULL;
|
|
83 |
}
|
|
84 |
|
|
85 |
if ( mController )
|
|
86 |
{
|
|
87 |
delete mController;
|
|
88 |
mController = NULL;
|
|
89 |
}
|
|
90 |
}
|
|
91 |
|
|
92 |
// ---------------------------------------------------------------------------
|
|
93 |
// testCreateObject
|
|
94 |
// ---------------------------------------------------------------------------
|
|
95 |
//
|
|
96 |
void TestDocumentLoader::testCreateObject()
|
|
97 |
{
|
|
98 |
MPX_ENTER_EXIT(_L("TestDocumentLoader::testCreateObject()"));
|
|
99 |
|
|
100 |
init();
|
|
101 |
|
|
102 |
QObject *object = mLoader->createObject( "", "controlBarLayout" );
|
|
103 |
QVERIFY( object->objectName() == "controlBarLayout" );
|
|
104 |
|
|
105 |
object = mLoader->createObject( "", "fileDetailsLayout" );
|
|
106 |
QVERIFY( object->objectName() == "fileDetailsLayout" );
|
|
107 |
|
|
108 |
object = mLoader->createObject( "", "detailsPlaybackWindow" );
|
|
109 |
QVERIFY( object->objectName() == "detailsPlaybackWindow" );
|
|
110 |
|
|
111 |
cleanup();
|
|
112 |
}
|
|
113 |
|
|
114 |
// End of file
|