From 73dced4e1d95aa392ec0080d3c06e47bd6566dec Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 19 Feb 2016 15:05:51 +0100 Subject: Prepare separate enabling of QtQuick autotests Change-Id: I330de920c339e31725d123eadf5dcc4227dd500f Reviewed-by: Kai Koehne --- tests/auto/quick/inspectorserver/inspectorserver.pro | 1 + tests/auto/quick/publicapi/publicapi.pro | 1 + tests/auto/quick/qmltests/qmltests.pro | 1 + .../qquickwebenginedefaultsurfaceformat.pro | 1 + tests/auto/quick/qquickwebengineview/qquickwebengineview.pro | 1 + .../quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro | 1 + tests/auto/quick/tests.pri | 4 +--- 7 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/auto/quick/inspectorserver/inspectorserver.pro b/tests/auto/quick/inspectorserver/inspectorserver.pro index 1a2c2f053..34e25487d 100644 --- a/tests/auto/quick/inspectorserver/inspectorserver.pro +++ b/tests/auto/quick/inspectorserver/inspectorserver.pro @@ -1,4 +1,5 @@ include(../tests.pri) +CONFIG -= testcase # remove, once this passes in the CI QT += webengine QT_PRIVATE += webengine-private DEFINES += IMPORT_DIR=\"\\\"$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP}imports\\\"\" diff --git a/tests/auto/quick/publicapi/publicapi.pro b/tests/auto/quick/publicapi/publicapi.pro index b178f56cd..ab1b714e9 100644 --- a/tests/auto/quick/publicapi/publicapi.pro +++ b/tests/auto/quick/publicapi/publicapi.pro @@ -1,3 +1,4 @@ include(../tests.pri) +CONFIG -= testcase # remove, once this passes in the CI QT += webengine QT_PRIVATE += webengine-private diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro index 57649384d..281676b6a 100644 --- a/tests/auto/quick/qmltests/qmltests.pro +++ b/tests/auto/quick/qmltests/qmltests.pro @@ -1,4 +1,5 @@ include(../tests.pri) +CONFIG -= testcase # remove, once this passes in the CI QT += qmltest diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro index 826b47de7..e0d29a48a 100644 --- a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro +++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro @@ -1,4 +1,5 @@ include(../tests.pri) +CONFIG -= testcase # remove, once this passes in the CI exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc QT_PRIVATE += webengine-private diff --git a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro index 826b47de7..e0d29a48a 100644 --- a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro +++ b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro @@ -1,4 +1,5 @@ include(../tests.pri) +CONFIG -= testcase # remove, once this passes in the CI exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc QT_PRIVATE += webengine-private diff --git a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro b/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro index cbd11cdca..9471def00 100644 --- a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro +++ b/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro @@ -1,3 +1,4 @@ include(../tests.pri) +CONFIG -= testcase # remove, once this passes in the CI exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc QT_PRIVATE += webengine-private diff --git a/tests/auto/quick/tests.pri b/tests/auto/quick/tests.pri index 56eee7199..3c56aef97 100644 --- a/tests/auto/quick/tests.pri +++ b/tests/auto/quick/tests.pri @@ -1,8 +1,6 @@ TEMPLATE = app -# FIXME: Re-enable once we want to run tests on the CI -# CONFIG += testcase - +CONFIG += testcase CONFIG += c++11 VPATH += $$_PRO_FILE_PWD_ -- cgit v1.2.3 From 0785e6d17820584fa089bf7fb5ca1ebb5292f41d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 19 Feb 2016 15:11:12 +0100 Subject: Enable quick/publicapi test in CI Also, update the API list. Change-Id: Ib21feb823ecf58c071316f796a7e251c9f99bff4 Reviewed-by: Kai Koehne --- tests/auto/quick/publicapi/publicapi.pro | 1 - tests/auto/quick/publicapi/tst_publicapi.cpp | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/quick/publicapi/publicapi.pro b/tests/auto/quick/publicapi/publicapi.pro index ab1b714e9..b178f56cd 100644 --- a/tests/auto/quick/publicapi/publicapi.pro +++ b/tests/auto/quick/publicapi/publicapi.pro @@ -1,4 +1,3 @@ include(../tests.pri) -CONFIG -= testcase # remove, once this passes in the CI QT += webengine QT_PRIVATE += webengine-private diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index face62352..be726437f 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -243,10 +243,12 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineDownloadItem.state --> DownloadState" << "QQuickWebEngineDownloadItem.totalBytes --> qlonglong" << "QQuickWebEngineDownloadItem.receivedBytes --> qlonglong" + << "QQuickWebEngineDownloadItem.mimeType --> QString" << "QQuickWebEngineDownloadItem.path --> QString" << "QQuickWebEngineDownloadItem.stateChanged() --> void" << "QQuickWebEngineDownloadItem.receivedBytesChanged() --> void" << "QQuickWebEngineDownloadItem.totalBytesChanged() --> void" + << "QQuickWebEngineDownloadItem.mimeTypeChanged() --> void" << "QQuickWebEngineDownloadItem.pathChanged() --> void" << "QQuickWebEngineDownloadItem.accept() --> void" << "QQuickWebEngineDownloadItem.cancel() --> void" @@ -291,7 +293,6 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineProfile.httpAcceptLanguageChanged() --> void" << "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadItem*) --> void" << "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadItem*) --> void" - << "QQuickWebEngineProfile.cookieStore() --> QWebEngineCookieStore*" << "QQuickWebEngineScript.Deferred --> InjectionPoint" << "QQuickWebEngineScript.DocumentReady --> InjectionPoint" << "QQuickWebEngineScript.DocumentCreation --> InjectionPoint" -- cgit v1.2.3 From 962a07b22c14c3fe8a9f539c7deecf6429a9f96c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 19 Feb 2016 15:12:40 +0100 Subject: Enable qquickwebenginedefaultsurfaceformat test in CI Change-Id: Ia0dcc45a3b63da49b82cd4f018979df43e847273 Reviewed-by: Kai Koehne --- .../qquickwebenginedefaultsurfaceformat.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro index e0d29a48a..826b47de7 100644 --- a/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro +++ b/tests/auto/quick/qquickwebenginedefaultsurfaceformat/qquickwebenginedefaultsurfaceformat.pro @@ -1,5 +1,4 @@ include(../tests.pri) -CONFIG -= testcase # remove, once this passes in the CI exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc QT_PRIVATE += webengine-private -- cgit v1.2.3 From e584796e1563358e9ac828552e6a187a9d8f2541 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Feb 2016 09:41:03 +0100 Subject: Add tools to project for Qt Creator Adds the tools and qmake scripts from qtwebengine to the project so that QtCreator can find them. This is the same we did in QtWebKit. Change-Id: I09ffdb6158adcbacd9dc4958ad199917e321498a Reviewed-by: Simon Hausmann --- qtwebengine.pro | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qtwebengine.pro b/qtwebengine.pro index 5156e4620..3d20cc2f4 100644 --- a/qtwebengine.pro +++ b/qtwebengine.pro @@ -1,2 +1,12 @@ load(qt_build_config) load(qt_parts) + +OTHER_FILES = \ + tools/buildscripts/* \ + tools/scripts/* \ + tools/qmake/config.tests/khr/* \ + tools/qmake/config.tests/libcap/* \ + tools/qmake/config.tests/libvpx/* \ + tools/qmake/config.tests/snappy/* \ + tools/qmake/config.tests/srtp/* \ + tools/qmake/mkspecs/features/* -- cgit v1.2.3 From f0ae944eaed5e551fd680bd0126f0f500faab432 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Feb 2016 10:27:13 +0100 Subject: Always reject non-overridable certificate errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't call the callback in case the error can't be allowed anyway, so we should tell the caller right away the error was denied. Task-number: QTBUG-50581 Change-Id: I8fcd72b7fbab5a8cbaffba95c6f97777c301cb64 Reviewed-by: Michael Brüning --- src/core/content_browser_client_qt.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 078874da1..18f8dbadd 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -400,9 +400,6 @@ void ContentBrowserClientQt::AllowCertificateError(int render_process_id, int re const base::Callback& callback, content::CertificateRequestResultType* result) { - // We leave the result with its default value. - Q_UNUSED(result); - content::RenderFrameHost *frameHost = content::RenderFrameHost::FromID(render_process_id, render_frame_id); WebContentsDelegateQt* contentsDelegate = 0; if (content::WebContents *webContents = frameHost->GetRenderViewHost()->GetDelegate()->GetAsWebContents()) @@ -410,6 +407,10 @@ void ContentBrowserClientQt::AllowCertificateError(int render_process_id, int re QSharedPointer errorController(new CertificateErrorController(new CertificateErrorControllerPrivate(cert_error, ssl_info, request_url, resource_type, overridable, strict_enforcement, callback))); contentsDelegate->allowCertificateError(errorController); + + // If we don't give the user a chance to allow it, we can reject it right away. + if (result && (!overridable || strict_enforcement)) + *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY; } content::LocationProvider *ContentBrowserClientQt::OverrideSystemLocationProvider() -- cgit v1.2.3 From 53944320a5e82943c3dfe11e74890f4928a15a47 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Feb 2016 15:24:46 +0100 Subject: Implement SSLHostStateDelegate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This class was introduced to track accepted certificate errors. Our lack of implementation caused a regression in certificate error handling. Task-number: QTBUG-51319 Change-Id: Idf3314fd17a5f9cb13a4513a3ccdb40954519c0d Reviewed-by: Michael Brüning --- src/core/browser_context_qt.cpp | 5 +- src/core/browser_context_qt.h | 2 + src/core/core_gyp_generator.pro | 2 + src/core/ssl_host_state_delegate_qt.cpp | 135 ++++++++++++++++++++++++++++++++ src/core/ssl_host_state_delegate_qt.h | 80 +++++++++++++++++++ 5 files changed, 223 insertions(+), 1 deletion(-) create mode 100644 src/core/ssl_host_state_delegate_qt.cpp create mode 100644 src/core/ssl_host_state_delegate_qt.h diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp index d21f963a9..902af8af9 100644 --- a/src/core/browser_context_qt.cpp +++ b/src/core/browser_context_qt.cpp @@ -41,6 +41,7 @@ #include "permission_manager_qt.h" #include "qtwebenginecoreglobal_p.h" #include "resource_context_qt.h" +#include "ssl_host_state_delegate_qt.h" #include "type_conversion.h" #include "url_request_context_getter_qt.h" @@ -132,7 +133,9 @@ content::PushMessagingService *BrowserContextQt::GetPushMessagingService() content::SSLHostStateDelegate* BrowserContextQt::GetSSLHostStateDelegate() { - return 0; + if (!sslHostStateDelegate) + sslHostStateDelegate.reset(new SSLHostStateDelegateQt(m_adapter)); + return sslHostStateDelegate.get(); } scoped_ptr BrowserContextQt::CreateZoomLevelDelegate(const base::FilePath&) diff --git a/src/core/browser_context_qt.h b/src/core/browser_context_qt.h index 9deb42b56..ba6e1dce1 100644 --- a/src/core/browser_context_qt.h +++ b/src/core/browser_context_qt.h @@ -48,6 +48,7 @@ namespace QtWebEngineCore { class BrowserContextAdapter; class PermissionManagerQt; +class SSLHostStateDelegateQt; class URLRequestContextGetterQt; class BrowserContextQt : public content::BrowserContext @@ -84,6 +85,7 @@ private: scoped_ptr resourceContext; scoped_refptr url_request_getter_; scoped_ptr permissionManager; + scoped_ptr sslHostStateDelegate; BrowserContextAdapter *m_adapter; friend class BrowserContextAdapter; diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index 0685abd7e..e018c010f 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -77,6 +77,7 @@ SOURCES = \ resource_bundle_qt.cpp \ resource_context_qt.cpp \ resource_dispatcher_host_delegate_qt.cpp \ + ssl_host_state_delegate_qt.cpp \ stream_video_node.cpp \ surface_factory_qt.cpp \ url_request_context_getter_qt.cpp \ @@ -149,6 +150,7 @@ HEADERS = \ renderer/web_channel_ipc_transport.h \ resource_context_qt.h \ resource_dispatcher_host_delegate_qt.h \ + ssl_host_state_delegate_qt.h \ stream_video_node.h \ surface_factory_qt.h \ type_conversion.h \ diff --git a/src/core/ssl_host_state_delegate_qt.cpp b/src/core/ssl_host_state_delegate_qt.cpp new file mode 100644 index 000000000..cf17b944c --- /dev/null +++ b/src/core/ssl_host_state_delegate_qt.cpp @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** 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 "ssl_host_state_delegate_qt.h" + +#include "type_conversion.h" + +namespace QtWebEngineCore { + +// Mirrors implementation in aw_ssl_host_state_delegate.cc + +static net::SHA256HashValue getChainFingerprint256(const net::X509Certificate &cert) +{ + net::SHA256HashValue fingerprint = + net::X509Certificate::CalculateChainFingerprint256(cert.os_cert_handle(), cert.GetIntermediateCertificates()); + return fingerprint; +} + +CertPolicy::CertPolicy() +{ +} + +CertPolicy::~CertPolicy() +{ +} + +bool CertPolicy::Check(const net::X509Certificate& cert, net::CertStatus error) const +{ + net::SHA256HashValue fingerprint = getChainFingerprint256(cert); + auto allowed_iter = m_allowed.find(fingerprint); + if ((allowed_iter != m_allowed.end()) && (allowed_iter->second & error) && ((allowed_iter->second & error) == error)) + return true; + return false; +} + +void CertPolicy::Allow(const net::X509Certificate& cert, net::CertStatus error) +{ + net::SHA256HashValue fingerprint = getChainFingerprint256(cert); + m_allowed[fingerprint] |= error; +} + +SSLHostStateDelegateQt::SSLHostStateDelegateQt(BrowserContextAdapter *contextAdapter) + : m_contextAdapter(contextAdapter) +{ +} + +SSLHostStateDelegateQt::~SSLHostStateDelegateQt() +{ +} + +void SSLHostStateDelegateQt::AllowCert(const std::string &host, const net::X509Certificate &cert, net::CertStatus error) +{ + m_certPolicyforHost[host].Allow(cert, error); +} + +// Clear all allow preferences. +void SSLHostStateDelegateQt::Clear() +{ + m_certPolicyforHost.clear(); +} + +// Queries whether |cert| is allowed for |host| and |error|. Returns true in +// |expired_previous_decision| if a previous user decision expired immediately +// prior to this query, otherwise false. +content::SSLHostStateDelegate::CertJudgment SSLHostStateDelegateQt::QueryPolicy( + const std::string &host, const net::X509Certificate &cert, + net::CertStatus error,bool *expired_previous_decision) +{ + return m_certPolicyforHost[host].Check(cert, error) ? SSLHostStateDelegate::ALLOWED : SSLHostStateDelegate::DENIED; +} + +// Records that a host has run insecure content. +void SSLHostStateDelegateQt::HostRanInsecureContent(const std::string &host, int pid) +{ +} + +// Returns whether the specified host ran insecure content. +bool SSLHostStateDelegateQt::DidHostRunInsecureContent(const std::string &host, int pid) const +{ + return false; +} + +// Revokes all SSL certificate error allow exceptions made by the user for +// |host|. +void SSLHostStateDelegateQt::RevokeUserAllowExceptions(const std::string &host) +{ + m_certPolicyforHost.erase(host); +} + +// Returns whether the user has allowed a certificate error exception for +// |host|. This does not mean that *all* certificate errors are allowed, just +// that there exists an exception. To see if a particular certificate and +// error combination exception is allowed, use QueryPolicy(). +bool SSLHostStateDelegateQt::HasAllowException(const std::string &host) const +{ + auto policy_iterator = m_certPolicyforHost.find(host); + return policy_iterator != m_certPolicyforHost.end() && + policy_iterator->second.HasAllowException(); +} + + +} // namespace QtWebEngineCore diff --git a/src/core/ssl_host_state_delegate_qt.h b/src/core/ssl_host_state_delegate_qt.h new file mode 100644 index 000000000..7c91fcb2d --- /dev/null +++ b/src/core/ssl_host_state_delegate_qt.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#ifndef SSL_HOST_STATE_DELEGATE_QT_H +#define SSL_HOST_STATE_DELEGATE_QT_H + +#include "content/public/browser/ssl_host_state_delegate.h" +#include "browser_context_adapter.h" + +namespace QtWebEngineCore { + +class CertPolicy { +public: + CertPolicy(); + ~CertPolicy(); + bool Check(const net::X509Certificate& cert, net::CertStatus error) const; + void Allow(const net::X509Certificate& cert, net::CertStatus error); + bool HasAllowException() const { return m_allowed.size() > 0; } + +private: + std::map m_allowed; +}; + +class SSLHostStateDelegateQt : public content::SSLHostStateDelegate { + +public: + SSLHostStateDelegateQt(BrowserContextAdapter *); + ~SSLHostStateDelegateQt(); + + // content::SSLHostStateDelegate implementation: + virtual void AllowCert(const std::string &, const net::X509Certificate &cert, net::CertStatus error) override; + virtual void Clear() override; + virtual CertJudgment QueryPolicy(const std::string &host, const net::X509Certificate &cert, + net::CertStatus error,bool *expired_previous_decision) override; + virtual void HostRanInsecureContent(const std::string &host, int pid) override; + virtual bool DidHostRunInsecureContent(const std::string &host, int pid) const override; + virtual void RevokeUserAllowExceptions(const std::string &host) override; + virtual bool HasAllowException(const std::string &host) const override; + +private: + BrowserContextAdapter *m_contextAdapter; + std::map m_certPolicyforHost; +}; + +} // namespace QtWebEngineCore + +#endif // SSL_HOST_STATE_DELEGATE_QT_H -- cgit v1.2.3 From 9b430876d31230b2fb4529889a5a6eaee5a2a37c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Feb 2016 09:56:53 +0100 Subject: Add chromium files to Qt project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will make them indexed by Qt Creator, but may make launching on a non-SSD slower. Change-Id: Ifa6e54c06ef06f68fa277a408fa7b0783d715199 Reviewed-by: Alexandru Croitor Reviewed-by: Michael Brüning Reviewed-by: Peter Varga --- src/core/core_module.pro | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 5300fdbbc..bed5b2905 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -96,3 +96,11 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat QMAKE_EXTRA_COMPILERS += icudt2build resources2build } } + +OTHER_FILES = \ + $$files(../3rdparty/chromium/*.h, true) \ + $$files(../3rdparty/chromium/*.cc, true) \ + $$files(../3rdparty/chromium/*.mm, true) \ + $$files(../3rdparty/chromium/*.py, true) \ + $$files(../3rdparty/chromium/*.gyp, true) \ + $$files(../3rdparty/chromium/*.gypi, true) -- cgit v1.2.3 From 73d747baaa85af47e582df84ca65aaee5d98d6b7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 19 Feb 2016 15:12:19 +0100 Subject: Enable WebEngineView tests in CI Change-Id: I6534d36279feffb66eb6a897ed31d4b013b39691 Reviewed-by: Kai Koehne Reviewed-by: Allan Sandfeld Jensen --- tests/auto/quick/qquickwebengineview/qquickwebengineview.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro index e0d29a48a..826b47de7 100644 --- a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro +++ b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro @@ -1,5 +1,4 @@ include(../tests.pri) -CONFIG -= testcase # remove, once this passes in the CI exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc QT_PRIVATE += webengine-private -- cgit v1.2.3 From 78b4090d3567317f2e5b710bb2c219ed483bc980 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 19 Feb 2016 15:07:33 +0100 Subject: Enable QtQuick inspectorserver test in CI Change-Id: I7c5f59a48688ca73889605ef5850ebedf43782de Reviewed-by: Kai Koehne --- tests/auto/quick/inspectorserver/BLACKLIST | 5 +++++ tests/auto/quick/inspectorserver/inspectorserver.pro | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tests/auto/quick/inspectorserver/BLACKLIST diff --git a/tests/auto/quick/inspectorserver/BLACKLIST b/tests/auto/quick/inspectorserver/BLACKLIST new file mode 100644 index 000000000..f80823bf3 --- /dev/null +++ b/tests/auto/quick/inspectorserver/BLACKLIST @@ -0,0 +1,5 @@ +[testRemoteDebuggingMessage] +osx + +[openRemoteDebuggingSession] +osx diff --git a/tests/auto/quick/inspectorserver/inspectorserver.pro b/tests/auto/quick/inspectorserver/inspectorserver.pro index 34e25487d..1a2c2f053 100644 --- a/tests/auto/quick/inspectorserver/inspectorserver.pro +++ b/tests/auto/quick/inspectorserver/inspectorserver.pro @@ -1,5 +1,4 @@ include(../tests.pri) -CONFIG -= testcase # remove, once this passes in the CI QT += webengine QT_PRIVATE += webengine-private DEFINES += IMPORT_DIR=\"\\\"$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP}imports\\\"\" -- cgit v1.2.3 From 562c0725807904c010ecab181bf4f06118aefb9e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 22 Feb 2016 09:20:52 +0100 Subject: Copy resources also for non-developer non-prefix builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8a31a83c996761e3997e5efa44aeaad04f24375f Reviewed-by: Michael Brüning --- src/core/core_module.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/core_module.pro b/src/core/core_module.pro index bed5b2905..d489892fd 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -76,9 +76,9 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat INSTALLS += icu locales resources } - !contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) { + !contains(QT_CONFIG, qt_framework):!force_independent { # - # Copy essential files to the qtbase build directory (for non-installed developer builds) + # Copy essential files to the qtbase build directory for non-prefix builds # icudt2build.input = icu.files -- cgit v1.2.3 From 68153bc7f83ad7adbafd6ca3fc14a6c10c7db076 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 12 Feb 2016 16:52:01 +0100 Subject: consistently put {qt,qml}_{module,plugin} at the end of project files this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: I1d1b38dd5f78d8a949bab7f9a4643a2430657458 Reviewed-by: Joerg Bornemann --- tests/auto/widgets/positionplugin/positionplugin.pro | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/auto/widgets/positionplugin/positionplugin.pro b/tests/auto/widgets/positionplugin/positionplugin.pro index bca3e5756..6f2e736c6 100644 --- a/tests/auto/widgets/positionplugin/positionplugin.pro +++ b/tests/auto/widgets/positionplugin/positionplugin.pro @@ -1,12 +1,13 @@ TARGET = qtwebengine_positioning_testplugin -QT += positioning -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = TestPositionPlugin -PLUGIN_EXTENDS = - -load(qt_plugin) +QT += positioning SOURCES += plugin.cpp OTHER_FILES += \ plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = TestPositionPlugin +PLUGIN_EXTENDS = - +load(qt_plugin) -- cgit v1.2.3 From c7ec715d51dbf47fa3cf706bcb8bfa13f5493f2e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 26 Feb 2016 14:40:57 +0100 Subject: Doc: Improve web engine profile class descriptions Add information about the most important methods and properties. Change-Id: I41ae039a0cc6084b62b492560def5eed7d8d3742 Reviewed-by: Kai Koehne --- src/webengine/api/qquickwebengineprofile.cpp | 24 +++++++++++++----- src/webenginewidgets/api/qwebengineprofile.cpp | 34 +++++++++++++++++++++----- 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 27457729f..3284d8491 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -54,17 +54,29 @@ QT_BEGIN_NAMESPACE /*! \class QQuickWebEngineProfile - \brief The QQuickWebEngineProfile class provides a web-engine profile shared by multiple pages. + \brief The QQuickWebEngineProfile class provides a web engine profile shared by multiple pages. \since 5.6 \inmodule QtWebEngine - QQuickWebEngineProfile contains settings, scripts, and the list of visited links shared by all - web engine pages that belong to the profile. As such, profiles can be used to isolate pages - from each other. A typical use case is a dedicated profile for a 'private browsing' mode. + A web engine profile contains properties and functionality shared by a group of web engine + pages. + + Information about visited links is stored together with persistent cookies and other persistent + data in a storage described by the persistentStoragePath property. + + Profiles can be used to isolate pages from each other. A typical use case is a dedicated + \e {off-the-record profile} for a \e {private browsing} mode. An off-the-record profile forces + cookies, the HTTP cache, and other normally persistent data to be stored only in memory. The + offTheRecord property holds whether a profile is off-the-record. + + The default profile can be accessed by defaultProfile(). It is a built-in profile that all + web pages not specifically created with another profile belong to. - The default profile is a built-in profile that all web pages not specifically created with - another profile belong to. + A WebEngineProfile instance can be created and accessed from C++ through the + QQuickWebEngineProfile class, which exposes further functionality in C++. This allows Qt Quick + applications to intercept URL requests (QQuickWebEngineProfile::setRequestInterceptor), or + register custom URL schemes (QQuickWebEngineProfile::installUrlSchemeHandler). */ /*! diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index 7f63b312f..894db3251 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -54,17 +54,39 @@ using QtWebEngineCore::BrowserContextAdapter; /*! \class QWebEngineProfile - \brief The QWebEngineProfile class provides a web-engine profile shared by multiple pages. + \brief The QWebEngineProfile class provides a web engine profile shared by multiple pages. \since 5.5 \inmodule QtWebEngineWidgets - QWebEngineProfile contains settings, scripts, and the list of visited links shared by all - web engine pages that belong to the profile. As such, profiles can be used to isolate pages - from each other. A typical use case is a dedicated profile for a 'private browsing' mode. + A web engine profile contains settings, scripts, persistent cookie policy, and the list of + visited links shared by all web engine pages that belong to the profile. - The default profile is a built-in profile that all web pages not specifically created with - another profile belong to. + All pages that belong to the profile share a common QWebEngineSettings instance, which can + be accessed with the settings() method. Likewise, the scripts() method provides access + to a common QWebEngineScriptCollection instance. + + Information about visited links is stored together with persistent cookies and other persistent + data in a storage returned by persistentStoragePath(). The cache can be cleared of links by + clearVisitedLinks() or clearAllVisitedLinks(). PersistentCookiesPolicy describes whether + session and persistent cookies are saved to and restored from memory or disk. + + Profiles can be used to isolate pages from each other. A typical use case is a dedicated + \e {off-the-record profile} for a \e {private browsing} mode. Using QWebEngineProfile() without + defining a storage name constructs a new off-the-record profile that leaves no record on the + local machine, and has no persistent data or cache. The isOffTheRecord() method can be used + to check whether a profile is off-the-record. + + The default profile can be accessed by defaultProfile(). It is a built-in profile that all + web pages not specifically created with another profile belong to. + + Implementing the QWebEngineUrlRequestInterceptor interface and registering the interceptor on a + profile by setRequestInterceptor() enables intercepting, blocking, and modifying URL + requests (QWebEngineUrlRequestInfo) before they reach the networking stack of Chromium. + + A QWebEngineUrlSchemeHandler can be registered for a profile by installUrlSchemeHandler() + to add support for custom URL schemes. Requests for the scheme are then issued to + QWebEngineUrlSchemeHandler::requestStarted() as QWebEngineUrlRequestJob objects. */ /*! -- cgit v1.2.3 From a8b47823d13e63d5d038e263b289e6e48b42afa0 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 26 Feb 2016 14:05:44 +0100 Subject: MSVC: Fix compiler warning Fix release build warning: api\qquickwebenginetestsupport.cpp(47) : warning C4100: 'success' : unreferenced formal parameter Change-Id: I3cdab22daa6b55abce55e217461952a192230428 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebenginetestsupport.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/webengine/api/qquickwebenginetestsupport.cpp b/src/webengine/api/qquickwebenginetestsupport.cpp index c081257e6..84d7d8c53 100644 --- a/src/webengine/api/qquickwebenginetestsupport.cpp +++ b/src/webengine/api/qquickwebenginetestsupport.cpp @@ -48,6 +48,7 @@ void QQuickWebEngineErrorPage::loadFinished(bool success, const QUrl &url) { // Loading of the error page should not fail. Q_ASSERT(success); + Q_UNUSED(success); QQuickWebEngineLoadRequest loadRequest(url, QQuickWebEngineView::LoadSucceededStatus); Q_EMIT loadingChanged(&loadRequest); -- cgit v1.2.3 From 193a2aaabfb45bedee5e9d6e9771d539af56c7d0 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 22 Feb 2016 16:15:41 +0100 Subject: Add minimal examples Task-number: QTBUG-51383 Change-Id: I872bdae7267e7dbf2a93a831d435517bcd4bad64 Reviewed-by: Leena Miettinen Reviewed-by: Michal Klocek Reviewed-by: Joerg Bornemann --- examples/examples.pro | 5 +- examples/webengine/minimal/doc/src/minimal.qdoc | 82 +++++++++++++++++++++ examples/webengine/minimal/main.cpp | 55 ++++++++++++++ examples/webengine/minimal/main.qml | 53 +++++++++++++ examples/webengine/minimal/minimal.pro | 10 +++ examples/webengine/minimal/qml.qrc | 6 ++ .../minimal/doc/images/minimal-example.png | Bin 0 -> 89294 bytes .../webenginewidgets/minimal/doc/src/minimal.qdoc | 66 +++++++++++++++++ examples/webenginewidgets/minimal/main.cpp | 54 ++++++++++++++ examples/webenginewidgets/minimal/minimal.pro | 8 ++ 10 files changed, 338 insertions(+), 1 deletion(-) create mode 100644 examples/webengine/minimal/doc/src/minimal.qdoc create mode 100644 examples/webengine/minimal/main.cpp create mode 100644 examples/webengine/minimal/main.qml create mode 100644 examples/webengine/minimal/minimal.pro create mode 100644 examples/webengine/minimal/qml.qrc create mode 100644 examples/webenginewidgets/minimal/doc/images/minimal-example.png create mode 100644 examples/webenginewidgets/minimal/doc/src/minimal.qdoc create mode 100644 examples/webenginewidgets/minimal/main.cpp create mode 100644 examples/webenginewidgets/minimal/minimal.pro diff --git a/examples/examples.pro b/examples/examples.pro index 867ce4cc6..342c2c311 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,11 +1,14 @@ TEMPLATE=subdirs qtHaveModule(webengine) { - SUBDIRS += webengine/quicknanobrowser + SUBDIRS += \ + webengine/minimal \ + webengine/quicknanobrowser } qtHaveModule(webenginewidgets) { SUBDIRS += \ + webenginewidgets/minimal \ webenginewidgets/contentmanipulation \ webenginewidgets/cookiebrowser \ webenginewidgets/demobrowser \ diff --git a/examples/webengine/minimal/doc/src/minimal.qdoc b/examples/webengine/minimal/doc/src/minimal.qdoc new file mode 100644 index 000000000..8dcaa3bb4 --- /dev/null +++ b/examples/webengine/minimal/doc/src/minimal.qdoc @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webengine/minimal + \title WebEngine Qt Quick Minimal Example + \ingroup webengine-examples + \brief Displays a web page using the Qt Quick integration of Qt WebEngine + + \image minimal-example.png + + \e {WebEngine Qt Quick Minimal Example} demonstrates how to use the + \l{WebEngineView} item to render a web page. It shows the minimum amount of + code needed to load and display an HTML page, and can be used as a basis for + further experimentation. + + \include examples-run.qdocinc + + \section1 C++ Code + + In \c main.cpp we use only the QGuiApplication and QQmlApplicationEngine + classes. We also include \c qtwebengineglobal.h to be able to use + \l{QtWebEngine::initialize}. + + \quotefromfile webengine/minimal/main.cpp + \skipto #include + \printto main + + In the main function we first instantiate a QGuiApplication object. + We then call \l{QtWebEngine::initialize}, which makes sure that OpenGL + contexts can be shared between the main process and the dedicated renderer + process (\c QtWebEngineProcess). This method needs to be called before + any OpenGL context is created. + + Then we create a QQmlApplicationEngine, and tell it to load \c main.qml + from the \l{The Qt Resource System}{Qt Resource System}. + + Finally, QGuiApplication::exec() launches the main event loop. + + \printuntil } + + \section1 QML Code + + In \c main.qml we create the top level window, set a sensible default size + and make it visible. The window will be filled by a WebEngineView item + loading \l{http://www.qt.io}{the Qt homepage}. + + \quotefromfile webengine/minimal/main.qml + \skipto import + \printuntil } + \printline } + + \section1 Requirements + + The example requires a working internet connection to render + \l{http://www.qt.io}{the Qt homepage}. + An optional system proxy should be picked up automatically. +*/ diff --git a/examples/webengine/minimal/main.cpp b/examples/webengine/minimal/main.cpp new file mode 100644 index 000000000..cc5a1f61e --- /dev/null +++ b/examples/webengine/minimal/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + QtWebEngine::initialize(); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + + return app.exec(); +} + diff --git a/examples/webengine/minimal/main.qml b/examples/webengine/minimal/main.qml new file mode 100644 index 000000000..f2d9f40b1 --- /dev/null +++ b/examples/webengine/minimal/main.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Window 2.0 +import QtWebEngine 1.0 + +Window { + width: 1024 + height: 750 + visible: true + WebEngineView { + anchors.fill: parent + url: "http://www.qt.io" + } +} diff --git a/examples/webengine/minimal/minimal.pro b/examples/webengine/minimal/minimal.pro new file mode 100644 index 000000000..23ce01d5b --- /dev/null +++ b/examples/webengine/minimal/minimal.pro @@ -0,0 +1,10 @@ +TEMPLATE = app + +QT += webengine + +SOURCES += main.cpp + +RESOURCES += qml.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/webengine/minimal +INSTALLS += target diff --git a/examples/webengine/minimal/qml.qrc b/examples/webengine/minimal/qml.qrc new file mode 100644 index 000000000..0ff3892d9 --- /dev/null +++ b/examples/webengine/minimal/qml.qrc @@ -0,0 +1,6 @@ + + + main.qml + + + diff --git a/examples/webenginewidgets/minimal/doc/images/minimal-example.png b/examples/webenginewidgets/minimal/doc/images/minimal-example.png new file mode 100644 index 000000000..18ac9b177 Binary files /dev/null and b/examples/webenginewidgets/minimal/doc/images/minimal-example.png differ diff --git a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc new file mode 100644 index 000000000..2754b36e0 --- /dev/null +++ b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example webenginewidgets/minimal + \title WebEngine Widgets Minimal Example + \ingroup webengine-widgetexamples + \brief Displays a web page using Qt WebEngine Widgets + + \image minimal-example.png + + \e {WebEngine Widgets Minimal Example} demonstrates how to use + \l{QWebEngineView} to render a web page. It shows the minimum amount of code + needed to load and display an HTML page, and can be used as a basis for + further experimentation. + + \include examples-run.qdocinc + + \section1 The Code + + In \c main.cpp we instantiate a QApplication and a QWebEngineView. The URL + to load is set by calling \l QWebEngineView::setUrl. The view widget is + given a reasonable default size, and shown. + Finally, QApplication::exec() launches the main event loop. + + \quotefromfile webenginewidgets/minimal/main.cpp + \skipto #include + + \printuntil } + + \section1 Requirements + + The example requires a working internet connection to render + \l{http://www.qt.io}{the Qt homepage}. + An optional system proxy should be picked up automatically. + However, for proxies that require a username or password, + you need to connect to + QWebEnginePage::proxyAuthenticationRequired. + + \l{Qt WebEngine Widgets} uses the \l{Qt Quick Scene Graph} to compose the + page. Therefore, OpenGL support is required. +*/ diff --git a/examples/webenginewidgets/minimal/main.cpp b/examples/webenginewidgets/minimal/main.cpp new file mode 100644 index 000000000..d9a137739 --- /dev/null +++ b/examples/webenginewidgets/minimal/main.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QWebEngineView view; + view.setUrl(QUrl(QStringLiteral("http://www.qt.io"))); + view.resize(1024, 750); + view.show(); + + return app.exec(); +} diff --git a/examples/webenginewidgets/minimal/minimal.pro b/examples/webenginewidgets/minimal/minimal.pro new file mode 100644 index 000000000..849f4b9b6 --- /dev/null +++ b/examples/webenginewidgets/minimal/minimal.pro @@ -0,0 +1,8 @@ +TEMPLATE = app + +QT += webenginewidgets + +SOURCES += main.cpp + +target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/minimal +INSTALLS += target -- cgit v1.2.3 From d6c32fa215080ad8094c699f40e1823d3ca2a14c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 29 Feb 2016 11:07:06 +0100 Subject: Enable qmltests in CI Blacklist failing tests. Stabilize some tests. Change-Id: I9fba81fb70f5b358108ef6935e363297e2658f79 Reviewed-by: Allan Sandfeld Jensen --- tests/auto/quick/qmltests/BLACKLIST | 8 ++++++++ tests/auto/quick/qmltests/data/tst_download.qml | 2 +- tests/auto/quick/qmltests/data/tst_geopermission.qml | 19 +++++++++++++------ tests/auto/quick/qmltests/qmltests.pro | 1 - 4 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 tests/auto/quick/qmltests/BLACKLIST diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST new file mode 100644 index 000000000..035e49a83 --- /dev/null +++ b/tests/auto/quick/qmltests/BLACKLIST @@ -0,0 +1,8 @@ +[DesktopWebEngineViewLinkHovered::test_linkHovered] +* + +[WebViewGeopermission::test_deniedGeolocationByUser] +osx + +[WebViewGeopermission::test_geoPermissionRequest] +osx diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml index 415318ed7..70a31d755 100644 --- a/tests/auto/quick/qmltests/data/tst_download.qml +++ b/tests/auto/quick/qmltests/data/tst_download.qml @@ -127,7 +127,7 @@ TestWebEngineView { compare(downloadState[1], WebEngineDownloadItem.DownloadInProgress) downloadFinishedSpy.wait() compare(totalBytes, receivedBytes) - compare(downloadState[2], WebEngineDownloadItem.DownloadCompleted) + tryCompare(downloadState, 2, WebEngineDownloadItem.DownloadCompleted) } function test_downloadCancelled() { diff --git a/tests/auto/quick/qmltests/data/tst_geopermission.qml b/tests/auto/quick/qmltests/data/tst_geopermission.qml index acb561825..e18b40f1d 100644 --- a/tests/auto/quick/qmltests/data/tst_geopermission.qml +++ b/tests/auto/quick/qmltests/data/tst_geopermission.qml @@ -50,7 +50,7 @@ TestWebEngineView { property bool deniedGeolocation: false property bool geoPermissionRequested: false - property string consoleErrorMessage: "" + signal consoleErrorMessage(string message) SignalSpy { id: featurePermissionSpy @@ -58,6 +58,12 @@ TestWebEngineView { signalName: "featurePermissionRequested" } + SignalSpy { + id: consoleErrorMessageSpy + target: webEngineView + signalName: "consoleErrorMessage" + } + onFeaturePermissionRequested: { if (feature === WebEngineView.Geolocation) { geoPermissionRequested = true @@ -72,7 +78,7 @@ TestWebEngineView { onJavaScriptConsoleMessage: { if (level === WebEngineView.ErrorMessageLevel) - consoleErrorMessage = message + consoleErrorMessage(message) } TestCase { @@ -81,8 +87,8 @@ TestWebEngineView { function init() { deniedGeolocation = false - consoleErrorMessage = "" featurePermissionSpy.clear() + consoleErrorMessageSpy.clear() } function test_geoPermissionRequest() { @@ -91,15 +97,16 @@ TestWebEngineView { featurePermissionSpy.wait() verify(geoPermissionRequested) compare(featurePermissionSpy.count, 1) - if (consoleErrorMessage) // Print the error message if it fails to get user's location - fail(consoleErrorMessage) + if (consoleErrorMessageSpy.count) // Print the error message if it fails to get user's location + fail(consoleErrorMessageSpy.signalArguments[0][0]) } function test_deniedGeolocationByUser() { deniedGeolocation = true webEngineView.url = Qt.resolvedUrl("geolocation.html") featurePermissionSpy.wait() - compare(consoleErrorMessage, "User denied Geolocation") + consoleErrorMessageSpy.wait() + compare(consoleErrorMessageSpy.signalArguments[0][0], "User denied Geolocation") } } } diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro index 281676b6a..57649384d 100644 --- a/tests/auto/quick/qmltests/qmltests.pro +++ b/tests/auto/quick/qmltests/qmltests.pro @@ -1,5 +1,4 @@ include(../tests.pri) -CONFIG -= testcase # remove, once this passes in the CI QT += qmltest -- cgit v1.2.3 From b4ef618b999eab335911a13d185d29e71f1ff5e2 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 17 Feb 2016 13:18:07 +0100 Subject: ICU: Sync use_system_icu and icu_use_data_file_flag If we use the system ICU we do not need to care about loading the data file. Task-number: QTBUG-51156 Change-Id: I9f9c61c39db50663105e99af001c7e9f56322717 Reviewed-by: Joerg Bornemann --- src/core/config/linux.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 00e25ec58..88c1a41aa 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -40,6 +40,6 @@ use?(system_jsoncpp): GYP_CONFIG += use_system_jsoncpp=1 use?(system_opus): GYP_CONFIG += use_system_opus=1 use?(system_snappy): GYP_CONFIG += use_system_snappy=1 use?(system_vpx): GYP_CONFIG += use_system_libvpx=1 -use?(system_icu): GYP_CONFIG += use_system_icu=1 +use?(system_icu): GYP_CONFIG += use_system_icu=1 icu_use_data_file_flag=0 use?(system_ffmpeg): GYP_CONFIG += use_system_ffmpeg=1 -- cgit v1.2.3 From eda6a3559b303c9e13d755efd4af17fbe2ac9c95 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 18 Feb 2016 08:35:48 +0100 Subject: ICU: Do not try to search for icudtl.dat for WEBENGINE_CONFIG+=system_icu Do not try to find icudt.dat if we use system ICU. This avoids warnings like Qt WebEngine ICU data not found at /usr/share/qt5/resources. Trying parent directory... Qt WebEngine ICU data not found at /usr/share/qt5. Trying application directory... Qt WebEngine ICU data not found at /bin. Trying fallback directory... The application MAY NOT work. on every startup, e.g. for embedded linux. The defines and macros are the same as in chromium. Task-number: QTBUG-51156 Change-Id: I6c24b73cca88020504489695e889f49c5d7be424 Reviewed-by: Allan Sandfeld Jensen --- src/core/content_main_delegate_qt.cpp | 7 +++++++ src/core/qtwebengine.gypi | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index 0688fb015..0a7233853 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -94,10 +94,17 @@ content::ContentRendererClient *ContentMainDelegateQt::CreateContentRendererClie return new ContentRendererClientQt; } +// see icu_util.cc +#define ICU_UTIL_DATA_FILE 0 +#define ICU_UTIL_DATA_SHARED 1 +#define ICU_UTIL_DATA_STATIC 2 + bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code) { PathService::Override(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE)); +#if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE PathService::Override(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA)); +#endif PathService::Override(content::DIR_MEDIA_LIBS, WebEngineLibraryInfo::getPath(content::DIR_MEDIA_LIBS)); PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES)); diff --git a/src/core/qtwebengine.gypi b/src/core/qtwebengine.gypi index 96b48e2ca..fc5f17281 100644 --- a/src/core/qtwebengine.gypi +++ b/src/core/qtwebengine.gypi @@ -119,5 +119,16 @@ ['OS=="mac"', { 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']}, }], + ['icu_use_data_file_flag==1', { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'], + }, { # else icu_use_data_file_flag !=1 + 'conditions': [ + ['OS=="win"', { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'], + }, { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'], + }], + ], + }], ], } -- cgit v1.2.3 From 039e7622a3e8e99a5b8269d77d47af28365e20bf Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 19 Feb 2016 11:28:54 +0100 Subject: Revert "Disable using the ICU data file on embedded linux" This reverts commit c5957ac90cbaccccbd58b3fc73f94cf0d4795e54. It was based on the assumption that we remove system ICU, which got removed in commit 94b550ebee2858756a293aacf7e78e7ce11bb9c9. Task-number: QTBUG-51156 Change-Id: I7ac1adb414d250b2887af936ae3dc74a919a0890 Reviewed-by: Allan Sandfeld Jensen --- src/core/config/embedded_linux.pri | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/config/embedded_linux.pri b/src/core/config/embedded_linux.pri index 50f94147e..41891859d 100644 --- a/src/core/config/embedded_linux.pri +++ b/src/core/config/embedded_linux.pri @@ -35,7 +35,6 @@ GYP_CONFIG += \ use_libpci=0 \ use_ozone=1 \ use_system_fontconfig=1 \ - icu_use_data_file_flag=0 \ use_x11=0 \ v8_use_snapshot=false \ want_separate_host_toolset=1 \ -- cgit v1.2.3 From b5a66cf0b138cfe6491e7aaf70a744fadbda0bf2 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 1 Mar 2016 15:56:37 +0100 Subject: Configure MIPS architecure for gyp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parses MIPS architecture information on from qmake to gyp. Task-number: QTBUG-51580 Change-Id: Icdd164aa1379b7f0b93773cb061f95f204db8494 Reviewed-by: Michael Brüning --- src/3rdparty | 2 +- src/core/gyp_run.pro | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index 779a2388f..5c5c957c8 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 779a2388fc123a7f3a178ce2ced921ee4a307e2c +Subproject commit 5c5c957c847e6f23ba010bb504920b472da57b00 diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro index dea1a2225..5bedc9acb 100644 --- a/src/core/gyp_run.pro +++ b/src/core/gyp_run.pro @@ -83,9 +83,22 @@ contains(QT_ARCH, "arm") { contains(QMAKE_CFLAGS, "-mthumb"): GYP_CONFIG += arm_thumb=1 } +contains(QT_ARCH, "mips") { + !cross_compile: GYP_CONFIG += sysroot=\"\" + GYP_CONFIG += target_arch=mipsel + + contains(QMAKE_CFLAGS, "mips32r6"): mips_arch_variant=\"r6\" + else: contains(QMAKE_CFLAGS, "mips32r2"): mips_arch_variant=\"r2\" + else: contains(QMAKE_CFLAGS, "mips32"): mips_arch_variant=\"r1\" + + contains(QMAKE_CFLAGS, "-mdsp2"): GYP_CONFIG += mips_dsp_rev=2 + else: contains(QMAKE_CFLAGS, "-mdsp"): GYP_CONFIG += mips_dsp_rev=1 +} + contains(QT_ARCH, "x86_64"): GYP_CONFIG += target_arch=x64 contains(QT_ARCH, "i386"): GYP_CONFIG += target_arch=ia32 contains(QT_ARCH, "arm64"): GYP_CONFIG += target_arch=arm64 +contains(QT_ARCH, "mips64"): GYP_CONFIG += target_arch=mips64el contains(WEBENGINE_CONFIG, use_proprietary_codecs): GYP_CONFIG += proprietary_codecs=1 ffmpeg_branding=Chrome -- cgit v1.2.3 From 4c996aa2ccac13d3668a1a6c9df6fdc0dc3a321e Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 4 Mar 2016 11:28:25 +0100 Subject: Doc: fix links in the minimal example docs ...to use the external link specified in qtbase\doc\global\externalsites\qt-webpages.qdoc Change-Id: Ieeade45440a5454ec7856230510f3914b1a56800 Reviewed-by: Joerg Bornemann --- examples/webengine/minimal/doc/src/minimal.qdoc | 6 +++--- examples/webenginewidgets/minimal/doc/src/minimal.qdoc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/webengine/minimal/doc/src/minimal.qdoc b/examples/webengine/minimal/doc/src/minimal.qdoc index 8dcaa3bb4..c0b89ba5a 100644 --- a/examples/webengine/minimal/doc/src/minimal.qdoc +++ b/examples/webengine/minimal/doc/src/minimal.qdoc @@ -67,7 +67,7 @@ In \c main.qml we create the top level window, set a sensible default size and make it visible. The window will be filled by a WebEngineView item - loading \l{http://www.qt.io}{the Qt homepage}. + loading the \l{Qt Homepage}. \quotefromfile webengine/minimal/main.qml \skipto import @@ -76,7 +76,7 @@ \section1 Requirements - The example requires a working internet connection to render - \l{http://www.qt.io}{the Qt homepage}. + The example requires a working internet connection to render the + \l{Qt Homepage}. An optional system proxy should be picked up automatically. */ diff --git a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc index 2754b36e0..22f28e604 100644 --- a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc +++ b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc @@ -55,7 +55,7 @@ \section1 Requirements The example requires a working internet connection to render - \l{http://www.qt.io}{the Qt homepage}. + the \l{Qt Homepage}. An optional system proxy should be picked up automatically. However, for proxies that require a username or password, you need to connect to -- cgit v1.2.3 From e661017dc52b9742ee1708578d731dd64232d57a Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 2 Mar 2016 16:06:57 +0100 Subject: Doc: Building with macx-clang-32 not supported Task-number: QTBUG-51139 Change-Id: I0597651b9722e0a62f2c569980f183dd2df00221 Reviewed-by: Venugopal Shivashankar Reviewed-by: Allan Sandfeld Jensen --- src/webengine/doc/src/qtwebengine-platform-notes.qdoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc index f177c9598..9b419e1ff 100644 --- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc +++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc @@ -50,6 +50,9 @@ \li OS X: Xcode version 5.1 or later on OS X 10.9 or later \endlist + \note Qt WebEngine cannot be built for the 32-bit mode of OS X (using the + macx-clang-32 mkspec). + \section1 Pepper Plugin API Support Qt WebEngine supports loading Pepper Plugin API (PPAPI) plugins. The plugins must be loaded -- cgit v1.2.3 From 3543801a5653aeb68e3b05c892a1136319a0110d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 29 Feb 2016 16:14:44 +0100 Subject: Remove test for unimplemented Web SQL Database API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QWebEngine will not provide a wrapper API for the now deprecated Web SQL Database HTML5 API. Change-Id: I8864b202ce9200145953ba5273f86eddff9e133a Task-number: QTBUG-51346 Reviewed-by: Michael Brüning Reviewed-by: Allan Sandfeld Jensen --- .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 59 ---------------------- 1 file changed, 59 deletions(-) diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 207eb019a..75672825c 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -128,7 +128,6 @@ private Q_SLOTS: void modified(); void contextMenuCrash(); void updatePositionDependentActionsCrash(); - void database(); void createPluginWithPluginsEnabled(); void createPluginWithPluginsDisabled(); void destroyPlugin_data(); @@ -792,64 +791,6 @@ void tst_QWebEnginePage::contextMenuCrash() #endif } -void tst_QWebEnginePage::database() -{ -#if !defined(QWEBENGINEDATABASE) - QSKIP("QWEBENGINEDATABASE"); -#else - QString path = tmpDirPath(); - m_page->settings()->setOfflineStoragePath(path); - QVERIFY(m_page->settings()->offlineStoragePath() == path); - - QWebEngineSettings::setOfflineStorageDefaultQuota(1024 * 1024); - QVERIFY(QWebEngineSettings::offlineStorageDefaultQuota() == 1024 * 1024); - - m_page->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true); - m_page->settings()->setAttribute(QWebEngineSettings::OfflineStorageDatabaseEnabled, true); - - QString dbFileName = path + "Databases.db"; - - if (QFile::exists(dbFileName)) - QFile::remove(dbFileName); - - qRegisterMetaType("QWebEngineFrame*"); - QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebEngineFrame*,QString))); - m_view->setHtml(QString("
"), QUrl("http://www.myexample.com")); - QTRY_COMPARE(spy.count(), 1); - evaluateJavaScriptSync(m_page, "var db2; db2=openDatabase('testdb', '1.0', 'test database API', 50000);"); - QTRY_COMPARE(spy.count(),1); - - evaluateJavaScriptSync(m_page, "localStorage.test='This is a test for local storage';"); - m_view->setHtml(QString("text"), QUrl("http://www.myexample.com")); - - QVariant s1 = evaluateJavaScriptSync(m_page, "localStorage.test"); - QCOMPARE(s1.toString(), QString("This is a test for local storage")); - - evaluateJavaScriptSync(m_page, "sessionStorage.test='This is a test for session storage';"); - m_view->setHtml(QString("text"), QUrl("http://www.myexample.com")); - QVariant s2 = evaluateJavaScriptSync(m_page, "sessionStorage.test"); - QCOMPARE(s2.toString(), QString("This is a test for session storage")); - - m_view->setHtml(QString("
"), QUrl("http://www.myexample.com")); - evaluateJavaScriptSync(m_page, "var db3; db3=openDatabase('testdb', '1.0', 'test database API', 50000);db3.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Test (text TEXT)', []); }, function(tx, result) { }, function(tx, error) { });"); - QTest::qWait(200); - - // Remove all databases. - QWebEngineSecurityOrigin origin = m_page->mainFrame()->securityOrigin(); - QList dbs = origin.databases(); - for (int i = 0; i < dbs.count(); i++) { - QString fileName = dbs[i].fileName(); - QVERIFY(QFile::exists(fileName)); - QWebEngineDatabase::removeDatabase(dbs[i]); - QVERIFY(!QFile::exists(fileName)); - } - QVERIFY(!origin.databases().size()); - // Remove removed test :-) - QWebEngineDatabase::removeAllDatabases(); - QVERIFY(!origin.databases().size()); -#endif -} - #if defined(QWEBENGINEPAGE_CREATEPLUGIN) class PluginPage : public QWebEnginePage { -- cgit v1.2.3 From 0110b93af4ab61a5b86643c2be8c6f34648bbaaf Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 29 Feb 2016 18:49:24 +0100 Subject: Remove skipped test tst_QWebEnginePage::popupFocus This test makes only sense in QtWebKit where HTML input elements are implemented with Qt widgets (e.g. QComboBox). Change-Id: I0fdd63530db762595df7ca370ff2f9b1d73cc0a8 Reviewed-by: Allan Sandfeld Jensen --- .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 46 ---------------------- 1 file changed, 46 deletions(-) diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 75672825c..d0252f5b8 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -213,9 +213,6 @@ private Q_SLOTS: void setHtmlWithBaseURL(); void setHtmlWithJSAlert(); void metaData(); -#if !defined(QT_NO_COMBOBOX) - void popupFocus(); -#endif void inputFieldFocus(); void hitTestContent(); void baseUrl_data(); @@ -4141,49 +4138,6 @@ void tst_QWebEnginePage::metaData() #endif } -#if !defined(QT_NO_COMBOBOX) -void tst_QWebEnginePage::popupFocus() -{ -#if !defined(QWEBENGINEELEMENT) - QSKIP("QWEBENGINEELEMENT"); -#else - QWebEngineView view; - view.setHtml("" - " " - " " - " " - " " - " " - ""); - view.resize(400, 100); - // Call setFocus before show to work around http://bugreports.qt.nokia.com/browse/QTBUG-14762 - view.setFocus(); - view.show(); - QTest::qWaitForWindowExposed(&view); - view.activateWindow(); - QTRY_VERIFY(view.hasFocus()); - - // open the popup by clicking. check if focus is on the popup - const QWebEngineElement webCombo = view.page()->documentElement().findFirst(QLatin1String("select[name=select]")); - QTest::mouseClick(&view, Qt::LeftButton, 0, webCombo.geometry().center()); - - QComboBox* combo = view.findChild(); - QVERIFY(combo != 0); - QTRY_VERIFY(!view.hasFocus() && combo->view()->hasFocus()); // Focus should be on the popup - - // hide the popup and check if focus is on the page - combo->hidePopup(); - QTRY_VERIFY(view.hasFocus()); // Focus should be back on the WebView -#endif -} -#endif - void tst_QWebEnginePage::inputFieldFocus() { #if !defined(QWEBENGINEELEMENT) -- cgit v1.2.3 From 471d484bea6b8b84749b8d89c603cb8394f1b5ee Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Fri, 4 Mar 2016 17:39:48 +0100 Subject: Blacklist test_geoPermissionRequest on Windows as well. Change-Id: I94aa72517dfedc22d9100b85e4d66dbf67bb3207 Reviewed-by: Joerg Bornemann --- tests/auto/quick/qmltests/BLACKLIST | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST index 035e49a83..3abcd82d0 100644 --- a/tests/auto/quick/qmltests/BLACKLIST +++ b/tests/auto/quick/qmltests/BLACKLIST @@ -6,3 +6,4 @@ osx [WebViewGeopermission::test_geoPermissionRequest] osx +windows -- cgit v1.2.3