From d4db071d651b0c9a0b9de187b557b598e62c9a15 Mon Sep 17 00:00:00 2001 From: Anna Gadomska Date: Fri, 20 Aug 2010 09:39:49 +0300 Subject: Changes: MContentItem unit test, MComboBox unit test improvements RevBy: Dominik --- tests/ut_mcombobox/ut_mcombobox.cpp | 19 +++++++++++++++++++ tests/ut_mcombobox/ut_mcombobox.h | 1 + 2 files changed, 20 insertions(+) (limited to 'tests/ut_mcombobox') diff --git a/tests/ut_mcombobox/ut_mcombobox.cpp b/tests/ut_mcombobox/ut_mcombobox.cpp index 68d2d8be..54dbe536 100644 --- a/tests/ut_mcombobox/ut_mcombobox.cpp +++ b/tests/ut_mcombobox/ut_mcombobox.cpp @@ -509,5 +509,24 @@ void Ut_MComboBox::testProgressIndicator() QCOMPARE(comboboxButtonLayout->policy(), viewPrivate->button->layoutPolicy(MComboBoxButton::TitleShown)); } +void Ut_MComboBox::testProgressIndicator2() +{ + MComboBoxView *view = (MComboBoxView *)m_combobox->view(); + MComboBoxViewPrivate *viewPrivate = view->d_func(); + MLayout* comboboxButtonLayout = static_cast(viewPrivate->button->layout()); + + QCOMPARE(m_combobox->isProgressIndicatorVisible(), false); + QCOMPARE(comboboxButtonLayout->policy(), viewPrivate->button->layoutPolicy(MComboBoxButton::TitleShown)); + + m_combobox->showProgressIndicator(); + QCOMPARE(m_combobox->isProgressIndicatorVisible(), true); + QCOMPARE(comboboxButtonLayout->policy(), + viewPrivate->button->layoutPolicy(MComboBoxButton::TitleShown|MComboBoxButton::ProgressShown)); + + m_combobox->hideProgressIndicator(); + QCOMPARE(m_combobox->isProgressIndicatorVisible(), false); + QCOMPARE(comboboxButtonLayout->policy(), viewPrivate->button->layoutPolicy(MComboBoxButton::TitleShown)); +} + QTEST_APPLESS_MAIN(Ut_MComboBox) diff --git a/tests/ut_mcombobox/ut_mcombobox.h b/tests/ut_mcombobox/ut_mcombobox.h index f800e651..996fd95d 100644 --- a/tests/ut_mcombobox/ut_mcombobox.h +++ b/tests/ut_mcombobox/ut_mcombobox.h @@ -55,6 +55,7 @@ private slots: void testActivatedSignal(); void testSetCurrentIndex(); void testProgressIndicator(); + void testProgressIndicator2(); private: MComboBox *m_combobox; -- cgit v1.2.3