summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2014-12-22 17:15:49 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2015-03-06 21:38:27 +0000
commit42c39d0545ee98feccf6d8059aee082c47a8e730 (patch)
tree450b742d81007c3a8b783fb2316ed4eb64bb42d1 /src/webenginewidgets
parentb802ad902e4ebe7633b2d8df08b1a0d50fcc2dc8 (diff)
Add testsupport QML API and error page signals
The testsupport API is used for test those features that are not planned to be accessible via the public API. For example, signals of the chromium's error page should not be visible for the develepor but it is important to test whether the error page is loaded properly. Change-Id: Ie5b3265a207d05649cabd624a001a6ffe2e45971 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp14
-rw-r--r--src/webenginewidgets/api/qwebenginepage_p.h4
2 files changed, 13 insertions, 5 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index f4ec57342..7eab1dc71 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -242,10 +242,14 @@ qreal QWebEnginePagePrivate::dpiScale() const
return 1.0;
}
-void QWebEnginePagePrivate::loadStarted(const QUrl &provisionalUrl)
+void QWebEnginePagePrivate::loadStarted(const QUrl &provisionalUrl, bool isErrorPage)
{
- Q_UNUSED(provisionalUrl)
+ Q_UNUSED(provisionalUrl);
Q_Q(QWebEnginePage);
+
+ if (isErrorPage)
+ return;
+
isLoading = true;
Q_EMIT q->loadStarted();
updateNavigationActions();
@@ -256,12 +260,16 @@ void QWebEnginePagePrivate::loadCommitted()
updateNavigationActions();
}
-void QWebEnginePagePrivate::loadFinished(bool success, const QUrl &url, int errorCode, const QString &errorDescription)
+void QWebEnginePagePrivate::loadFinished(bool success, const QUrl &url, bool isErrorPage, int errorCode, const QString &errorDescription)
{
Q_Q(QWebEnginePage);
Q_UNUSED(url);
Q_UNUSED(errorCode);
Q_UNUSED(errorDescription);
+
+ if (isErrorPage)
+ return;
+
isLoading = false;
if (success)
explicitUrl = QUrl();
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
index b6da844d8..087137a78 100644
--- a/src/webenginewidgets/api/qwebenginepage_p.h
+++ b/src/webenginewidgets/api/qwebenginepage_p.h
@@ -118,10 +118,10 @@ public:
virtual void selectionChanged() Q_DECL_OVERRIDE;
virtual QRectF viewportRect() const Q_DECL_OVERRIDE;
virtual qreal dpiScale() const Q_DECL_OVERRIDE;
- virtual void loadStarted(const QUrl &provisionalUrl) Q_DECL_OVERRIDE;
+ virtual void loadStarted(const QUrl &provisionalUrl, bool isErrorPage = false) Q_DECL_OVERRIDE;
virtual void loadCommitted() Q_DECL_OVERRIDE;
virtual void loadVisuallyCommitted() Q_DECL_OVERRIDE { }
- virtual void loadFinished(bool success, const QUrl &url, int errorCode = 0, const QString &errorDescription = QString()) Q_DECL_OVERRIDE;
+ virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) Q_DECL_OVERRIDE;
virtual void focusContainer() Q_DECL_OVERRIDE;
virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
virtual void adoptNewWindow(QtWebEngineCore::WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) Q_DECL_OVERRIDE;