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/qwebenginehistory | |
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/qwebenginehistory')
-rw-r--r-- | tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp index 29f2ed694..e84702df3 100644 --- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp +++ b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp @@ -124,18 +124,14 @@ void tst_QWebEngineHistory::count() */ void tst_QWebEngineHistory::back() { -#if !defined(QWEBENGINEPAGE_TOPLAINTEXT) - QSKIP("QWEBENGINEPAGE_TOPLAINTEXT"); -#else for (int i = histsize;i > 1;i--) { - QCOMPARE(page->toPlainText(), QString("page") + QString::number(i)); + QCOMPARE(toPlainText(page), QString("page") + QString::number(i)); hist->back(); loadFinishedBarrier->ensureSignalEmitted(); } //try one more time (too many). crash test hist->back(); - QCOMPARE(page->toPlainText(), QString("page1")); -#endif + QCOMPARE(toPlainText(page), QString("page1")); } /** @@ -143,9 +139,6 @@ void tst_QWebEngineHistory::back() */ void tst_QWebEngineHistory::forward() { -#if !defined(QWEBENGINEPAGE_TOPLAINTEXT) - QSKIP("QWEBENGINEPAGE_TOPLAINTEXT"); -#else //rewind history :-) while (hist->canGoBack()) { hist->back(); @@ -153,14 +146,13 @@ void tst_QWebEngineHistory::forward() } for (int i = 1;i < histsize;i++) { - QCOMPARE(page->toPlainText(), QString("page") + QString::number(i)); + QCOMPARE(toPlainText(page), QString("page") + QString::number(i)); hist->forward(); loadFinishedBarrier->ensureSignalEmitted(); } //try one more time (too many). crash test hist->forward(); - QCOMPARE(page->toPlainText(), QString("page") + QString::number(histsize)); -#endif + QCOMPARE(toPlainText(page), QString("page") + QString::number(histsize)); } /** |