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/qwebenginepage/tst_qwebenginepage.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/qwebenginepage/tst_qwebenginepage.cpp')
-rw-r--r-- | tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index a670903fe..2a85b010c 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -2762,9 +2762,7 @@ void tst_QWebEnginePage::errorPageExtension() page.setUrl(QUrl("http://non.existent/url")); QTRY_COMPARE(spyLoadFinished.count(), 2); -#if defined(QWEBENGINEPAGE_TOPLAINTEXT) - QCOMPARE(page.toPlainText(), QString("error")); -#endif + QCOMPARE(toPlainText(&page), QString("error")); QCOMPARE(page.history()->count(), 2); QCOMPARE(page.history()->currentItem().url(), QUrl("http://non.existent/url")); QCOMPARE(page.history()->canGoBack(), true); @@ -3322,9 +3320,6 @@ void tst_QWebEnginePage::thirdPartyCookiePolicy() #ifdef Q_OS_MAC void tst_QWebEnginePage::macCopyUnicodeToClipboard() { -#if !defined(QWEBENGINEPAGE_SETHTML) - QSKIP("QWEBENGINEPAGE_SETHTML"); -#else QString unicodeText = QString::fromUtf8("αβγδεζηθικλμπ"); m_page->setHtml(QString("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body>%1</body></html>").arg(unicodeText)); m_page->triggerAction(QWebEnginePage::SelectAll); @@ -3334,7 +3329,6 @@ void tst_QWebEnginePage::macCopyUnicodeToClipboard() QVERIFY(clipboardData.contains(QLatin1String("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"))); QVERIFY(clipboardData.contains(unicodeText)); -#endif } #endif |