Fix unit tests

Random playback mode is not good for testing index changed signal,
because the same media might be played successively.
Calling show() might result in showFullScreen() on some platforms,
which is not expected by some video widget tests.

Change-Id: Ib47433fc6411b6dfa244a245aae508df5627ec62
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
This commit is contained in:
Bernd Weimer
2014-03-31 16:18:23 +02:00
committed by The Qt Project
parent 3a18ec30f0
commit a85e55436a
2 changed files with 4 additions and 5 deletions

View File

@@ -413,8 +413,7 @@ void tst_QMediaPlaylistNavigator::testCurrentIndexChangedSignal()
{
QMediaNetworkPlaylistProvider playlist;
QMediaPlaylistNavigator navigator(&playlist);
navigator.setPlaybackMode(QMediaPlaylist::Random);
QCOMPARE(navigator.playbackMode(), QMediaPlaylist::Random);
QCOMPARE(navigator.playbackMode(), QMediaPlaylist::Sequential);
QCOMPARE(navigator.currentIndex(), -1);
//Creating a QSignalSpy object for currentIndexChanged() signal

View File

@@ -907,7 +907,7 @@ void tst_QVideoWidget::fullScreenWindowControl()
QtTestVideoObject object(new QtTestWindowControl, 0, 0);
QVideoWidget widget;
object.bind(&widget);
widget.show();
widget.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
Qt::WindowFlags windowFlags = widget.windowFlags();
@@ -992,7 +992,7 @@ void tst_QVideoWidget::fullScreenWidgetControl()
QtTestVideoObject object(0, new QtTestWidgetControl, 0);
QVideoWidget widget;
object.bind(&widget);
widget.show();
widget.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
Qt::WindowFlags windowFlags = widget.windowFlags();
@@ -1078,7 +1078,7 @@ void tst_QVideoWidget::fullScreenRendererControl()
QtTestVideoObject object(0, 0, new QtTestRendererControl);
QVideoWidget widget;
object.bind(&widget);
widget.show();
widget.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
Qt::WindowFlags windowFlags = widget.windowFlags();