videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/inc/testvideoplayerengine.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 23 Jun 2010 18:14:16 +0300
changeset 46 adbe7d5ba2f5
parent 17 69946d1824c4
child 44 518105d52e45
permissions -rw-r--r--
Revision: 201023 Kit: 2010125

/*
* Copyright (c) 2009 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:  Videoplayerengine test class declaration.
*
*/

// TODO: at the moment we are not able to get access to all private methods
//       to the class under test. We need to declare some own framework in order
//       to declare testclasses into friends of classes under test etc.
//
//      missing test functions:
//      - how to setup construction to fail for testing purposes


// Version : %version: 8 %

#ifndef __TESTVIDEOPLAYERENGINE_H__
#define __TESTVIDEOPLAYERENGINE_H__


// INCLUDES
#include <QtTest/QtTest>
#include <qpointer.h>

class MpxViewPlugin;
class QMpxVideoPlaybackWrapper;
class QVideoPlayerEngine;
class VideoServices;

class TestVideoPlayerEngine : public QObject
	{

    Q_OBJECT

public: // Constructor / destructor

    /**
     * Contructor.
     *
     */
	TestVideoPlayerEngine();

    /**
     * Destructor.
     *
     */
    virtual ~TestVideoPlayerEngine();

private slots:

    void init(bool isService = false);
    void cleanup();

    void testCreateDelete();
    void testCreateDeleteService();

    void testInitialize();
    void testInitializeService();
    
    void testMultipleInitialize();
    void testMultipleInitializeService();

    void testHandleCommandPreInit();
    void testHandleCommandPostInit();
    void testHandleCommandPreAndPostInit();

    void testHandleCommandPluginFail();
    void testHandleCommandPluginFail1();
    void testHandleCommandPluginFail2();
    
    void testPlayMedia();
    void testSetEmbedded();
    
    void testInitWithActivityData();
    void testHandleQuitWihtActivityData();

    // called after last test case executed
    void cleanupTestCase();

signals:

    void aboutToQuit();
    void command( int );

private:

    QPointer<QVideoPlayerEngine>  mTestObject;

    MpxViewPlugin*            mCurrentViewPlugin;
    MpxViewPlugin*            mPlaybackViewPlugin;
    MpxViewPlugin*            mCollectionViewPlugin;
    MpxViewPlugin*            mFileDetailsViewPlugin;

    VideoServices*            mVideoServices;
    
    QMpxVideoPlaybackWrapper *mPlaybackWrapper;

};

#endif  // __TESTVIDEOPLAYERENGINE_H__

// End of file