#include <qtestmouse.h>
#include <qtestkeyboard.h>
-#include "kdebug.h"
-
class DolphinDetailsViewTest : public TestBase
{
Q_OBJECT
private slots:
- void initTestCase();
-
void bug217447_shiftArrowSelection();
void bug234600_overlappingIconsWhenZooming();
};
-void DolphinDetailsViewTest::initTestCase()
-{
- // add time stamps to find origin of test failures due to timeout at
- // http://my.cdash.org/index.php?project=kdebase&date=
- qputenv("KDE_DEBUG_TIMESTAMP", QByteArray("1"));
-}
-
/**
* When the first item in the view is active and Shift is held while the "arrow down"
* key is pressed repeatedly, the selection should grow by one item for each key press.
m_view->resize(1000, 400);
m_view->show();
QTest::qWaitForWindowShown(m_view);
-
- // We have to make sure that the view has loaded the directory before we start the test.
- // TODO: This will be needed frequently. Maybe move to TestHelper.
- QSignalSpy finished(m_view, SIGNAL(finishedPathLoading(const KUrl&)));
- m_view->reload();
- while (finished.count() != 1) {
- QTest::qWait(50);
- }
+ reloadViewAndWait();
// Select the first item
QModelIndex index0 = detailsView->model()->index(0, 0);
m_view->resize(400, 400);
m_view->show();
QTest::qWaitForWindowShown(m_view);
-
- // We have to make sure that the view has loaded the directory before we start the test.
- // TODO: This will be needed frequently. Maybe move to TestHelper.
- kDebug() << "Reloading view and waiting for the finishedPathLoading(const KUrl&) signal...";
- QSignalSpy finished(m_view, SIGNAL(finishedPathLoading(const KUrl&)));
- m_view->reload();
- while (finished.count() != 1) {
- QTest::qWait(50);
- }
- kDebug() << "...signal received, continuing";
+ reloadViewAndWait();
QModelIndex index0 = detailsView->model()->index(0, 0);
detailsView->setCurrentIndex(index0);
detailsView->setCurrentIndex(index1);
QCOMPARE(detailsView->currentIndex(), index1);
- kDebug() << "Now checking zoom levels...";
-
// Increase the zoom level successively to the maximum.
while(zoomLevel < ZoomLevelInfo::maximumLevel()) {
zoomLevel++;
- kDebug() << "Testing zoom level" << zoomLevel;
m_view->setZoomLevel(zoomLevel);
//Check for each zoom level that the height of each item is at least the icon size.
}
m_view->hide();
-
- kDebug() << "Cleaning up test directory...";
cleanupTestDir();
- kDebug() << "Done.";
}
QTEST_KDEMAIN(DolphinDetailsViewTest, GUI)
#include "testbase.h"
+#include <qtest_kde.h>
+
#include "views/dolphinview.h"
#include "views/dolphinmodel.h"
#include "views/dolphindirlister.h"
#include <QtCore/QDir>
#include <QtGui/QAbstractItemView>
+#include <kdebug.h>
+
TestBase::TestBase()
{
m_tempDir = new KTempDir;
return m_view->m_viewAccessor.itemView();
}
+void TestBase::reloadViewAndWait()
+{
+ kDebug() << "Reloading view and waiting for the finishedPathLoading(const KUrl&) signal...";
+ QSignalSpy finished(m_view, SIGNAL(finishedPathLoading(const KUrl&)));
+ m_view->reload();
+ while (finished.count() != 1) {
+ QTest::qWait(50);
+ }
+ kDebug() << "...signal received, continuing";
+}
KUrl TestBase::testDirUrl() const
{