Description
How to reproduce:
- load a page successfully
- load a page with an unhandled URL scheme
- load a page successfully
- extract the page's text
"Very often" the text will be the content of the error page for the second, failed, load.
Excerpt from the attachment:
for (;;) { QWebEngineView view; QSignalSpy spy(&view, SIGNAL(loadFinished(bool))); view.load(QUrl("data:text/plain,foobarbaz")); QTRY_VERIFY(spy.count()); QCOMPARE(toPlainTextSync(view), QString("foobarbaz")); view.load(QUrl("fail:unknown/scheme")); QTRY_VERIFY(spy.count() > 1); QString s = toPlainTextSync(view); qDebug() << s; QVERIFY(!s.contains("foobarbaz")); view.load(QUrl("data:text/plain,lalala")); QTRY_VERIFY(spy.count() > 2); QCOMPARE(toPlainTextSync(view), QString("lalala")); }
After some iterations the test fails with
FAIL! : ToPlainTextFailTest::doit() Compared values are not the same Actual (toPlainTextSync(view)): "\nThis webpage is not available\n\nERR_UNKNOWN_URL_SCHEME\nDetails" Expected (QString("lalala")) : "lalala"
Attachments
For Gerrit Dashboard: QTBUG-50752 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
147700,2 | Stabilize tst_QWebEngineProfile::urlSchemeHandlers some more | 5.6.0 | qt/qtwebengine | Status: MERGED | +2 | 0 |
148438,2 | Stabilize failed load sub-test of urlSchemeHandler | 5.6.0 | qt/qtwebengine | Status: MERGED | +2 | 0 |
148455,7 | Fix double LoadFinished on URL errors | 5.6 | qt/qtwebengine | Status: MERGED | +2 | 0 |