diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-01-15 19:01:18 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-22 08:46:17 +0100 |
commit | 6f07e22acf15651f91d326529519119af7e807a9 (patch) | |
tree | 2db55f3ea7ebe6c74905ed87dce5b6140bf5222e /tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | |
parent | 2830bc6e16e553a52ba465bb4199ab7c18ee4dbc (diff) |
Unskip and ajust tests using setHtml, setContent, toHtml and toPlainText
Replace direct calls of toHtml and toPlainText to use a blocking
helper function that spins a QEventLoop to wait for the async result.
This should work fine for tests where the event loop is less polluted
by other events that could cause code reentrancy through stacked stacks.
Change-Id: Ic46a06a9abad782a39a620ceecdc51c3bbb6b5a1
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp')
-rw-r--r-- | tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index 352040bab..4c238a074 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -138,9 +138,6 @@ void tst_QWebEngineView::reusePage_data() void tst_QWebEngineView::reusePage() { -#if !defined(QWEBENGINEPAGE_SETHTML) - QSKIP("QWEBENGINEPAGE_SETHTML"); -#else if (!QDir(TESTS_SOURCE_DIR).exists()) W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); @@ -150,7 +147,9 @@ void tst_QWebEngineView::reusePage() QWebEngineView* view1 = new QWebEngineView; QPointer<QWebEnginePage> page = new QWebEnginePage; view1->setPage(page.data()); +#if defined(QWEBENGINESETTINGS) page.data()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true); +#endif page->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR)); if (html.contains("</embed>")) { // some reasonable time for the PluginStream to feed test.swf to flash and start painting @@ -171,7 +170,6 @@ void tst_QWebEngineView::reusePage() delete page.data(); // must not crash QDir::setCurrent(QApplication::applicationDirPath()); -#endif } // Class used in crashTests |