[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/apps/dolphin/src/tests
From:       Peter Penz <peter.penz19 () gmail ! com>
Date:       2011-01-01 20:46:51
Message-ID: 20110101204651.E0229AC8AE () svn ! kde ! org
[Download RAW message or body]

SVN commit 1210707 by ppenz:

Add test for the keyboard-focus


 M  +15 -0     dolphinviewtest_allviewmodes.cpp  
 M  +2 -0      dolphinviewtest_allviewmodes.h  


--- trunk/KDE/kdebase/apps/dolphin/src/tests/dolphinviewtest_allviewmodes.cpp #1210706:1210707
@@ -109,6 +109,21 @@
     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.
--- trunk/KDE/kdebase/apps/dolphin/src/tests/dolphinviewtest_allviewmodes.h #1210706:1210707
@@ -50,6 +50,8 @@
 
     void testSelection();
 
+    void testKeyboardFocus();
+
 public:
 
     /** Returns the view mode (Icons, Details, Columns) to be used in the test. */
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic