videoplayback/videoplaybackview/tsrc/testdocumentloader/src/testdocumentloader.cpp
author hgs
Fri, 23 Jul 2010 11:10:06 +0300
changeset 49 824471cb468a
parent 44 518105d52e45
permissions -rw-r--r--
201029
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
hgs
parents:
diff changeset
     1
/**
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:   tester for methods in TestVideoPlaybackDocumentLoader
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
// Version : %version:  7 %
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
#include <qdebug>
hgs
parents:
diff changeset
    22
#include <qobject>
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
#include <hbmainwindow.h>
hgs
parents:
diff changeset
    25
#include <hbapplication.h>
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
#include "mpxvideo_debug.h"
hgs
parents:
diff changeset
    28
#include "videoplaybackcontrolscontroller.h"
hgs
parents:
diff changeset
    29
#include "testdocumentloader.h"
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
#define private public
hgs
parents:
diff changeset
    32
#include "videoplaybackdocumentloader.h"
hgs
parents:
diff changeset
    33
#undef private
hgs
parents:
diff changeset
    34
hgs
parents:
diff changeset
    35
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    36
// main
hgs
parents:
diff changeset
    37
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    38
//
hgs
parents:
diff changeset
    39
int main(int argc, char *argv[])
hgs
parents:
diff changeset
    40
{
hgs
parents:
diff changeset
    41
    MPX_ENTER_EXIT(_L("TestDocumentLoader::Main()"));
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
    HbApplication app(argc, argv);
hgs
parents:
diff changeset
    44
    HbMainWindow window;
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
    TestDocumentLoader tv;
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
    char *pass[3];
hgs
parents:
diff changeset
    49
    pass[0] = argv[0];
hgs
parents:
diff changeset
    50
    pass[1] = "-o";
hgs
parents:
diff changeset
    51
    pass[2] = "c:\\data\\testdocumentloader.txt";
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
    int res = QTest::qExec(&tv, 3, pass);
hgs
parents:
diff changeset
    54
hgs
parents:
diff changeset
    55
    return res;
hgs
parents:
diff changeset
    56
}
hgs
parents:
diff changeset
    57
hgs
parents:
diff changeset
    58
hgs
parents:
diff changeset
    59
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    60
// init
hgs
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    62
//
hgs
parents:
diff changeset
    63
void TestDocumentLoader::init()
hgs
parents:
diff changeset
    64
{
hgs
parents:
diff changeset
    65
    MPX_ENTER_EXIT(_L("TestDocumentLoader::init()"));
hgs
parents:
diff changeset
    66
hgs
parents:
diff changeset
    67
    mController = new VideoPlaybackControlsController();
hgs
parents:
diff changeset
    68
    mLoader = new VideoPlaybackDocumentLoader( mController );
hgs
parents:
diff changeset
    69
}
hgs
parents:
diff changeset
    70
hgs
parents:
diff changeset
    71
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    72
// cleanup
hgs
parents:
diff changeset
    73
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    74
//
hgs
parents:
diff changeset
    75
void TestDocumentLoader::cleanup()
hgs
parents:
diff changeset
    76
{
hgs
parents:
diff changeset
    77
    MPX_ENTER_EXIT(_L("TestDocumentLoader::cleanup()"));
hgs
parents:
diff changeset
    78
hgs
parents:
diff changeset
    79
    if ( mLoader )
hgs
parents:
diff changeset
    80
    {
hgs
parents:
diff changeset
    81
        delete mLoader;
hgs
parents:
diff changeset
    82
        mLoader = NULL;
hgs
parents:
diff changeset
    83
    }
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
    if ( mController )
hgs
parents:
diff changeset
    86
    {
hgs
parents:
diff changeset
    87
        delete mController;
hgs
parents:
diff changeset
    88
        mController = NULL;
hgs
parents:
diff changeset
    89
    }
hgs
parents:
diff changeset
    90
}
hgs
parents:
diff changeset
    91
hgs
parents:
diff changeset
    92
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    93
// testCreateObject
hgs
parents:
diff changeset
    94
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    95
//
hgs
parents:
diff changeset
    96
void TestDocumentLoader::testCreateObject()
hgs
parents:
diff changeset
    97
{
hgs
parents:
diff changeset
    98
    MPX_ENTER_EXIT(_L("TestDocumentLoader::testCreateObject()"));
hgs
parents:
diff changeset
    99
hgs
parents:
diff changeset
   100
    init();
hgs
parents:
diff changeset
   101
hgs
parents:
diff changeset
   102
    QObject *object = mLoader->createObject( "", "controlBarLayout" );
hgs
parents:
diff changeset
   103
    QVERIFY( object->objectName() == "controlBarLayout" );
hgs
parents:
diff changeset
   104
hgs
parents:
diff changeset
   105
    object = mLoader->createObject( "", "fileDetailsLayout" );
hgs
parents:
diff changeset
   106
    QVERIFY( object->objectName() == "fileDetailsLayout" );
hgs
parents:
diff changeset
   107
hgs
parents:
diff changeset
   108
    object = mLoader->createObject( "", "detailsPlaybackWindow" );
hgs
parents:
diff changeset
   109
    QVERIFY( object->objectName() == "detailsPlaybackWindow" );
hgs
parents:
diff changeset
   110
hgs
parents:
diff changeset
   111
    cleanup();
hgs
parents:
diff changeset
   112
}
hgs
parents:
diff changeset
   113
hgs
parents:
diff changeset
   114
// End of file