Split some of the autotests into widget and non widget parts.

Since the tests are mostly not widget based.

Change-Id: Ic3fa4224b19f2a5c710fd4763b5e645252975c1c
Reviewed-on: http://codereview.qt-project.org/4174
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
This commit is contained in:
Michael Goddard
2011-09-05 16:13:46 +10:00
committed by Qt by Nokia
parent 461a37b412
commit d690596868
30 changed files with 856 additions and 146 deletions

View File

@@ -48,7 +48,9 @@
#include "mockmediastreamscontrol.h"
#include "mockmedianetworkaccesscontrol.h"
#include "mockvideorenderercontrol.h"
#if defined(QT_MULTIMEDIAKIT_MOCK_WIDGETS)
#include "mockvideowindowcontrol.h"
#endif
class MockMediaPlayerService : public QMediaService
{
@@ -61,9 +63,11 @@ public:
mockStreamsControl = new MockStreamsControl;
mockNetworkControl = new MockNetworkAccessControl;
rendererControl = new MockVideoRendererControl;
windowControl = new MockVideoWindowControl;
rendererRef = 0;
#if defined(QT_MULTIMEDIAKIT_MOCK_WIDGETS)
windowControl = new MockVideoWindowControl;
windowRef = 0;
#endif
}
~MockMediaPlayerService()
@@ -72,7 +76,9 @@ public:
delete mockStreamsControl;
delete mockNetworkControl;
delete rendererControl;
#if defined(QT_MULTIMEDIAKIT_MOCK_WIDGETS)
delete windowControl;
#endif
}
QMediaControl* requestControl(const char *iid)
@@ -84,13 +90,15 @@ public:
rendererRef += 1;
return rendererControl;
}
} else if (qstrcmp(iid, QVideoWindowControl_iid) == 0) {
}
#if defined(QT_MULTIMEDIAKIT_MOCK_WIDGETS)
if (qstrcmp(iid, QVideoWindowControl_iid) == 0) {
if (windowRef == 0) {
windowRef += 1;
return windowControl;
}
}
#endif
if (qstrcmp(iid, QMediaNetworkAccessControl_iid) == 0)
return mockNetworkControl;
@@ -101,8 +109,10 @@ public:
{
if (control == rendererControl)
rendererRef -= 1;
else if (control == windowControl)
#if defined(QT_MULTIMEDIAKIT_MOCK_WIDGETS)
if (control == windowControl)
windowRef -= 1;
#endif
}
void setState(QMediaPlayer::State state) { emit mockControl->stateChanged(mockControl->_state = state); }
@@ -154,9 +164,11 @@ public:
MockStreamsControl *mockStreamsControl;
MockNetworkAccessControl *mockNetworkControl;
MockVideoRendererControl *rendererControl;
#if defined(QT_MULTIMEDIAKIT_MOCK_WIDGETS)
MockVideoWindowControl *windowControl;
int rendererRef;
int windowRef;
#endif
int rendererRef;
};