diff options
Diffstat (limited to 'tests/auto/other')
-rw-r--r-- | tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp | 18 | ||||
-rw-r--r-- | tests/auto/other/gestures/tst_gestures.cpp | 2 | ||||
-rw-r--r-- | tests/auto/other/macgui/tst_macgui.cpp | 2 | ||||
-rw-r--r-- | tests/auto/other/macnativeevents/tst_macnativeevents.cpp | 2 | ||||
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 47 |
5 files changed, 44 insertions, 27 deletions
diff --git a/tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp b/tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp index 1a34c2076b..750ea8fc4c 100644 --- a/tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp +++ b/tests/auto/other/d3dcompiler/tst_d3dcompiler.cpp @@ -170,6 +170,7 @@ void tst_d3dcompiler::init() { qunsetenv("QT_D3DCOMPILER_DIR"); qunsetenv("QT_D3DCOMPILER_TIMEOUT"); + qunsetenv("QT_D3DCOMPILER_DISABLE_DLL"); } void tst_d3dcompiler::cleanup() @@ -195,8 +196,8 @@ void tst_d3dcompiler::service_data() // Don't test the default case, as it would clutter the AppData directory //QTest::newRow("default") << QByteArrayLiteral("") << true << E_ABORT; QTest::newRow("temporary") << QFile::encodeName(tempDir.path()) << true << E_ABORT; - QTest::newRow("invalid") << QByteArrayLiteral("ZZ:\\") << false << S_OK; - QTest::newRow("empty") << QByteArrayLiteral("") << false << S_OK; + QTest::newRow("invalid") << QByteArrayLiteral("ZZ:\\") << false << E_FAIL; + QTest::newRow("empty") << QByteArrayLiteral("") << false << E_FAIL; } void tst_d3dcompiler::service() @@ -205,16 +206,12 @@ void tst_d3dcompiler::service() QFETCH(bool, exists); QFETCH(HRESULT, result); qputenv("QT_D3DCOMPILER_DIR", compilerDir); + qputenv("QT_D3DCOMPILER_DISABLE_DLL", QByteArrayLiteral("1")); const QDir path = blobPath(); if (exists) { // Activate service QVERIFY(path.exists()); - - QFile control(path.absoluteFilePath(QStringLiteral("control"))); - QVERIFY(control.open(QFile::WriteOnly)); - control.close(); - QVERIFY(control.exists()); } else { QVERIFY(!path.exists()); } @@ -262,6 +259,7 @@ void tst_d3dcompiler::service() void tst_d3dcompiler::offlineCompile() { qputenv("QT_D3DCOMPILER_DIR", QFile::encodeName(tempDir.path())); + qputenv("QT_D3DCOMPILER_DISABLE_DLL", QByteArrayLiteral("1")); for (int i = 0; compilerDlls[i]; ++i) { d3dcompiler_win = loadLibrary(compilerDlls[i]); @@ -302,6 +300,8 @@ void tst_d3dcompiler::offlineCompile() void tst_d3dcompiler::onlineCompile() { qputenv("QT_D3DCOMPILER_DIR", QFile::encodeName(tempDir.path())); + qputenv("QT_D3DCOMPILER_TIMEOUT", QByteArray::number(3000)); + qputenv("QT_D3DCOMPILER_DISABLE_DLL", QByteArrayLiteral("1")); QByteArray data(hlsl); @@ -309,10 +309,6 @@ void tst_d3dcompiler::onlineCompile() // Activate service QVERIFY(path.exists()); - QFile control(path.absoluteFilePath(QStringLiteral("control"))); - QVERIFY(control.open(QFile::WriteOnly)); - control.close(); - QVERIFY(control.exists()); d3dcompiler_qt = loadLibrary(D3DCOMPILER_DLL); QVERIFY(d3dcompiler_qt); diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp index 448825fd81..df168aef58 100644 --- a/tests/auto/other/gestures/tst_gestures.cpp +++ b/tests/auto/other/gestures/tst_gestures.cpp @@ -1545,7 +1545,7 @@ void tst_Gestures::autoCancelGestures() QVERIFY(QTest::qWaitForWindowExposed(&parent)); /* - An event is send to both the child and the parent, when the child gets it a gesture is triggered + An event is sent to both the child and the parent, when the child gets it a gesture is triggered and send to the child. When the parent gets the event a new gesture is triggered and delivered to the parent. When the parent gets it he accepts it and that causes the cancel policy to activate. diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp index e796b44843..14993145b4 100644 --- a/tests/auto/other/macgui/tst_macgui.cpp +++ b/tests/auto/other/macgui/tst_macgui.cpp @@ -142,6 +142,8 @@ void tst_MacGui::splashScreenModality() box.setText("accessible?"); box.show(); + QSKIP("QTBUG-35169"); + // Find the "OK" button and schedule a press. QAccessibleInterface *interface = wn.find(QAccessible::Name, "OK", &box); QVERIFY(interface); diff --git a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp index ae59672c72..1cb752b4b0 100644 --- a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp +++ b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp @@ -272,7 +272,7 @@ void tst_MacNativeEvents::testDragWindow() void tst_MacNativeEvents::testMouseEnter() { // When a mouse enters a widget, both a mouse enter events and a - // mouse move event should be sendt. Lets test this: + // mouse move event should be sent. Let's test this: QWidget w; w.setMouseTracking(true); w.show(); diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 53f74d091b..2bf8a40451 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1650,30 +1650,33 @@ void tst_QAccessibility::textEditTest() QTest::qWaitForWindowShown(&edit); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&edit); QCOMPARE(iface->text(QAccessible::Value), edit.toPlainText()); - QCOMPARE(iface->textInterface()->textAtOffset(8, QAccessible::WordBoundary, &startOffset, &endOffset), QString("world")); + QAccessibleTextInterface *textIface = iface->textInterface(); + QVERIFY(textIface); + + QCOMPARE(textIface->textAtOffset(8, QAccessible::WordBoundary, &startOffset, &endOffset), QString("world")); QCOMPARE(startOffset, 6); QCOMPARE(endOffset, 11); - QCOMPARE(iface->textInterface()->textAtOffset(15, QAccessible::LineBoundary, &startOffset, &endOffset), QString("How are you today?")); + QCOMPARE(textIface->textAtOffset(15, QAccessible::LineBoundary, &startOffset, &endOffset), QString("How are you today?")); QCOMPARE(startOffset, 13); QCOMPARE(endOffset, 31); - QCOMPARE(iface->textInterface()->characterCount(), 48); + QCOMPARE(textIface->characterCount(), 48); QFontMetrics fm(edit.currentFont()); - QCOMPARE(iface->textInterface()->characterRect(0).size(), QSize(fm.width("h"), fm.height())); - QCOMPARE(iface->textInterface()->characterRect(5).size(), QSize(fm.width(" "), fm.height())); - QCOMPARE(iface->textInterface()->characterRect(6).size(), QSize(fm.width("w"), fm.height())); + QCOMPARE(textIface->characterRect(0).size(), QSize(fm.width("h"), fm.height())); + QCOMPARE(textIface->characterRect(5).size(), QSize(fm.width(" "), fm.height())); + QCOMPARE(textIface->characterRect(6).size(), QSize(fm.width("w"), fm.height())); int offset = 10; - QCOMPARE(iface->textInterface()->text(offset, offset + 1), QStringLiteral("d")); - QVERIFY(fuzzyRectCompare(iface->textInterface()->characterRect(offset), characterRect(edit, offset))); + QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("d")); + QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset))); offset = 13; - QCOMPARE(iface->textInterface()->text(offset, offset + 1), QStringLiteral("H")); - QVERIFY(fuzzyRectCompare(iface->textInterface()->characterRect(offset), characterRect(edit, offset))); + QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("H")); + QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset))); offset = 21; - QCOMPARE(iface->textInterface()->text(offset, offset + 1), QStringLiteral("y")); - QVERIFY(fuzzyRectCompare(iface->textInterface()->characterRect(offset), characterRect(edit, offset))); + QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("y")); + QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset))); offset = 32; - QCOMPARE(iface->textInterface()->text(offset, offset + 1), QStringLiteral("I")); - QVERIFY(fuzzyRectCompare(iface->textInterface()->characterRect(offset), characterRect(edit, offset))); + QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("I")); + QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset))); QTestAccessibility::clearEvents(); @@ -1692,6 +1695,22 @@ void tst_QAccessibility::textEditTest() sel.setCursorPosition(end); sel.setSelection(0, end); QVERIFY_EVENT(&sel); + + // check that we have newlines handled + QString poem = QStringLiteral("Once upon a midnight dreary,\nwhile I pondered, weak and weary,\nOver many a quaint and curious volume of forgotten lore\n"); + QAccessibleEditableTextInterface *editableTextIface = iface->editableTextInterface(); + QVERIFY(editableTextIface); + editableTextIface->replaceText(0, end, poem); + QCOMPARE(iface->text(QAccessible::Value), poem); + QCOMPARE(textIface->text(0, poem.size()), poem); + QCOMPARE(textIface->text(28, 29), QLatin1String("\n")); + int start; + QCOMPARE(textIface->textAtOffset(42, QAccessible::LineBoundary, &start, &end), QStringLiteral("while I pondered, weak and weary,")); + QCOMPARE(start, 29); + QCOMPARE(end, 62); + QCOMPARE(textIface->textAtOffset(28, QAccessible::CharBoundary, &start, &end), QLatin1String("\n")); + QCOMPARE(start, 28); + QCOMPARE(end, 29); } QTestAccessibility::clearEvents(); } |