diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-10-12 15:27:23 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-11-28 13:32:50 +0100 |
commit | b104487f072cd04ca4301ba1f10d3ad2e874569e (patch) | |
tree | 920c6e6fcabdcaff9e4c9f8ead2e6b0c289f99eb /tests/auto/widgets | |
parent | 2d002e42a8b6e711e3c9ca5b6dd3611e9d8426ab (diff) |
Adaptations for 106-based
Change-Id: I2fe91c06ce91dfaace7825a0589b56ee375479b6
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests/auto/widgets')
3 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp index 9589e83e1..6ddc031d5 100644 --- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp +++ b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp @@ -487,9 +487,9 @@ void tst_QWebEngineHistory::clear() QWebEnginePage page2(this); QWebEngineHistory* hist2 = page2.history(); - QVERIFY(hist2->count() == 0); + QCOMPARE(hist2->count(), 1); hist2->clear(); - QVERIFY(hist2->count() == 0); // Do not change anything. + QCOMPARE(hist2->count(), 1); // Do not change anything. } void tst_QWebEngineHistory::historyItemFromDeletedPage() diff --git a/tests/auto/widgets/qwebenginepage/CMakeLists.txt b/tests/auto/widgets/qwebenginepage/CMakeLists.txt index f9a24b2c7..a15bb6e06 100644 --- a/tests/auto/widgets/qwebenginepage/CMakeLists.txt +++ b/tests/auto/widgets/qwebenginepage/CMakeLists.txt @@ -9,6 +9,7 @@ qt_internal_add_test(tst_qwebenginepage tst_qwebenginepage.cpp LIBRARIES Qt::CorePrivate + Qt::NetworkPrivate Qt::WebEngineCorePrivate Qt::WebEngineWidgets Test::HttpServer diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index c76da443e..64acdb3d5 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -20,6 +20,7 @@ */ #include <widgetutil.h> +#include <QtNetwork/private/qtnetworkglobal_p.h> #include <QtWebEngineCore/qtwebenginecore-config.h> #include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h> #include <QByteArray> @@ -2060,14 +2061,14 @@ void tst_QWebEnginePage::symmetricUrl() QVERIFY(view.url().isEmpty()); - QCOMPARE(view.history()->count(), 0); + QCOMPARE(view.history()->count(), 1); QUrl dataUrl("data:text/html,<h1>Test"); view.setUrl(dataUrl); view.show(); QCOMPARE(view.url(), dataUrl); - QCOMPARE(view.history()->count(), 0); + QCOMPARE(view.history()->count(), 1); // loading is _not_ immediate, so the text isn't set just yet. QVERIFY(toPlainTextSync(view.page()).isEmpty()); @@ -2380,7 +2381,7 @@ void tst_QWebEnginePage::setHtmlWithBaseURL() QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].height").toInt(), 128); // no history item has to be added. - QCOMPARE(m_view->page()->history()->count(), 0); + QCOMPARE(m_view->page()->history()->count(), 1); } class MyPage : public QWebEnginePage @@ -2810,7 +2811,7 @@ void tst_QWebEnginePage::setUrlHistory() int expectedLoadFinishedCount = 0; QSignalSpy spy(m_page, SIGNAL(loadFinished(bool))); - QCOMPARE(m_page->history()->count(), 0); + QCOMPARE(m_page->history()->count(), 1); m_page->setUrl(QUrl()); expectedLoadFinishedCount++; @@ -2884,7 +2885,7 @@ void tst_QWebEnginePage::setUrlUsingStateObject() QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); int expectedUrlChangeCount = 0; - QCOMPARE(m_page->history()->count(), 0); + QCOMPARE(m_page->history()->count(), 1); url = QUrl("qrc:/resources/test1.html"); m_page->setUrl(url); @@ -3709,7 +3710,7 @@ void tst_QWebEnginePage::openLinkInNewPage() QCOMPARE(page1.history()->count(), 1); else QCOMPARE(page1.history()->count(), 2); - QCOMPARE(page2.history()->count(), 0); + QCOMPARE(page2.history()->count(), 1); break; case Effect::LoadInOther: QTRY_COMPARE(page2.spy.size(), 1); |