X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=qmafw-gst-subtitles-renderer%2Funittests%2Fut_MafwGstRendererWorker%2Fut_MafwGstRendererWorker.h;fp=qmafw-gst-subtitles-renderer%2Funittests%2Fut_MafwGstRendererWorker%2Fut_MafwGstRendererWorker.h;h=df7e87dc15bde2e3162ff60d09258f5c5fd8c7fd;hb=226d35244df85a27c332d3a3ded1b25b3c7f4951;hp=0000000000000000000000000000000000000000;hpb=57ba96e291a055f69dbfd4ae9f1ae2390e36986e;p=mafwsubrenderer diff --git a/qmafw-gst-subtitles-renderer/unittests/ut_MafwGstRendererWorker/ut_MafwGstRendererWorker.h b/qmafw-gst-subtitles-renderer/unittests/ut_MafwGstRendererWorker/ut_MafwGstRendererWorker.h new file mode 100644 index 0000000..df7e87d --- /dev/null +++ b/qmafw-gst-subtitles-renderer/unittests/ut_MafwGstRendererWorker/ut_MafwGstRendererWorker.h @@ -0,0 +1,111 @@ +/* + * This file is part of QMAFW + * + * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights + * reserved. + * + * Contact: Visa Smolander + * + * This software, including documentation, is protected by copyright controlled + * by Nokia Corporation. All rights are reserved. Copying, including + * reproducing, storing, adapting or translating, any or all of this material + * requires the prior written consent of Nokia Corporation. This material also + * contains confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * + */ + +#ifndef UT_MAFW_GST_RENDERER_WORKER_H_ +#define UT_MAFW_GST_RENDERER_WORKER_H_ + +#include +#include + +#include "mafw-gst-renderer-worker.h" + +class ut_MafwGstRendererWorker: public QObject +{ + Q_OBJECT + +private slots: // tests + + void basicPlaybackTestCase(); + void basicVideoPlaybackTestCase(); + void eosTestCase(); + void playAndPauseTestCase(); + void playAndStopTestCase(); + void setAndGetPropertiesTestCase(); + void gettersTestCase(); + void playAndPauseAndResumeTestCase(); + void pauseQuicklyAfterPlayTestCase(); + void pauseAtTestCase(); + void resumeDelayedTestCase(); + void getCurrentMetadataTestCase(); + void invalidUriTestCase(); + void seekTestCase(); + void defaultConfigurationTestCase(); + void configurabilityTestCase(); + void pauseFrameTestCase(); + void pauseFrameConfigurabilityTestCase(); + void pauseFrameCancelTestCase(); + void rendererArtTestCase(); + void bufferingTestCase(); + void mediaRouteTestCase(); + void setReadyTimeoutTestCase(); + void redirectMessageTestCase(); + + void initTestCase(); + void init(); + void cleanup(); + +protected slots: + void slotTimeOut(); + +protected: + static void playCallback(MafwGstRendererWorker *worker, gpointer owner); + static void eosCallback(MafwGstRendererWorker *worker, gpointer owner); + static void errorCallback(MafwGstRendererWorker *worker, + gpointer owner, + const GError *error); + static void pauseCallback(MafwGstRendererWorker *worker, gpointer owner); + static void propertyCallback(MafwGstRendererWorker *worker, + gpointer owner, + gint id, + GValue *value); + static void seekCallback(MafwGstRendererWorker *worker, gpointer owner); + static void metadataCallback(MafwGstRendererWorker *worker, + gpointer owner, + gint key, + GType type, + gpointer value); + static void bufferingCallback(MafwGstRendererWorker *worker, + gpointer owner, + gdouble percent); + static void blankingControlCallback(MafwGstRendererWorker *worker, + gpointer owner, gboolean prohibit); + static void screenshotCallback(MafwGstRendererWorker *worker, + gpointer owner, + GstBuffer *buffer, + const char *filename, + gboolean cancel); + + void waitForEvent(gint ms, bool &hasEventOccurred); + +private: //data + MafwGstRendererWorker *m_worker; + bool m_gotPlayCallback; + bool m_gotEosCallback; + bool m_gotErrorCallback; + bool m_gotPauseCallback; + bool m_gotSeekCallback; + bool m_gotMetadataCallback; + bool m_gotPropertyCallback; + bool m_gotBufferStatusCallback; + bool m_blankingProhibited; + int m_receivedErrorCode; + int m_receivedPropertyId; + gdouble m_receivedBufferStatus; + QList m_receivedMetadata; +}; + +#endif