]> cloud.milkyroute.net Git - dolphin.git/blob - src/tests/dolphinviewtest_allviewmodes.h
Add a unit test that checks the DolphinView functionality that is
[dolphin.git] / src / tests / dolphinviewtest_allviewmodes.h
1 /*****************************************************************************
2 * Copyright (C) 2010-2011 by Frank Reininghaus (frank78ac@googlemail.com) *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 *****************************************************************************/
19
20 #ifndef DOLPHINVIEWTEST_ALLVIEWMODES
21 #define DOLPHINVIEWTEST_ALLVIEWMODES
22
23 #include "testbase.h"
24
25 #include "views/dolphinview.h"
26
27 /**
28 * DolphinViewTest_AllViewModes is used as a base class for tests that check the
29 * basic functionality of DolphinView in all view modes. The derived classes
30 * have to provide implementations for the virtual methods mode() and verifyCorrectViewMode(),
31 * see below.
32 *
33 * Tests for DolphinView functionality that is specific to a particular view mode or
34 * to switching between different view modes should not be added here, but to another
35 * DolphinView unit test.
36 */
37
38 class DolphinViewTest_AllViewModes : public TestBase
39 {
40 Q_OBJECT
41
42 public:
43
44 DolphinViewTest_AllViewModes();
45
46 private slots:
47
48 void init();
49 void cleanup();
50
51 void testSelection();
52 void testViewPropertySettings();
53
54 void testKeyboardFocus();
55
56 public:
57
58 /** Returns the view mode (Icons, Details, Columns) to be used in the test. */
59 virtual DolphinView::Mode mode() const = 0;
60
61 /** Should return true if the view mode is correct. */
62 virtual bool verifyCorrectViewMode() const = 0;
63
64 /**
65 * Waits for the DolphinView's selectionChanged(const KFileItemList&) to be emitted
66 * and verifies that the number of selected items is as expected.
67 */
68 void verifySelectedItemsCount(int) const;
69
70 };
71
72 #endif