┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/dolphinviewtest_allviewmodes.cpp15
-rw-r--r--src/tests/dolphinviewtest_allviewmodes.h2
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. */