From 6f07e22acf15651f91d326529519119af7e807a9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 15 Jan 2014 19:01:18 +0100 Subject: 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 --- tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp') 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("%1").arg(unicodeText)); m_page->triggerAction(QWebEnginePage::SelectAll); @@ -3334,7 +3329,6 @@ void tst_QWebEnginePage::macCopyUnicodeToClipboard() QVERIFY(clipboardData.contains(QLatin1String(""))); QVERIFY(clipboardData.contains(unicodeText)); -#endif } #endif -- cgit v1.2.3