summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebengineprofile
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-02-05 13:27:14 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-02-10 14:49:01 +0000
commit9db27320eda70ec4e4948ae0853dd3f2dd08912b (patch)
tree78ac95011fc1ac4929439573e931eece166ad9a3 /tests/auto/widgets/qwebengineprofile
parent776442f2117c4b2d6dac75ab56b42bd82e2ce6d0 (diff)
Fix double LoadFinished on URL errors
RenderFrameDeleted was called before DidFinishLoad, which meant m_loadingErrorFrameList was empty and wouldn't detect the page loaded was an error page. Instead this patch relies on the chromium error-page url which we already asserted. Additonally we delay emitting the loadFinished signal until the error page is also done loading, since the error-page can be considered part of the load, and we otherwise have a race condition on toPlainText. Finally we were not getting error-pages when blocking requests because we reported them as aborted them instead of blocked. Change-Id: I945eb838b7f080d4e146f18354e8986e1b88b5cd Task-number: QTBUG-50752 Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'tests/auto/widgets/qwebengineprofile')
-rw-r--r--tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
index 9195a5190..7cd423356 100644
--- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
+++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
@@ -182,9 +182,10 @@ void tst_QWebEngineProfile::urlSchemeHandlerFailRequest()
QWebEngineView view;
QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
view.setPage(new QWebEnginePage(&profile, &view));
+ view.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
view.load(QUrl(QStringLiteral("foo://bar")));
QVERIFY(loadFinishedSpy.wait());
- QVERIFY(toPlainTextSync(view.page()).isEmpty());
+ QCOMPARE(toPlainTextSync(view.page()), QString());
}
QTEST_MAIN(tst_QWebEngineProfile)