From 08f056237a65d70c2eea2efb6c26ecb83a0ee584 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 28 Jan 2016 11:32:40 +0100 Subject: Use fictional schemes in URL scheme handler test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid the usage of mailto. It might get forwarded to QDesktopServices. Change-Id: I2e8c889e8b0107b11c22c182a64685bc5ac16aae Reviewed-by: Michael Brüning --- .../widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index 99182f155..d06fd5e9a 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -108,14 +108,14 @@ public: void tst_QWebEngineProfile::urlSchemeHandlers() { - RedirectingUrlSchemeHandler mailtoHandler; + RedirectingUrlSchemeHandler lettertoHandler; QWebEngineProfile profile(QStringLiteral("urlSchemeHandlers")); - profile.installUrlSchemeHandler("mailto", &mailtoHandler); + profile.installUrlSchemeHandler("letterto", &lettertoHandler); QWebEngineView view; QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool))); view.setPage(new QWebEnginePage(&profile, &view)); QString emailAddress = QStringLiteral("egon@olsen-banden.dk"); - view.load(QUrl(QStringLiteral("mailto:") + emailAddress)); + view.load(QUrl(QStringLiteral("letterto:") + emailAddress)); QVERIFY(loadFinishedSpy.wait()); QCOMPARE(toPlainTextSync(view.page()), emailAddress); @@ -127,14 +127,14 @@ void tst_QWebEngineProfile::urlSchemeHandlers() QVERIFY(loadFinishedSpy.wait()); QCOMPARE(toPlainTextSync(view.page()), url.toString()); - // Remove the mailto scheme, and check whether it is not handled anymore. - profile.removeUrlScheme("mailto"); + // Remove the letterto scheme, and check whether it is not handled anymore. + profile.removeUrlScheme("letterto"); emailAddress = QStringLiteral("kjeld@olsen-banden.dk"); - view.load(QUrl(QStringLiteral("mailto:") + emailAddress)); + view.load(QUrl(QStringLiteral("letterto:") + emailAddress)); QVERIFY(loadFinishedSpy.wait()); QVERIFY(toPlainTextSync(view.page()) != emailAddress); - // Check if gopher is still working after removing mailto. + // Check if gopher is still working after removing letterto. url = QUrl(QStringLiteral("gopher://olsen-banden.dk/yvonne")); view.load(url); QVERIFY(loadFinishedSpy.wait()); -- cgit v1.2.3 From af79ee493dea93737aa0e0d672f0182c403283fd Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 28 Jan 2016 14:48:23 +0100 Subject: Stabilize tst_QWebEngineProfile::urlSchemeHandlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes the emission of loadFinished wasn't caught. Use a QTRY_VERIFY-like function to synchronously load a page. Change-Id: Ib260a126c0cff7f254c97b1cd89f49b806010235 Reviewed-by: Michael Brüning --- .../qwebengineprofile/tst_qwebengineprofile.cpp | 34 +++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index d06fd5e9a..89e8da00d 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -106,52 +106,60 @@ public: } }; +static bool loadSync(QWebEngineView *view, const QUrl &url, int timeout = 5000) +{ + // Ripped off QTRY_VERIFY. + QSignalSpy loadFinishedSpy(view, SIGNAL(loadFinished(bool))); + view->load(url); + if (loadFinishedSpy.isEmpty()) + QTest::qWait(0); + for (int i = 0; i < timeout; i += 50) { + if (!loadFinishedSpy.isEmpty()) + return true; + QTest::qWait(50); + } + return false; +} + void tst_QWebEngineProfile::urlSchemeHandlers() { RedirectingUrlSchemeHandler lettertoHandler; QWebEngineProfile profile(QStringLiteral("urlSchemeHandlers")); profile.installUrlSchemeHandler("letterto", &lettertoHandler); QWebEngineView view; - QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool))); view.setPage(new QWebEnginePage(&profile, &view)); QString emailAddress = QStringLiteral("egon@olsen-banden.dk"); - view.load(QUrl(QStringLiteral("letterto:") + emailAddress)); - QVERIFY(loadFinishedSpy.wait()); + QVERIFY(loadSync(&view, QUrl(QStringLiteral("letterto:") + emailAddress))); QCOMPARE(toPlainTextSync(view.page()), emailAddress); // Install a gopher handler after the view has been fully initialized. ReplyingUrlSchemeHandler gopherHandler; profile.installUrlSchemeHandler("gopher", &gopherHandler); QUrl url = QUrl(QStringLiteral("gopher://olsen-banden.dk/benny")); - view.load(url); - QVERIFY(loadFinishedSpy.wait()); + QVERIFY(loadSync(&view, url)); QCOMPARE(toPlainTextSync(view.page()), url.toString()); // Remove the letterto scheme, and check whether it is not handled anymore. profile.removeUrlScheme("letterto"); emailAddress = QStringLiteral("kjeld@olsen-banden.dk"); - view.load(QUrl(QStringLiteral("letterto:") + emailAddress)); - QVERIFY(loadFinishedSpy.wait()); + QVERIFY(loadSync(&view, QUrl(QStringLiteral("letterto:") + emailAddress))); QVERIFY(toPlainTextSync(view.page()) != emailAddress); // Check if gopher is still working after removing letterto. url = QUrl(QStringLiteral("gopher://olsen-banden.dk/yvonne")); - view.load(url); - QVERIFY(loadFinishedSpy.wait()); + QVERIFY(loadSync(&view, url)); QCOMPARE(toPlainTextSync(view.page()), url.toString()); // Does removeAll work? profile.removeAllUrlSchemeHandlers(); url = QUrl(QStringLiteral("gopher://olsen-banden.dk/harry")); - view.load(url); - QVERIFY(loadFinishedSpy.wait()); + QVERIFY(loadSync(&view, url)); QVERIFY(toPlainTextSync(view.page()) != url.toString()); // Install a handler that is owned by the view. Make sure this doesn't crash on shutdown. profile.installUrlSchemeHandler("aviancarrier", new ReplyingUrlSchemeHandler(&view)); url = QUrl(QStringLiteral("aviancarrier:inspector.mortensen@politistyrke.dk")); - view.load(url); - QVERIFY(loadFinishedSpy.wait()); + QVERIFY(loadSync(&view, url)); QCOMPARE(toPlainTextSync(view.page()), url.toString()); } -- cgit v1.2.3 From 7d8baa7fc48fc667b13b2151837662a28afa5f79 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 28 Jan 2016 18:24:15 +0100 Subject: Stabilize tst_QWebEngineProfile::urlSchemeHandlers some more Work around QTBUG-50752 in URL scheme handler test. Triggering the failing load makes subsequent calls to toPlainTextSync unreliable. Change-Id: I370d59b935b186fa4e3be3097ee921802f951720 Task-number: QTBUG-50752 Reviewed-by: Allan Sandfeld Jensen --- tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index 89e8da00d..0702e530f 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -141,9 +141,11 @@ void tst_QWebEngineProfile::urlSchemeHandlers() // Remove the letterto scheme, and check whether it is not handled anymore. profile.removeUrlScheme("letterto"); +#if 0 // QTBUG-50752 emailAddress = QStringLiteral("kjeld@olsen-banden.dk"); QVERIFY(loadSync(&view, QUrl(QStringLiteral("letterto:") + emailAddress))); QVERIFY(toPlainTextSync(view.page()) != emailAddress); +#endif // Check if gopher is still working after removing letterto. url = QUrl(QStringLiteral("gopher://olsen-banden.dk/yvonne")); -- cgit v1.2.3 From 32929885f44bb9621ac8cfa2b5c592b0977a123f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 28 Jan 2016 15:33:25 +0100 Subject: OS X: Fix crash when setting a custom default QSurfaceFormat. Setting a new default QSurfaceFormat after QtWebEngineCore::initialize() is called, might lead to a crash. This happens when the new surface format has a different OpenGL profile, compared to the profile created by web engine in the RenderWidgetHostViewQtDelegateWidget constructor. The default constructed QSurfaceFormat has an OpenGL Compatibility profile. Inside the Cocoa platform plugin when a new shared OpenGL context is created, it fails to initialize the new context because of the difference in profiles, and thus ultimately creates an unshared context, which leads to a crash. Fix consists in using the shared context QSurfaceFormat in the RenderWidgetHostViewQtDelegateWidget constructor, and also printing a fatal warning to notify the developer only to set the new QSurfaceFormat before the application instance is declared. Bottom line, if the QSurfaceFormat OpenGL profile has to be changed, it should be done before QtWebEngineCore::initialize() is called. Doing so after initialize() is called, will lead to a crash. Change-Id: I8a07211b592143d736b001556b944d4759802396 Task-number: QTBUG-50665 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Michal Klocek --- .../qquickwebenginedefaultsurfaceformat.pro | 6 + .../tst_qquickwebenginedefaultsurfaceformat.cpp | 148 +++++++++++++++++++++ tests/auto/quick/quick.pro | 1 + .../qwebenginedefaultsurfaceformat.pro | 1 + .../resources/index.html | 6 + .../tst_qwebenginedefaultsurfaceformat.cpp | 77 +++++++++++ .../tst_qwebenginedefaultsurfaceformat.qrc | 5 + tests/auto/widgets/widgets.pro | 1 + 8 files changed, 245 insertions(+) create mode 100644 tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro create mode 100644 tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp create mode 100644 tests/auto/widgets/qwebenginedefaultsurfaceformat/qwebenginedefaultsurfaceformat.pro create mode 100644 tests/auto/widgets/qwebenginedefaultsurfaceformat/resources/index.html create mode 100644 tests/auto/widgets/qwebenginedefaultsurfaceformat/tst_qwebenginedefaultsurfaceformat.cpp create mode 100644 tests/auto/widgets/qwebenginedefaultsurfaceformat/tst_qwebenginedefaultsurfaceformat.qrc (limited to 'tests') diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro new file mode 100644 index 000000000..826b47de7 --- /dev/null +++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro @@ -0,0 +1,6 @@ +include(../tests.pri) + +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc +QT_PRIVATE += webengine-private + +HEADERS += ../shared/util.h diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp new file mode 100644 index 000000000..9f2060898 --- /dev/null +++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/tst_qquickwebenginedefaultsurfaceformat.cpp @@ -0,0 +1,148 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "testwindow.h" +#include "util.h" + +#include +#include +#include +#include +#include +#include +#include + +class tst_QQuickWebEngineDefaultSurfaceFormat : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void customDefaultSurfaceFormat(); + +private: + inline void initEngineAndViewComponent(); + inline void initWindow(); + inline void deleteWindow(); + + inline QQuickWebEngineView *newWebEngineView(); + inline QQuickWebEngineView *webEngineView() const; + QUrl urlFromTestPath(const char *localFilePath); + + QQmlEngine *m_engine; + TestWindow *m_window; + QScopedPointer m_component; +}; + +void tst_QQuickWebEngineDefaultSurfaceFormat::initEngineAndViewComponent() { + m_engine = new QQmlEngine(this); + m_component.reset(new QQmlComponent(m_engine, this)); + m_component->setData(QByteArrayLiteral("import QtQuick 2.0\n" + "import QtWebEngine 1.2\n" + "WebEngineView {}") + , QUrl()); +} + +void tst_QQuickWebEngineDefaultSurfaceFormat::initWindow() +{ + m_window = new TestWindow(newWebEngineView()); +} + +void tst_QQuickWebEngineDefaultSurfaceFormat::deleteWindow() +{ + delete m_window; +} + +QQuickWebEngineView *tst_QQuickWebEngineDefaultSurfaceFormat::newWebEngineView() +{ + QObject *viewInstance = m_component->create(); + QQuickWebEngineView *webEngineView = qobject_cast(viewInstance); + return webEngineView; +} + +inline QQuickWebEngineView *tst_QQuickWebEngineDefaultSurfaceFormat::webEngineView() const +{ + return static_cast(m_window->webEngineView.data()); +} + +QUrl tst_QQuickWebEngineDefaultSurfaceFormat::urlFromTestPath(const char *localFilePath) +{ + QString testSourceDirPath = QString::fromLocal8Bit(TESTS_SOURCE_DIR); + if (!testSourceDirPath.endsWith(QLatin1Char('/'))) + testSourceDirPath.append(QLatin1Char('/')); + + return QUrl::fromLocalFile(testSourceDirPath + QString::fromUtf8(localFilePath)); +} + +void tst_QQuickWebEngineDefaultSurfaceFormat::customDefaultSurfaceFormat() +{ + // Setting a new default QSurfaceFormat with a core OpenGL profile, before + // app instantiation should succeed, without abort() being called. + int argc = 1; + char *argv[] = { const_cast("tst_QQuickWebEngineDefaultSurfaceFormat") }; + + QSurfaceFormat format; + format.setVersion( 3, 3 ); + format.setProfile( QSurfaceFormat::CoreProfile ); + QSurfaceFormat::setDefaultFormat( format ); + + QGuiApplication app(argc, argv); + QtWebEngine::initialize(); + + initEngineAndViewComponent(); + initWindow(); + QQuickWebEngineView* view = webEngineView(); + view->setUrl(urlFromTestPath("html/basic_page.html")); + m_window->show(); + + QObject::connect( + view, + &QQuickWebEngineView::loadingChanged, [](QQuickWebEngineLoadRequest* request) + { + if (request->status() == QQuickWebEngineView::LoadSucceededStatus + || request->status() == QQuickWebEngineView::LoadFailedStatus) + QTimer::singleShot(100, qApp, &QCoreApplication::quit); + } + ); + + QObject::connect(qApp, &QCoreApplication::aboutToQuit, [this]() { + this->deleteWindow(); + }); + + QCOMPARE(app.exec(), 0); +} + +QTEST_APPLESS_MAIN(tst_QQuickWebEngineDefaultSurfaceFormat) +#include "tst_qquickwebenginedefaultsurfaceformat.moc" diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index 33821e20b..b278808f6 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -3,6 +3,7 @@ TEMPLATE = subdirs SUBDIRS += \ inspectorserver \ publicapi \ + qquickwebenginedefaultsurfaceformat \ qquickwebengineview \ qquickwebengineviewgraphics diff --git a/tests/auto/widgets/qwebenginedefaultsurfaceformat/qwebenginedefaultsurfaceformat.pro b/tests/auto/widgets/qwebenginedefaultsurfaceformat/qwebenginedefaultsurfaceformat.pro new file mode 100644 index 000000000..e99c7f493 --- /dev/null +++ b/tests/auto/widgets/qwebenginedefaultsurfaceformat/qwebenginedefaultsurfaceformat.pro @@ -0,0 +1 @@ +include(../tests.pri) diff --git a/tests/auto/widgets/qwebenginedefaultsurfaceformat/resources/index.html b/tests/auto/widgets/qwebenginedefaultsurfaceformat/resources/index.html new file mode 100644 index 000000000..53726e4a6 --- /dev/null +++ b/tests/auto/widgets/qwebenginedefaultsurfaceformat/resources/index.html @@ -0,0 +1,6 @@ + + + Basic Page + +

Basic page

+ diff --git a/tests/auto/widgets/qwebenginedefaultsurfaceformat/tst_qwebenginedefaultsurfaceformat.cpp b/tests/auto/widgets/qwebenginedefaultsurfaceformat/tst_qwebenginedefaultsurfaceformat.cpp new file mode 100644 index 000000000..e42a8a75e --- /dev/null +++ b/tests/auto/widgets/qwebenginedefaultsurfaceformat/tst_qwebenginedefaultsurfaceformat.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "../util.h" + +#include +#include +#include + +class tst_QWebEngineDefaultSurfaceFormat : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void customDefaultSurfaceFormat(); +}; + +void tst_QWebEngineDefaultSurfaceFormat::customDefaultSurfaceFormat() +{ + // Setting a new default QSurfaceFormat with a core OpenGL profile before + // app instantiation should succeed, without abort() being called. + int argc = 1; + char *argv[] = { const_cast("tst_QWebEngineDefaultSurfaceFormat") }; + + QSurfaceFormat format; + format.setVersion( 3, 3 ); + format.setProfile( QSurfaceFormat::CoreProfile ); + QSurfaceFormat::setDefaultFormat( format ); + + QApplication app(argc, argv); + + QWebEngineView view; + view.load(QUrl("qrc:///resources/index.html")); + view.show(); + QObject::connect(&view, &QWebEngineView::loadFinished, []() { + QTimer::singleShot(100, qApp, &QCoreApplication::quit); + }); + + QCOMPARE(app.exec(), 0); +} + +QTEST_APPLESS_MAIN(tst_QWebEngineDefaultSurfaceFormat) +#include "tst_qwebenginedefaultsurfaceformat.moc" diff --git a/tests/auto/widgets/qwebenginedefaultsurfaceformat/tst_qwebenginedefaultsurfaceformat.qrc b/tests/auto/widgets/qwebenginedefaultsurfaceformat/tst_qwebenginedefaultsurfaceformat.qrc new file mode 100644 index 000000000..3d5f1b3b2 --- /dev/null +++ b/tests/auto/widgets/qwebenginedefaultsurfaceformat/tst_qwebenginedefaultsurfaceformat.qrc @@ -0,0 +1,5 @@ + + + resources/index.html + + diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro index 986d5bbee..3220b1379 100644 --- a/tests/auto/widgets/widgets.pro +++ b/tests/auto/widgets/widgets.pro @@ -2,6 +2,7 @@ TEMPLATE = subdirs SUBDIRS += \ qwebengineaccessibility \ + qwebenginedefaultsurfaceformat \ qwebenginepage \ qwebenginehistory \ qwebenginehistoryinterface \ -- cgit v1.2.3 From 489c9d0f631f79057bb16994b6719395d97f80ab Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 5 Feb 2016 12:02:56 +0100 Subject: Stabilize failed load sub-test of urlSchemeHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a failed load is replaced by an error-page we currently get two loadFinished signals. So disable error-pages to make the test of failed load simpler. Change-Id: I3baaf0f5a06c5e755695d6540316287a860e0d5f Task-number: QTBUG-50752 Reviewed-by: Michael Brüning --- tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index 0702e530f..9195a5190 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -39,8 +39,9 @@ #include #include #include +#include +#include #include -#include class tst_QWebEngineProfile : public QObject { @@ -128,6 +129,7 @@ void tst_QWebEngineProfile::urlSchemeHandlers() profile.installUrlSchemeHandler("letterto", &lettertoHandler); QWebEngineView view; view.setPage(new QWebEnginePage(&profile, &view)); + view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false); QString emailAddress = QStringLiteral("egon@olsen-banden.dk"); QVERIFY(loadSync(&view, QUrl(QStringLiteral("letterto:") + emailAddress))); QCOMPARE(toPlainTextSync(view.page()), emailAddress); @@ -141,11 +143,9 @@ void tst_QWebEngineProfile::urlSchemeHandlers() // Remove the letterto scheme, and check whether it is not handled anymore. profile.removeUrlScheme("letterto"); -#if 0 // QTBUG-50752 emailAddress = QStringLiteral("kjeld@olsen-banden.dk"); QVERIFY(loadSync(&view, QUrl(QStringLiteral("letterto:") + emailAddress))); QVERIFY(toPlainTextSync(view.page()) != emailAddress); -#endif // Check if gopher is still working after removing letterto. url = QUrl(QStringLiteral("gopher://olsen-banden.dk/yvonne")); -- cgit v1.2.3