From 1d988d971bc4270ba3d148e8e2c143bf8f625b6e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 28 Jun 2021 11:06:20 +0200 Subject: Adaptations for 90-based Pick-to: 6.2 Change-Id: I8402b044d8e12d75e144a00984b856f3de10bffd Reviewed-by: Peter Varga --- tests/auto/widgets/accessibility/tst_accessibility.cpp | 12 ++++++------ tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 4 +++- .../auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 7 +++++-- 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp index 430a70e85..479e265da 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); @@ -241,7 +241,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); @@ -465,10 +465,10 @@ void tst_Accessibility::roles_data() QTest::newRow("ax::mojom::Role::kMath") << QString("a") << 1 << QAccessible::Equation; QTest::newRow("ax::mojom::Role::kMenu") << QString("
a
") << 0 << QAccessible::PopupMenu; QTest::newRow("ax::mojom::Role::kMenuBar") << QString("
a
") << 0 << QAccessible::MenuBar; - QTest::newRow("ax::mojom::Role::kMenuItem") << QString("") << 1 << QAccessible::MenuItem; + QTest::newRow("ax::mojom::Role::kMenuItem") << QString("
a
") << 1 << QAccessible::MenuItem; QTest::newRow("ax::mojom::Role::kMenuItemCheckBox") << QString("") << 1 << QAccessible::CheckBox; QTest::newRow("ax::mojom::Role::kMenuItemRadio") << QString("") << 1 << QAccessible::RadioButton; - QTest::newRow("ax::mojom::Role::kMenuButton") << QString("
a
") << 1 << QAccessible::MenuItem; + QTest::newRow("ax::mojom::Role::kMenuButton") << QString("") << 1 << QAccessible::Button; QTest::newRow("ax::mojom::Role::kMenuListOption") << QString("") << 3 << QAccessible::MenuItem; QTest::newRow("ax::mojom::Role::kMenuListPopup") << QString("") << 2 << QAccessible::PopupMenu; QTest::newRow("ax::mojom::Role::kMeter") << QString("a") << 1 << QAccessible::Chart; @@ -486,8 +486,8 @@ void tst_Accessibility::roles_data() QTest::newRow("ax::mojom::Role::kRow") << QString("
a
") << 1 << QAccessible::Row; QTest::newRow("ax::mojom::Role::kRowGroup") << QString("
a
") << 1 << QAccessible::Section; QTest::newRow("ax::mojom::Role::kRowHeader") << QString("
ab
") << 2 << QAccessible::RowHeader; - QTest::newRow("ax::mojom::Role::kRuby") << QString("a") << 1 << QAccessible::StaticText; - QTest::newRow("ax::mojom::Role::kRubyAnnotation") << QString("a") << 2 << QAccessible::StaticText; + QTest::newRow("ax::mojom::Role::kRuby") << QString("a") << 1 << QAccessible::Grouping; + QTest::newRow("ax::mojom::Role::kRubyAnnotation") << QString("a") << 2 << QAccessible::StaticText; QTest::newRow("ax::mojom::Role::kScrollBar") << QString("
a") << 0 << QAccessible::ScrollBar; //QTest::newRow("ax::mojom::Role::kScrollView"); // No mapping to ARIA role QTest::newRow("ax::mojom::Role::kSearch") << QString("
landmark
") << 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,

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 662e7a44f..bf8e9b471 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -477,7 +477,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()); } @@ -491,7 +492,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()); } @@ -505,6 +507,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'); -- cgit v1.2.3