From f8a60e4d855219d6cb22b5016b705564d41dc4c0 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 1 Jan 2011 20:46:51 +0000 Subject: Add test for the keyboard-focus svn path=/trunk/KDE/kdebase/apps/; revision=1210707 --- src/tests/dolphinviewtest_allviewmodes.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/tests/dolphinviewtest_allviewmodes.cpp') diff --git a/src/tests/dolphinviewtest_allviewmodes.cpp b/src/tests/dolphinviewtest_allviewmodes.cpp index 3609efbd7..2873e2c7e 100644 --- a/src/tests/dolphinviewtest_allviewmodes.cpp +++ b/src/tests/dolphinviewtest_allviewmodes.cpp @@ -109,6 +109,21 @@ void DolphinViewTest_AllViewModes::testSelection() { verifySelectedItemsCount(5); } +void DolphinViewTest_AllViewModes::testKeyboardFocus() +{ + const DolphinView::Mode mode = m_view->mode(); + + // The view may not grab the keyboard focus itself. Also when switching + // the view-mode, the focus-state must remain. + QVERIFY(!m_view->hasFocus()); + for (int i = 0; i <= DolphinView::MaxModeEnum; ++i) { + m_view->setMode(static_cast(i)); + QVERIFY(!m_view->hasFocus()); + } + + m_view->setMode(mode); +} + /** * verifySelectedItemsCount(int) waits until the DolphinView's selectionChanged(const KFileItemList&) * signal is received and checks that the selection state of the view is as expected. -- cgit v1.3