From beb4ff332ca5b8406a75e8b2146464c5b0a81abd Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 16 Jan 2014 18:20:32 +0100 Subject: Cleanup the QtWebEngineWidgets public headers and API Headers were left intact to leave a trace of the evolution compared to the QtWebKit API and to make it easier to work until we had a basic subset of the API implemented. With the upcoming release, this patch removes this convenience in the aim of starting polishing the headers and the documentation for the upcoming release. Change-Id: Iae436b4ec041d771a7002575e122835802bc9f3e Reviewed-by: Michael Bruning --- tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp | 6 ------ .../tst_qwebenginehistoryinterface.cpp | 5 ++++- .../auto/widgets/qwebengineinspector/tst_qwebengineinspector.cpp | 4 ++++ tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 9 ++++++--- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp index f92474d05..86261721c 100644 --- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp +++ b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp @@ -318,14 +318,12 @@ void tst_QWebEngineHistory::serialize_3() //prepare two different history items QWebEngineHistoryItem a = hist->currentItem(); - a.setUserData("A - user data"); //check properties BEFORE serialization QString title(a.title()); QDateTime lastVisited(a.lastVisited()); QUrl originalUrl(a.originalUrl()); QUrl url(a.url()); - QVariant userData(a.userData()); save << *hist; QVERIFY(save.status() == QDataStream::Ok); @@ -341,7 +339,6 @@ void tst_QWebEngineHistory::serialize_3() QCOMPARE(b.lastVisited(), lastVisited); QCOMPARE(b.originalUrl(), originalUrl); QCOMPARE(b.url(), url); - QCOMPARE(b.userData(), userData); //Check if all data was read QVERIFY(load.atEnd()); @@ -480,9 +477,6 @@ void tst_QWebEngineHistory::historyItemFromDeletedPage() QCOMPARE(item.url(), QUrl()); QCOMPARE(item.title(), QString()); QCOMPARE(item.lastVisited(), QDateTime()); - QCOMPARE(item.icon(), QIcon()); - item.setUserData(42); - QCOMPARE(item.userData(), QVariant()); } } diff --git a/tests/auto/widgets/qwebenginehistoryinterface/tst_qwebenginehistoryinterface.cpp b/tests/auto/widgets/qwebenginehistoryinterface/tst_qwebenginehistoryinterface.cpp index 180a0f2fe..93714255b 100644 --- a/tests/auto/widgets/qwebenginehistoryinterface/tst_qwebenginehistoryinterface.cpp +++ b/tests/auto/widgets/qwebenginehistoryinterface/tst_qwebenginehistoryinterface.cpp @@ -22,7 +22,9 @@ #include #include +#if defined(QWEBENGINEHISTORYINTERFACE) #include +#endif #include class tst_QWebEngineHistoryInterface : public QObject @@ -73,6 +75,7 @@ void tst_QWebEngineHistoryInterface::cleanup() delete m_view; } +#if defined(QWEBENGINEHISTORYINTERFACE) class FakeHistoryImplementation : public QWebEngineHistoryInterface { public: void addHistoryEntry(const QString&) {} @@ -80,7 +83,7 @@ public: return url == QLatin1String("http://www.trolltech.com/"); } }; - +#endif /* * Test that visited links are properly colored. http://www.trolltech.com is marked diff --git a/tests/auto/widgets/qwebengineinspector/tst_qwebengineinspector.cpp b/tests/auto/widgets/qwebengineinspector/tst_qwebengineinspector.cpp index 5da386380..8d7e41f0f 100644 --- a/tests/auto/widgets/qwebengineinspector/tst_qwebengineinspector.cpp +++ b/tests/auto/widgets/qwebengineinspector/tst_qwebengineinspector.cpp @@ -20,9 +20,13 @@ #include #include +#if defined(QWEBENGINEINSPECTOR) #include +#endif #include +#if defined(QWEBENGINESETTINGS) #include +#endif class tst_QWebEngineInspector : public QObject { Q_OBJECT diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index edfe2153b..c22ea0051 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -237,6 +237,7 @@ void tst_QWebEnginePage::cleanupTestCase() cleanupFiles(); // Be nice } +#if defined(QWEBENGINEPAGE_ACCEPTNAVIGATIONREQUEST) class NavigationRequestOverride : public QWebEnginePage { public: @@ -252,6 +253,7 @@ protected: return m_acceptNavigationRequest; } }; +#endif void tst_QWebEnginePage::acceptNavigationRequest() { @@ -434,15 +436,13 @@ public: connect(this, SIGNAL(geometryChangeRequested(QRect)), this, SLOT(slotGeometryChangeRequested(QRect))); } +#if defined(QWEBENGINEPAGE_ACCEPTNAVIGATIONREQUEST) struct Navigation { QWebEngineFrame *frame; QNetworkRequest request; NavigationType type; }; - QList navigations; - QList createdWindows; - QRect requestedGeometry; virtual bool acceptNavigationRequest(QWebEngineFrame* frame, const QNetworkRequest &request, NavigationType type) { Navigation n; @@ -452,13 +452,16 @@ public: navigations.append(n); return true; } +#endif + QList createdWindows; virtual QWebEnginePage* createWindow(WebWindowType) { TestPage* page = new TestPage(this); createdWindows.append(page); return page; } + QRect requestedGeometry; private Q_SLOTS: void slotGeometryChangeRequested(const QRect& geom) { requestedGeometry = geom; -- cgit v1.2.1