From 1fcd7970e07a0ecab206224824d1c71488fc19e9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 15 Jan 2014 19:10:22 +0100 Subject: Implement QWebEnginePage::toHtml and toPlainText Those methods are now made asynchronous and need to be given a callback to handle the result. Update the code in the browser and fancybrowser examples using std::bind when using C++11 or tr1::bind with C++03 (which should be available with compilers on platforms that we support). Add a (currently failing) earlyToHtml test to make sure that an empty page doesn't crash because of a possibly incomplete attachment of the QtRenderViewObserver. Change-Id: I3ab7cb6f25b91b584dd80df5e4e9ad1e3214348e Reviewed-by: Pierre Rossi --- tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp b/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp index 11281082b..1db95366b 100644 --- a/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp +++ b/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp @@ -60,6 +60,7 @@ private Q_SLOTS: void javaScriptWindowObjectCleared_data(); void javaScriptWindowObjectCleared(); void javaScriptWindowObjectClearedOnEvaluate(); + void earlyToHtml(); void setHtml(); void setHtmlWithImageResource(); void setHtmlWithStylesheetResource(); @@ -389,6 +390,12 @@ void tst_QWebEngineFrame::javaScriptWindowObjectClearedOnEvaluate() QCOMPARE(spy.count(), 1); } +void tst_QWebEngineFrame::earlyToHtml() +{ + QString html(""); + QCOMPARE(toHtml(m_view->page()), html); +} + void tst_QWebEngineFrame::setHtml() { QString html("

hello world

"); -- cgit v1.2.3