From 3d9bfd7a0a9bff5a3d66366656ae2746f0af97af Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 29 Apr 2019 12:19:57 +0200 Subject: Silence warnings in tst_qwebengineprofile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Register custom schemes Change-Id: I536a27da8f936e4ea6569e39a8ec6e30e23af03a Reviewed-by: Jüri Valdmann --- .../qwebengineprofile/tst_qwebengineprofile.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index d9505cbfd..e84aacb27 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,7 @@ class tst_QWebEngineProfile : public QObject Q_OBJECT private Q_SLOTS: + void initTestCase(); void init(); void cleanup(); void privateProfile(); @@ -61,6 +63,23 @@ private Q_SLOTS: void qtbug_72299(); // this should be the last test }; +void tst_QWebEngineProfile::initTestCase() +{ + QWebEngineUrlScheme foo("foo"); + QWebEngineUrlScheme stream("stream"); + QWebEngineUrlScheme letterto("letterto"); + QWebEngineUrlScheme aviancarrier("aviancarrier"); + foo.setSyntax(QWebEngineUrlScheme::Syntax::Host); + stream.setSyntax(QWebEngineUrlScheme::Syntax::HostAndPort); + stream.setDefaultPort(8080); + letterto.setSyntax(QWebEngineUrlScheme::Syntax::Path); + aviancarrier.setSyntax(QWebEngineUrlScheme::Syntax::Path); + QWebEngineUrlScheme::registerScheme(foo); + QWebEngineUrlScheme::registerScheme(stream); + QWebEngineUrlScheme::registerScheme(letterto); + QWebEngineUrlScheme::registerScheme(aviancarrier); +} + void tst_QWebEngineProfile::init() { //make sure defualt global profile is 'default' across all the tests @@ -82,6 +101,7 @@ void tst_QWebEngineProfile::cleanup() profile->setCachePath(QString()); profile->setPersistentStoragePath(QString()); profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache); + profile->removeAllUrlSchemeHandlers(); } void tst_QWebEngineProfile::privateProfile() -- cgit v1.2.3