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"