diff -r 17f382c040b1 -r 518105d52e45 videoplayback/videoplaybackview/tsrc/testdocumentloader/src/testdocumentloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayback/videoplaybackview/tsrc/testdocumentloader/src/testdocumentloader.cpp Thu Jul 08 13:05:19 2010 +0300 @@ -0,0 +1,114 @@ +/** +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: tester for methods in TestVideoPlaybackDocumentLoader +* +*/ + +// Version : %version: 7 % + + +#include +#include + +#include +#include + +#include "mpxvideo_debug.h" +#include "videoplaybackcontrolscontroller.h" +#include "testdocumentloader.h" + +#define private public +#include "videoplaybackdocumentloader.h" +#undef private + +// --------------------------------------------------------------------------- +// main +// --------------------------------------------------------------------------- +// +int main(int argc, char *argv[]) +{ + MPX_ENTER_EXIT(_L("TestDocumentLoader::Main()")); + + HbApplication app(argc, argv); + HbMainWindow window; + + TestDocumentLoader tv; + + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\data\\testdocumentloader.txt"; + + int res = QTest::qExec(&tv, 3, pass); + + return res; +} + + +// --------------------------------------------------------------------------- +// init +// --------------------------------------------------------------------------- +// +void TestDocumentLoader::init() +{ + MPX_ENTER_EXIT(_L("TestDocumentLoader::init()")); + + mController = new VideoPlaybackControlsController(); + mLoader = new VideoPlaybackDocumentLoader( mController ); +} + +// --------------------------------------------------------------------------- +// cleanup +// --------------------------------------------------------------------------- +// +void TestDocumentLoader::cleanup() +{ + MPX_ENTER_EXIT(_L("TestDocumentLoader::cleanup()")); + + if ( mLoader ) + { + delete mLoader; + mLoader = NULL; + } + + if ( mController ) + { + delete mController; + mController = NULL; + } +} + +// --------------------------------------------------------------------------- +// testCreateObject +// --------------------------------------------------------------------------- +// +void TestDocumentLoader::testCreateObject() +{ + MPX_ENTER_EXIT(_L("TestDocumentLoader::testCreateObject()")); + + init(); + + QObject *object = mLoader->createObject( "", "controlBarLayout" ); + QVERIFY( object->objectName() == "controlBarLayout" ); + + object = mLoader->createObject( "", "fileDetailsLayout" ); + QVERIFY( object->objectName() == "fileDetailsLayout" ); + + object = mLoader->createObject( "", "detailsPlaybackWindow" ); + QVERIFY( object->objectName() == "detailsPlaybackWindow" ); + + cleanup(); +} + +// End of file