Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 395db5e0 authored by Laurent Montel's avatar Laurent Montel 😁

test return value from QTest::qWaitForWindowExposed

parent 4bb803e5
......@@ -44,7 +44,7 @@ void MergeContactLoseInformationWarningTest::shouldEmitSignals()
{
KABMergeContacts::MergeContactLoseInformationWarning w;
w.show();
QTest::qWaitForWindowExposed(&w);
QVERIFY(QTest::qWaitForWindowExposed(&w));
QVERIFY(w.isVisible());
QAction *customize = w.findChild<QAction *>(QStringLiteral("customize"));
QAction *automatic = w.findChild<QAction *>(QStringLiteral("automatic"));
......
......@@ -127,7 +127,7 @@ void MergeContactWidgetTest::shouldEnableButton()
QListWidget *listWidget = mergeWidget.findChild<QListWidget *>(QStringLiteral("listcontact"));
QPushButton *button = mergeWidget.findChild<QPushButton *>(QStringLiteral("mergebutton"));
mergeWidget.show();
QTest::qWaitForWindowExposed(&mergeWidget);
QVERIFY(QTest::qWaitForWindowExposed(&mergeWidget));
listWidget->item(0)->setCheckState(Qt::Checked);
listWidget->item(1)->setCheckState(Qt::Checked);
QCOMPARE(button->isEnabled(), true);
......@@ -141,7 +141,7 @@ void MergeContactWidgetTest::shouldEmitSignalsWhenThereIsElementSelected()
QListWidget *listWidget = mergeWidget.findChild<QListWidget *>(QStringLiteral("listcontact"));
QPushButton *button = mergeWidget.findChild<QPushButton *>(QStringLiteral("mergebutton"));
mergeWidget.show();
QTest::qWaitForWindowExposed(&mergeWidget);
QVERIFY(QTest::qWaitForWindowExposed(&mergeWidget));
listWidget->item(0)->setCheckState(Qt::Checked);
listWidget->item(1)->setCheckState(Qt::Checked);
QSignalSpy spy(&mergeWidget, SIGNAL(mergeContact(Akonadi::Item::List,Akonadi::Collection)));
......@@ -161,7 +161,7 @@ void MergeContactWidgetTest::shouldEmitSignalsWhenThereIsTwoElementsSelected()
QListWidget *listWidget = mergeWidget.findChild<QListWidget *>(QStringLiteral("listcontact"));
QPushButton *button = mergeWidget.findChild<QPushButton *>(QStringLiteral("mergebutton"));
mergeWidget.show();
QTest::qWaitForWindowExposed(&mergeWidget);
QVERIFY(QTest::qWaitForWindowExposed(&mergeWidget));
listWidget->item(0)->setCheckState(Qt::Checked);
QSignalSpy spy(&mergeWidget, SIGNAL(mergeContact(Akonadi::Item::List,Akonadi::Collection)));
QTest::mouseClick(button, Qt::LeftButton);
......
......@@ -144,7 +144,7 @@ void EventEditTest::shouldEmitEventWhenPressEnter()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QVERIFY(edit.isVisible());
KMime::Message::Ptr msg(new KMime::Message);
......@@ -162,7 +162,7 @@ void EventEditTest::shouldHideWidgetWhenPressEnter()
{
MessageViewer::EventEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QVERIFY(edit.isVisible());
KMime::Message::Ptr msg(new KMime::Message);
......@@ -180,7 +180,7 @@ void EventEditTest::shouldHideWidgetWhenPressEscape()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QLineEdit *eventedit = edit.findChild<QLineEdit *>(QStringLiteral("eventedit"));
eventedit->setFocus();
QVERIFY(eventedit->hasFocus());
......@@ -192,7 +192,7 @@ void EventEditTest::shouldHideWidgetWhenSaveClicked()
{
MessageViewer::EventEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
msg->subject(true)->fromUnicodeString(QStringLiteral("Test Note"), "us-ascii");
......@@ -206,7 +206,7 @@ void EventEditTest::shouldSaveCollectionSettings()
{
MessageViewer::EventEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
Akonadi::CollectionComboBox *akonadicombobox = edit.findChild<Akonadi::CollectionComboBox *>(QStringLiteral("akonadicombobox"));
akonadicombobox->setCurrentIndex(3);
const Akonadi::Collection::Id id = akonadicombobox->currentCollection().id();
......@@ -219,7 +219,7 @@ void EventEditTest::shouldSaveCollectionSettingsWhenCloseWidget()
{
MessageViewer::EventEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
Akonadi::CollectionComboBox *akonadicombobox = edit.findChild<Akonadi::CollectionComboBox *>(QStringLiteral("akonadicombobox"));
akonadicombobox->setCurrentIndex(4);
const Akonadi::Collection::Id id = akonadicombobox->currentCollection().id();
......@@ -326,7 +326,7 @@ void EventEditTest::shouldSetFocusWhenWeCallTodoEdit()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QLineEdit *noteedit = edit.findChild<QLineEdit *>(QStringLiteral("eventedit"));
QVERIFY(noteedit);
edit.setFocus();
......
......@@ -288,7 +288,7 @@ void NoteEditTest::shouldHideWidgetWhenClickOnCloseButton()
{
MessageViewer::NoteEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QVERIFY(edit.isVisible());
QPushButton *close = edit.findChild<QPushButton *>(QStringLiteral("close-button"));
QTest::mouseClick(close, Qt::LeftButton);
......@@ -301,7 +301,7 @@ void NoteEditTest::shouldHideWidgetWhenPressEscape()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QLineEdit *noteedit = edit.findChild<QLineEdit *>(QStringLiteral("noteedit"));
noteedit->setFocus();
QVERIFY(noteedit->hasFocus());
......@@ -313,7 +313,7 @@ void NoteEditTest::shouldHideWidgetWhenSaveClicked()
{
MessageViewer::NoteEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
msg->subject(true)->fromUnicodeString(QStringLiteral("Test Note"), "us-ascii");
......@@ -360,7 +360,7 @@ void NoteEditTest::shouldSetFocusWhenWeCallNoteEdit()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
QString subject = QStringLiteral("Test Note");
msg->subject(true)->fromUnicodeString(subject, "us-ascii");
......@@ -402,7 +402,7 @@ void NoteEditTest::shouldHaveLineEditFocus()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
QString subject = QStringLiteral("Test Note");
msg->subject(true)->fromUnicodeString(subject, "us-ascii");
......
......@@ -257,7 +257,7 @@ void TodoEditTest::shouldClearAllWhenCloseWidget()
MessageViewer::TodoEdit edit;
edit.show();
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
QString subject = QStringLiteral("Test Note");
......@@ -304,7 +304,7 @@ void TodoEditTest::shouldHideWidgetWhenClickOnCloseButton()
{
MessageViewer::TodoEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QVERIFY(edit.isVisible());
QPushButton *close = edit.findChild<QPushButton *>(QStringLiteral("close-button"));
QTest::mouseClick(close, Qt::LeftButton);
......@@ -317,7 +317,7 @@ void TodoEditTest::shouldHideWidgetWhenPressEscape()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QLineEdit *noteedit = edit.findChild<QLineEdit *>(QStringLiteral("noteedit"));
noteedit->setFocus();
QVERIFY(noteedit->hasFocus());
......@@ -329,7 +329,7 @@ void TodoEditTest::shouldHideWidgetWhenSaveClicked()
{
MessageViewer::TodoEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
msg->subject(true)->fromUnicodeString(QStringLiteral("Test Note"), "us-ascii");
......@@ -376,7 +376,7 @@ void TodoEditTest::shouldSetFocusWhenWeCallTodoEdit()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
QString subject = QStringLiteral("Test Note");
msg->subject(true)->fromUnicodeString(subject, "us-ascii");
......@@ -418,7 +418,7 @@ void TodoEditTest::shouldHaveLineEditFocus()
edit.show();
// make sure the window is active so we can test for focus
qApp->setActiveWindow(&edit);
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
QString subject = QStringLiteral("Test Note");
msg->subject(true)->fromUnicodeString(subject, "us-ascii");
......@@ -431,7 +431,7 @@ void TodoEditTest::shouldShowMessageWidget()
{
MessageViewer::TodoEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
msg->subject(true)->fromUnicodeString(QStringLiteral("Test note"), "us-ascii");
......@@ -448,7 +448,7 @@ void TodoEditTest::shouldHideMessageWidget()
{
MessageViewer::TodoEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
QLineEdit *noteedit = edit.findChild<QLineEdit *>(QStringLiteral("noteedit"));
noteedit->setText(QStringLiteral("Test note"));
......@@ -466,7 +466,7 @@ void TodoEditTest::shouldHideMessageWidgetWhenAddNewMessage()
{
MessageViewer::TodoEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
msg->subject(true)->fromUnicodeString(QStringLiteral("Test note"), "us-ascii");
......@@ -489,7 +489,7 @@ void TodoEditTest::shouldHideMessageWidgetWhenCloseWidget()
{
MessageViewer::TodoEdit edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QVERIFY(QTest::qWaitForWindowExposed(&edit));
KMime::Message::Ptr msg(new KMime::Message);
msg->subject(true)->fromUnicodeString(QStringLiteral("Test note"), "us-ascii");
......
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