Added DUI control panel applet
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / unittests / ut_MafwGstRendererWorker / ut_MafwGstRendererWorker.h
1 /* 
2  * This file is part of QMAFW 
3  *
4  * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights
5  * reserved.
6  *
7  * Contact: Visa Smolander <visa.smolander@nokia.com>
8  *
9  * This software, including documentation, is protected by copyright controlled
10  * by Nokia Corporation. All rights are reserved. Copying, including
11  * reproducing, storing, adapting or translating, any or all of this material
12  * requires the prior written consent of Nokia Corporation. This material also
13  * contains confidential information which may not be disclosed to others
14  * without the prior written consent of Nokia.
15  *
16  */
17  
18 #ifndef UT_MAFW_GST_RENDERER_WORKER_H_
19 #define UT_MAFW_GST_RENDERER_WORKER_H_
20
21 #include <QObject>
22 #include <QtTest/QtTest>
23
24 #include "mafw-gst-renderer-worker.h"
25
26 class ut_MafwGstRendererWorker: public QObject
27 {
28     Q_OBJECT
29
30 private slots: // tests
31
32     void basicPlaybackTestCase();
33     void basicVideoPlaybackTestCase();
34     void eosTestCase();
35     void playAndPauseTestCase();
36     void playAndStopTestCase();
37     void setAndGetPropertiesTestCase();
38     void gettersTestCase();
39     void playAndPauseAndResumeTestCase();
40     void pauseQuicklyAfterPlayTestCase();
41     void pauseAtTestCase();
42     void resumeDelayedTestCase();
43     void getCurrentMetadataTestCase();
44     void invalidUriTestCase();
45     void seekTestCase();
46     void defaultConfigurationTestCase();
47     void configurabilityTestCase();
48     void pauseFrameTestCase();
49     void pauseFrameConfigurabilityTestCase();
50     void pauseFrameCancelTestCase();
51     void rendererArtTestCase();
52     void bufferingTestCase();
53     void mediaRouteTestCase();
54     void setReadyTimeoutTestCase();
55     void redirectMessageTestCase();
56
57     void initTestCase();
58     void init();
59     void cleanup();
60
61 protected slots:
62     void slotTimeOut();
63     
64 protected:
65     static void playCallback(MafwGstRendererWorker *worker, gpointer owner);
66     static void eosCallback(MafwGstRendererWorker *worker, gpointer owner);
67     static void errorCallback(MafwGstRendererWorker *worker,
68                               gpointer owner,
69                               const GError *error);
70     static void pauseCallback(MafwGstRendererWorker *worker, gpointer owner);
71     static void propertyCallback(MafwGstRendererWorker *worker,
72                                  gpointer owner,
73                                  gint id,
74                                  GValue *value);
75     static void seekCallback(MafwGstRendererWorker *worker, gpointer owner);
76     static void metadataCallback(MafwGstRendererWorker *worker,
77                                  gpointer owner,
78                                  gint key,
79                                  GType type,
80                                  gpointer value);
81     static void bufferingCallback(MafwGstRendererWorker *worker,
82                                   gpointer owner,
83                                   gdouble percent);
84     static void blankingControlCallback(MafwGstRendererWorker *worker,
85                                         gpointer owner, gboolean prohibit);
86     static void screenshotCallback(MafwGstRendererWorker *worker,
87                                    gpointer owner,
88                                    GstBuffer *buffer,
89                                    const char *filename,
90                                    gboolean cancel);
91
92     void waitForEvent(gint ms, bool &hasEventOccurred);
93
94 private: //data
95     MafwGstRendererWorker *m_worker;
96     bool m_gotPlayCallback;
97     bool m_gotEosCallback;
98     bool m_gotErrorCallback;
99     bool m_gotPauseCallback;
100     bool m_gotSeekCallback;
101     bool m_gotMetadataCallback;
102     bool m_gotPropertyCallback;
103     bool m_gotBufferStatusCallback;
104     bool m_blankingProhibited;
105     int m_receivedErrorCode;
106     int m_receivedPropertyId;
107     gdouble m_receivedBufferStatus;
108     QList<int> m_receivedMetadata;
109 };
110
111 #endif