diff options
| author | Peter Penz <[email protected]> | 2011-01-01 20:46:51 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-01-01 20:46:51 +0000 |
| commit | f8a60e4d855219d6cb22b5016b705564d41dc4c0 (patch) | |
| tree | 13f0eb8f67e561ff0a78a047405ee39895985e61 /src/tests | |
| parent | dfaff684d6d75143e1831b16bb24fde9ffe24862 (diff) | |
Add test for the keyboard-focus
svn path=/trunk/KDE/kdebase/apps/; revision=1210707
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/dolphinviewtest_allviewmodes.cpp | 15 | ||||
| -rw-r--r-- | src/tests/dolphinviewtest_allviewmodes.h | 2 |
2 files changed, 17 insertions, 0 deletions
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<DolphinView::Mode>(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. diff --git a/src/tests/dolphinviewtest_allviewmodes.h b/src/tests/dolphinviewtest_allviewmodes.h index 59df22fc9..feaa9d9fc 100644 --- a/src/tests/dolphinviewtest_allviewmodes.h +++ b/src/tests/dolphinviewtest_allviewmodes.h @@ -50,6 +50,8 @@ private slots: void testSelection(); + void testKeyboardFocus(); + public: /** Returns the view mode (Icons, Details, Columns) to be used in the test. */ |
