Fix tests for boot2qt

The tests for boot2qt were disabled with commit
28063805bf. The tests can
be enabled since qtdeclarative now fallbacks to software
renderer if OpenGL is not supported.

Some tests involving mouse behavior and window grabbing
need to be skipped on minimal/offscreen platforms.

Task-number: QTBUG-60268
Change-Id: Ib468638df8d5001bf127dd17aee7dcfe38b11780
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Sami Nurmenniemi 2017-06-05 12:48:40 +03:00 committed by Simon Hausmann
parent c4e5208dd1
commit adb0f009de
7 changed files with 31 additions and 6 deletions

View File

@ -28,9 +28,3 @@ SUBDIRS += \
sanity \
snippets
# QTBUG-60268
boot2qt: SUBDIRS -= applicationwindow calendar controls cursor \
drawer focus font menu platform palette popup \
qquickmaterialstyle qquickmaterialstyleconf \
qquickuniversalstyle qquickuniversalstyleconf \
snippets qquickmenubar qquickninepatchimage

View File

@ -732,6 +732,9 @@ TestCase {
compare(highlightedSpy.count, 0)
mouseMove(content, content.width / 2 + 1, content.height / 2 + 1)
compare(activatedSpy.count, 0)
if ((Qt.platform.pluginName === "offscreen")
|| (Qt.platform.pluginName === "minimal"))
expectFail("", "Mouse highlighting not functional on offscreen/minimal platforms")
compare(highlightedSpy.count, 1)
mouseRelease(content)
compare(activatedSpy.count, 1)
@ -1177,6 +1180,9 @@ TestCase {
}
function test_mouseHighlight() {
if ((Qt.platform.pluginName === "offscreen")
|| (Qt.platform.pluginName === "minimal"))
skip("Mouse highlight not functional on offscreen/minimal platforms")
var control = createTemporaryObject(comboBox, testCase, {model: 20})
verify(control)

View File

@ -283,6 +283,10 @@ TestCase {
}
function test_activateShortcutWhileToolTipVisible() {
if ((Qt.platform.pluginName === "offscreen")
|| (Qt.platform.pluginName === "minimal"))
skip("Mouse hoovering not functional on offscreen/minimal platforms")
var root = createTemporaryObject(buttonAndShortcutComponent, testCase)
verify(root)

View File

@ -184,6 +184,11 @@ void tst_cursor::scrollBar()
const QPoint scrollBarPos(window->width() - scrollBar->width() / 2, window->height() / 2);
QTest::mouseMove(window, scrollBarPos);
if ((QGuiApplication::platformName() == QLatin1String("offscreen"))
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QEXPECT_FAIL("", "Active status behaves differently in offscreen/minimal platforms", Continue);
QVERIFY(scrollBar->isActive());
QCOMPARE(window->cursor().shape(), scrollBar->cursor().shape());
QCOMPARE(scrollBar->cursor().shape(), Qt::CursorShape::ArrowCursor);

View File

@ -127,6 +127,10 @@ void tst_menu::count()
void tst_menu::mouse()
{
if ((QGuiApplication::platformName() == QLatin1String("offscreen"))
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Mouse hovering not functional on offscreen/minimal platforms");
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
QQuickApplicationWindow *window = helper.appWindow;
@ -896,6 +900,10 @@ void tst_menu::subMenuMouse_data()
void tst_menu::subMenuMouse()
{
if ((QGuiApplication::platformName() == QLatin1String("offscreen"))
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Mouse hovering not functional on offscreen/minimal platforms");
QFETCH(bool, cascade);
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));

View File

@ -77,6 +77,10 @@ void tst_qquickmenubar::delegate()
void tst_qquickmenubar::mouse()
{
if ((QGuiApplication::platformName() == QLatin1String("offscreen"))
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Mouse highlight not functional on offscreen/minimal platforms");
QQmlApplicationEngine engine(testFileUrl("menubar.qml"));
QScopedPointer<QQuickApplicationWindow> window(qobject_cast<QQuickApplicationWindow *>(engine.rootObjects().value(0)));

View File

@ -125,6 +125,10 @@ void tst_qquickninepatchimage::ninePatch()
// Bottom-left
painter.drawImage(0, generatedImage.height() - blueRect.height(), blueRect);
if ((QGuiApplication::platformName() == QLatin1String("offscreen"))
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QEXPECT_FAIL("", "Grabbing does not work on offscreen/minimal platforms", Abort);
QCOMPARE(ninePatchImageGrab, generatedImage);
}