1
/*****************************************************************************
2
* Copyright (C) 2010-2011 by Frank Reininghaus (frank78ac@googlemail.com) *
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. *
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. *
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
*****************************************************************************/
23
#include <QtCore/QObject>
25
class QAbstractItemView;
26
class DolphinDirLister;
28
class DolphinSortFilterProxyModel;
32
* The class TestBase (which is a friend of DolphinView's) provides access to some
33
* parts of DolphinView to the unit tests.
35
* TODO: TestBase should also backup the DolphinSettings and restore them later!
38
class TestBase : public QObject
47
/** Returns the item view (icons, details, or columns) */
48
static QAbstractItemView* itemView(const DolphinView* view);
51
* Waits until the view emits its finishedPathLoading(const KUrl&) signal.
52
* Asserts if the signal is not received within the given number of milliseconds.
54
static void waitForFinishedPathLoading(DolphinView* view, int milliseconds=20000);
56
/** Reloads the view and waits for the finishedPathLoading(const KUrl&) signal. */
57
static void reloadViewAndWait(DolphinView* view);
59
/** Returns the items shown in the view. The order corresponds to the sort order of the view. */
60
static QStringList viewItems(const DolphinView* view);
62
/** Returns the items which are selected in the view. The order corresponds to the sort order of the view. */
63
static QStringList selectedItems(const DolphinView* view);