Commit 0a6c3e74 authored by Laurent Montel's avatar Laurent Montel 😁

test return value from QTest::qWaitForWindowExposed

parent 0eb3689b
......@@ -129,7 +129,7 @@ void SlideContainerAutoTest::testHiddenContentResize()
// Resizing content should not trigger a slide if it is not visible.
TestWindow window;
window.show();
QTest::qWaitForWindowExposed(&window);
QVERIFY(QTest::qWaitForWindowExposed(&window));
window.mContent->show();
window.mContent->setFixedSize(150, 80);
......
......@@ -39,7 +39,7 @@ void RichTextComposerControlerTest::shouldAlignLeft()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.alignLeft();
QVERIFY(controler.richTextComposer()->hasFocus());
QCOMPARE(controler.richTextComposer()->alignment(), Qt::AlignLeft);
......@@ -53,7 +53,7 @@ void RichTextComposerControlerTest::shouldAlignRight()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.alignRight();
QVERIFY(controler.richTextComposer()->hasFocus());
QCOMPARE(controler.richTextComposer()->alignment(), Qt::AlignRight);
......@@ -67,7 +67,7 @@ void RichTextComposerControlerTest::shouldAlignJustify()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.alignJustify();
QVERIFY(controler.richTextComposer()->hasFocus());
QCOMPARE(controler.richTextComposer()->alignment(), Qt::AlignJustify);
......@@ -81,7 +81,7 @@ void RichTextComposerControlerTest::shouldAlignCenter()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.alignCenter();
QVERIFY(controler.richTextComposer()->hasFocus());
QCOMPARE(controler.richTextComposer()->alignment(), Qt::AlignHCenter);
......@@ -103,7 +103,7 @@ void RichTextComposerControlerTest::shouldBoldText()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.setTextBold(true);
QVERIFY(controler.richTextComposer()->hasFocus());
QVERIFY(controler.richTextComposer()->acceptRichText());
......@@ -117,7 +117,7 @@ void RichTextComposerControlerTest::shouldItalicText()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.setTextItalic(true);
QVERIFY(controler.richTextComposer()->hasFocus());
QVERIFY(controler.richTextComposer()->acceptRichText());
......@@ -131,7 +131,7 @@ void RichTextComposerControlerTest::shouldTextUnderline()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.setTextUnderline(true);
QVERIFY(controler.richTextComposer()->hasFocus());
QVERIFY(controler.richTextComposer()->acceptRichText());
......@@ -145,7 +145,7 @@ void RichTextComposerControlerTest::shouldTextStrikeOut()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.setTextStrikeOut(true);
QVERIFY(controler.richTextComposer()->hasFocus());
QVERIFY(controler.richTextComposer()->acceptRichText());
......@@ -159,7 +159,7 @@ void RichTextComposerControlerTest::shouldFontFamily()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
//TODO
}
......@@ -170,7 +170,7 @@ void RichTextComposerControlerTest::shouldFontSize()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
//TODO
}
......@@ -181,7 +181,7 @@ void RichTextComposerControlerTest::shouldFont()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
//TODO
}
......@@ -192,7 +192,7 @@ void RichTextComposerControlerTest::shouldTextSuperScript()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.setTextSuperScript(true);
QVERIFY(controler.richTextComposer()->hasFocus());
QVERIFY(controler.richTextComposer()->acceptRichText());
......@@ -206,7 +206,7 @@ void RichTextComposerControlerTest::shouldTextSubScript()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
controler.setTextSubScript(true);
QVERIFY(controler.richTextComposer()->hasFocus());
QVERIFY(controler.richTextComposer()->acceptRichText());
......@@ -243,7 +243,7 @@ void RichTextComposerControlerTest::shouldRemoveQuote()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
composer.setPlainText(input);
controler.slotRemoveQuotes();
......@@ -273,7 +273,7 @@ void RichTextComposerControlerTest::shouldRemoveQuoteWithSpecificQuote()
composer.createActions(actionCollection);
KPIMTextEdit::RichTextComposerControler controler(&composer);
composer.show();
QTest::qWaitForWindowExposed(&composer);
QVERIFY(QTest::qWaitForWindowExposed(&composer));
composer.setPlainText(input);
controler.slotRemoveQuotes();
......@@ -303,7 +303,7 @@ void RichTextComposerControlerTest::shouldAddQuote()
// composer.createActions(actionCollection);
// KPIMTextEdit::RichTextComposerControler controler(&composer);
// composer.show();
// QTest::qWaitForWindowExposed(&composer);
// QVERIFY(QTest::qWaitForWindowExposed(&composer));
// composer.setPlainText(input);
// controler.slotAddQuotes();
......
......@@ -36,7 +36,7 @@ void TextGoToLineWidgetTest::shouldHaveDefaultValuesOnCreation()
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QSpinBox *line = edit.findChild<QSpinBox *>(QStringLiteral("line"));
QVERIFY(line);
QCOMPARE(line->minimum(), 1);
......@@ -73,7 +73,7 @@ void TextGoToLineWidgetTest::shouldHideWidgetWhenClickOnCloseButton()
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QVERIFY(edit.isVisible());
QToolButton *closebutton = edit.findChild<QToolButton *>(QStringLiteral("closebutton"));
QTest::mouseClick(closebutton, Qt::LeftButton);
......@@ -84,7 +84,7 @@ void TextGoToLineWidgetTest::shouldHideWidgetWhenPressEscape()
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QTest::keyPress(&edit, Qt::Key_Escape);
QCOMPARE(edit.isVisible(), false);
}
......@@ -93,7 +93,7 @@ void TextGoToLineWidgetTest::shouldEmitGoToLineSignalWhenSpinboxHasFocusAndWePre
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QSpinBox *line = edit.findChild<QSpinBox *>(QStringLiteral("line"));
line->setFocus();
QVERIFY(line->hasFocus());
......@@ -108,14 +108,14 @@ void TextGoToLineWidgetTest::shouldHasFocusEachTimeThatItShown()
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QSpinBox *line = edit.findChild<QSpinBox *>(QStringLiteral("line"));
QVERIFY(line);
QVERIFY(line->hasFocus());
edit.hide();
QVERIFY(!line->hasFocus());
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
//FIXME QVERIFY(line->hasFocus());
}
......@@ -123,7 +123,7 @@ void TextGoToLineWidgetTest::shouldSetFocusWhenWeRecallGotToLine()
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QSpinBox *line = edit.findChild<QSpinBox *>(QStringLiteral("line"));
QVERIFY(line->hasFocus());
edit.setFocus();
......@@ -136,7 +136,7 @@ void TextGoToLineWidgetTest::shouldChangeMaximumValue()
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QSpinBox *line = edit.findChild<QSpinBox *>(QStringLiteral("line"));
QCOMPARE(line->value(), 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment