videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackdocumentloader/src/testmpxvideoplaybackdocumentloader.cpp
changeset 15 cf5481c2bc0b
child 17 69946d1824c4
equal deleted inserted replaced
2:dec420019252 15:cf5481c2bc0b
       
     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 TestMPXVideoPlaybackDocumentLoader
       
    15 * 
       
    16 */
       
    17 
       
    18 // Version : %version:  2 %
       
    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 "mpxvideoplaybackcontrolscontroller.h"
       
    29 #include "testmpxvideoplaybackdocumentloader.h"
       
    30 
       
    31 #define private public
       
    32 #include "mpxvideoplaybackdocumentloader.h"
       
    33 #undef private
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // main
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 int main(int argc, char *argv[])
       
    40 {
       
    41     MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDocumentLoader::Main()"));
       
    42 
       
    43     HbApplication app(argc, argv);
       
    44     HbMainWindow window;
       
    45 
       
    46     TestMPXVideoPlaybackDocumentLoader tv;
       
    47 
       
    48     char *pass[3];
       
    49     pass[0] = argv[0];
       
    50     pass[1] = "-o";
       
    51     pass[2] = "c:\\data\\testmpxvideoplaybackdocumentloader.txt";
       
    52     
       
    53     int res = QTest::qExec(&tv, 3, pass);
       
    54     
       
    55     return res;
       
    56 }
       
    57 
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // init
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 void TestMPXVideoPlaybackDocumentLoader::init()
       
    64 {
       
    65     MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDocumentLoader::init()"));
       
    66 
       
    67     mController = new QMPXVideoPlaybackControlsController();
       
    68     mLoader = new QMPXVideoPlaybackDocumentLoader( mController );
       
    69 }
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 // cleanup
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 void TestMPXVideoPlaybackDocumentLoader::cleanup()
       
    76 {
       
    77     MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDocumentLoader::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 TestMPXVideoPlaybackDocumentLoader::testCreateObject()
       
    97 {
       
    98     MPX_ENTER_EXIT(_L("TestMPXVideoPlaybackDocumentLoader::testCreateObject()"));
       
    99 
       
   100     init();
       
   101 
       
   102     QObject *object = mLoader->createObject( "", "controlBarLayout" );
       
   103     QVERIFY( object->objectName() == "controlBarLayout" );
       
   104 
       
   105     object = mLoader->createObject( "", "buttonBarLayout" );
       
   106     QVERIFY( object->objectName() == "buttonBarLayout" );
       
   107 
       
   108     object = mLoader->createObject( "", "progressBarLayout" );
       
   109     QVERIFY( object->objectName() == "progressBarLayout" );
       
   110 
       
   111     object = mLoader->createObject( "", "fileDetailsLayout" );
       
   112     QVERIFY( object->objectName() == "fileDetailsLayout" );
       
   113 
       
   114     object = mLoader->createObject( "", "volumeSlider" );
       
   115     QVERIFY( object->objectName() == "volumeSlider" );
       
   116 
       
   117     object = mLoader->createObject( "", "detailsPlaybackWindow" );
       
   118     QVERIFY( object->objectName() == "detailsPlaybackWindow" );
       
   119 
       
   120     cleanup();
       
   121 }
       
   122 
       
   123 // End of file