From 6b6eb9126e4ba66621cdb3c26c0c025a1f2154dc Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Tue, 9 Sep 2014 06:23:02 -0700 Subject: Fix tst_QWebEngineFrame::progressSignal API test case This test fails, because we get two loadProgress signals with the 100 value if the page load is successful. Change-Id: Idbd68c28ba81f8ff0a5b1d98aece82e7a940f1b9 Reviewed-by: Andras Becsi --- examples/webenginewidgets/browser/webview.cpp | 6 +++--- examples/webenginewidgets/browser/webview.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/webenginewidgets/browser/webview.cpp b/examples/webenginewidgets/browser/webview.cpp index ce0f7c418..7ede97b69 100644 --- a/examples/webenginewidgets/browser/webview.cpp +++ b/examples/webenginewidgets/browser/webview.cpp @@ -334,7 +334,7 @@ WebView::WebView(QWidget* parent) connect(this, SIGNAL(loadProgress(int)), this, SLOT(setProgress(int))); connect(this, SIGNAL(loadFinished(bool)), - this, SLOT(loadFinished())); + this, SLOT(loadFinished(bool))); connect(page(), SIGNAL(loadingUrl(QUrl)), this, SIGNAL(urlChanged(QUrl))); connect(page(), SIGNAL(iconUrlChanged(QUrl)), @@ -410,9 +410,9 @@ void WebView::setProgress(int progress) m_progress = progress; } -void WebView::loadFinished() +void WebView::loadFinished(bool success) { - if (100 != m_progress) { + if (success && 100 != m_progress) { qWarning() << "Received finished signal while progress is still:" << progress() << "Url:" << url(); } diff --git a/examples/webenginewidgets/browser/webview.h b/examples/webenginewidgets/browser/webview.h index 2238abbd5..2cedeb79b 100644 --- a/examples/webenginewidgets/browser/webview.h +++ b/examples/webenginewidgets/browser/webview.h @@ -116,7 +116,7 @@ signals: private slots: void setProgress(int progress); - void loadFinished(); + void loadFinished(bool success); void setStatusBarText(const QString &string); void downloadRequested(const QNetworkRequest &request); void openLinkInNewTab(); -- cgit v1.2.3