Added qmafw-gst-subtitles-renderer-0.0.55 for Meego Harmattan 1.2
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / unittests / ut_MafwGstRendererWorker / ut_MafwGstRendererWorker.h
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 (file)
index 0000000..df7e87d
--- /dev/null
@@ -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 <visa.smolander@nokia.com>
+ *
+ * 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 <QObject>
+#include <QtTest/QtTest>
+
+#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<int> m_receivedMetadata;
+};
+
+#endif