Commit 6b6eb912 authored by Szabolcs David's avatar Szabolcs David
Browse files

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: default avatarAndras Becsi <andras.becsi@digia.com>
Showing with 4 additions and 5 deletions
...@@ -334,7 +334,7 @@ WebView::WebView(QWidget* parent) ...@@ -334,7 +334,7 @@ WebView::WebView(QWidget* parent)
connect(this, SIGNAL(loadProgress(int)), connect(this, SIGNAL(loadProgress(int)),
this, SLOT(setProgress(int))); this, SLOT(setProgress(int)));
connect(this, SIGNAL(loadFinished(bool)), connect(this, SIGNAL(loadFinished(bool)),
this, SLOT(loadFinished())); this, SLOT(loadFinished(bool)));
connect(page(), SIGNAL(loadingUrl(QUrl)), connect(page(), SIGNAL(loadingUrl(QUrl)),
this, SIGNAL(urlChanged(QUrl))); this, SIGNAL(urlChanged(QUrl)));
connect(page(), SIGNAL(iconUrlChanged(QUrl)), connect(page(), SIGNAL(iconUrlChanged(QUrl)),
...@@ -410,9 +410,9 @@ void WebView::setProgress(int progress) ...@@ -410,9 +410,9 @@ void WebView::setProgress(int progress)
m_progress = 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() qWarning() << "Received finished signal while progress is still:" << progress()
<< "Url:" << url(); << "Url:" << url();
} }
......
...@@ -116,7 +116,7 @@ signals: ...@@ -116,7 +116,7 @@ signals:
private slots: private slots:
void setProgress(int progress); void setProgress(int progress);
void loadFinished(); void loadFinished(bool success);
void setStatusBarText(const QString &string); void setStatusBarText(const QString &string);
void downloadRequested(const QNetworkRequest &request); void downloadRequested(const QNetworkRequest &request);
void openLinkInNewTab(); void openLinkInNewTab();
......
...@@ -170,7 +170,6 @@ void WebContentsDelegateQt::DidFinishLoad(int64, const GURL &url, bool is_main_f ...@@ -170,7 +170,6 @@ void WebContentsDelegateQt::DidFinishLoad(int64, const GURL &url, bool is_main_f
} }
if (is_main_frame) { if (is_main_frame) {
m_viewClient->loadProgressChanged(100);
m_viewClient->loadFinished(true, toQt(url)); m_viewClient->loadFinished(true, toQt(url));
content::NavigationEntry *entry = web_contents()->GetController().GetActiveEntry(); content::NavigationEntry *entry = web_contents()->GetController().GetActiveEntry();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment