summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-06-28 11:06:20 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-07-13 11:11:40 +0200
commit734b635cf9a9316ddd05dc9d9abc0a93746fc7f3 (patch)
tree49c6736d1c0c792326dd52b7541bea361c478609 /tests/auto
parentb848c87dbbc317ad7186418a64670b52777d1393 (diff)
Adaptations for 90-based
Change-Id: I8402b044d8e12d75e144a00984b856f3de10bffd Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> (cherry picked from commit 1d988d971bc4270ba3d148e8e2c143bf8f625b6e)
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/widgets/accessibility/tst_accessibility.cpp12
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp4
-rw-r--r--tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp7
3 files changed, 14 insertions, 9 deletions
diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp
index 8d7a0fc23..0aabf0f6d 100644
--- a/tests/auto/widgets/accessibility/tst_accessibility.cpp
+++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp
@@ -103,7 +103,7 @@ void tst_Accessibility::hierarchy()
QCOMPARE(view->role(), QAccessible::Client);
QCOMPARE(view->childCount(), 1);
// Wait for accessibility to be fully initialized
- QTRY_VERIFY(view->child(0)->childCount() == 1);
+ QTRY_COMPARE(view->child(0)->childCount(), 1);
QAccessibleInterface *document = view->child(0);
QCOMPARE(document->role(), QAccessible::WebDocument);
QCOMPARE(document->parent(), view);
@@ -238,7 +238,7 @@ void tst_Accessibility::text()
QAccessibleInterface *view = QAccessible::queryAccessibleInterface(&webView);
// Wait for accessibility to be fully initialized
- QTRY_VERIFY(view->child(0)->childCount() == 5);
+ QTRY_COMPARE(view->child(0)->childCount(), 5);
QAccessibleInterface *document = view->child(0);
QVERIFY(document);
@@ -462,10 +462,10 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kMath") << QString("<math>a</math>") << 1 << QAccessible::Equation;
QTest::newRow("ax::mojom::Role::kMenu") << QString("<div role='menu'>a</div>") << 0 << QAccessible::PopupMenu;
QTest::newRow("ax::mojom::Role::kMenuBar") << QString("<div role='menubar'>a</div>") << 0 << QAccessible::MenuBar;
- QTest::newRow("ax::mojom::Role::kMenuItem") << QString("<menu role='menu'><input type='button' /></menu>") << 1 << QAccessible::MenuItem;
+ QTest::newRow("ax::mojom::Role::kMenuItem") << QString("<menu role='group'><div role='menuitem'>a</div></menu>") << 1 << QAccessible::MenuItem;
QTest::newRow("ax::mojom::Role::kMenuItemCheckBox") << QString("<menu role='menu'><input type='checkbox'></input></menu>") << 1 << QAccessible::CheckBox;
QTest::newRow("ax::mojom::Role::kMenuItemRadio") << QString("<menu role='menu'><input type='radio'></input></menu>") << 1 << QAccessible::RadioButton;
- QTest::newRow("ax::mojom::Role::kMenuButton") << QString("<menu role='group'><div role='menuitem'>a</div></menu>") << 1 << QAccessible::MenuItem;
+ QTest::newRow("ax::mojom::Role::kMenuButton") << QString("<menu role='menu'><input type='button' /></menu>") << 1 << QAccessible::Button;
QTest::newRow("ax::mojom::Role::kMenuListOption") << QString("<select role='menu'><option>a</option></select>") << 3 << QAccessible::MenuItem;
QTest::newRow("ax::mojom::Role::kMenuListPopup") << QString("<select role='menu'><option>a</option></select>") << 2 << QAccessible::PopupMenu;
QTest::newRow("ax::mojom::Role::kMeter") << QString("<meter>a</meter>") << 1 << QAccessible::Chart;
@@ -483,8 +483,8 @@ void tst_Accessibility::roles_data()
QTest::newRow("ax::mojom::Role::kRow") << QString("<table role=table><tr><td>a</td></tr></table>") << 1 << QAccessible::Row;
QTest::newRow("ax::mojom::Role::kRowGroup") << QString("<table role=table><tbody role=rowgroup><tr><td>a</td></tr></tbody></table>") << 1 << QAccessible::Section;
QTest::newRow("ax::mojom::Role::kRowHeader") << QString("<table role=table><tr><th>a</td><td>b</td></tr></table>") << 2 << QAccessible::RowHeader;
- QTest::newRow("ax::mojom::Role::kRuby") << QString("<ruby>a</ruby>") << 1 << QAccessible::StaticText;
- QTest::newRow("ax::mojom::Role::kRubyAnnotation") << QString("<ruby><rt>a</rt></ruby>") << 2 << QAccessible::StaticText;
+ QTest::newRow("ax::mojom::Role::kRuby") << QString("<ruby>a</ruby>") << 1 << QAccessible::Grouping;
+ QTest::newRow("ax::mojom::Role::kRubyAnnotation") << QString("<ruby><rt tabindex=0>a</rt></ruby>") << 2 << QAccessible::StaticText;
QTest::newRow("ax::mojom::Role::kScrollBar") << QString("<div role='scrollbar'>a</a>") << 0 << QAccessible::ScrollBar;
//QTest::newRow("ax::mojom::Role::kScrollView"); // No mapping to ARIA role
QTest::newRow("ax::mojom::Role::kSearch") << QString("<div role='search'>landmark</div>") << 0 << QAccessible::Section;
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 2cb0843db..0376168a2 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1971,6 +1971,7 @@ void tst_QWebEnginePage::symmetricUrl()
QUrl dataUrl("data:text/html,<h1>Test");
view.setUrl(dataUrl);
+ view.show();
QCOMPARE(view.url(), dataUrl);
QCOMPARE(view.history()->count(), 0);
@@ -3324,7 +3325,8 @@ void tst_QWebEnginePage::registerProtocolHandler()
});
QVERIFY(server.start());
- QWebEnginePage page;
+ QWebEngineProfile profile(QStringLiteral("registerProtocolHandler%1").arg(QTest::currentDataTag()));
+ QWebEnginePage page(&profile, nullptr);
QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished);
QSignalSpy permissionSpy(&page, &QWebEnginePage::registerProtocolHandlerRequested);
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
index 0580e077d..38f3b04e7 100644
--- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
+++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
@@ -472,7 +472,8 @@ void tst_QWebEngineProfile::urlSchemeHandlerFailRequest()
view.setPage(new QWebEnginePage(&profile, &view));
view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
view.load(QUrl(QStringLiteral("foo://bar")));
- QVERIFY(loadFinishedSpy.wait());
+ view.show();
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
QCOMPARE(toPlainTextSync(view.page()), QString());
}
@@ -486,7 +487,8 @@ void tst_QWebEngineProfile::urlSchemeHandlerFailOnRead()
view.setPage(new QWebEnginePage(&profile, &view));
view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
view.load(QUrl(QStringLiteral("foo://bar")));
- QVERIFY(loadFinishedSpy.wait());
+ view.show();
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
QCOMPARE(toPlainTextSync(view.page()), QString());
}
@@ -500,6 +502,7 @@ void tst_QWebEngineProfile::urlSchemeHandlerStreaming()
view.setPage(new QWebEnginePage(&profile, &view));
view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
view.load(QUrl(QStringLiteral("stream://whatever")));
+ view.show();
QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 30000);
QByteArray result;
result.append(1000, 'c');