X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/f81d73a7f3a851dc755ef0cd1fd2a2507587a900..0464ea82a6850f58805bc4d6fc1df5369d83c3df:/src/tests/dolphinmainwindowtest.cpp diff --git a/src/tests/dolphinmainwindowtest.cpp b/src/tests/dolphinmainwindowtest.cpp index d7cb763fd..b3e52ce23 100644 --- a/src/tests/dolphinmainwindowtest.cpp +++ b/src/tests/dolphinmainwindowtest.cpp @@ -9,6 +9,7 @@ #include "dolphintabpage.h" #include "dolphintabwidget.h" #include "dolphinviewcontainer.h" +#include "dolphin_generalsettings.h" #include "kitemviews/kfileitemmodel.h" #include "kitemviews/kfileitemmodelrolesupdater.h" #include "kitemviews/kitemlistcontainer.h" @@ -75,6 +76,11 @@ private: void DolphinMainWindowTest::initTestCase() { QStandardPaths::setTestModeEnabled(true); + // Use fullWidth statusbar during testing, to test out most of the features. + GeneralSettings *settings = GeneralSettings::self(); + settings->setShowStatusBar(GeneralSettings::EnumShowStatusBar::FullWidth); + settings->setShowZoomSlider(true); + settings->save(); } void DolphinMainWindowTest::init() @@ -148,20 +154,20 @@ void DolphinMainWindowTest::testSyncDesktopAndPhoneUi() do { QVERIFY2(desktopUiElement.tagName() == phoneUiElement.tagName(), qPrintable(QStringLiteral("Node mismatch: dolphinui.rc/%1::%2 and dolphinuiforphones.rc/%3::%4") - .arg(desktopUiElement.parentNode().toElement().tagName()) - .arg(desktopUiElement.tagName()) - .arg(phoneUiElement.parentNode().toElement().tagName()) - .arg(phoneUiElement.tagName()))); + .arg(desktopUiElement.parentNode().toElement().tagName(), + desktopUiElement.tagName(), + phoneUiElement.parentNode().toElement().tagName(), + phoneUiElement.tagName()))); QCOMPARE(desktopUiElement.text(), phoneUiElement.text()); const auto desktopUiElementAttributes = desktopUiElement.attributes(); const auto phoneUiElementAttributes = phoneUiElement.attributes(); for (int i = 0; i < desktopUiElementAttributes.count(); i++) { QVERIFY2(phoneUiElementAttributes.count() >= i, qPrintable(QStringLiteral("Attribute mismatch: dolphinui.rc/%1::%2 has more attributes than dolphinuiforphones.rc/%3::%4") - .arg(desktopUiElement.parentNode().toElement().tagName()) - .arg(desktopUiElement.tagName()) - .arg(phoneUiElement.parentNode().toElement().tagName()) - .arg(phoneUiElement.tagName()))); + .arg(desktopUiElement.parentNode().toElement().tagName(), + desktopUiElement.tagName(), + phoneUiElement.parentNode().toElement().tagName(), + phoneUiElement.tagName()))); if (exceptions.count(desktopUiElementAttributes.item(i).nodeName())) { continue; } @@ -171,12 +177,11 @@ void DolphinMainWindowTest::testSyncDesktopAndPhoneUi() } QVERIFY2(desktopUiElementAttributes.count() == phoneUiElementAttributes.count(), qPrintable(QStringLiteral("Attribute mismatch: dolphinui.rc/%1::%2 has fewer attributes than dolphinuiforphones.rc/%3::%4. %5 < %6") - .arg(desktopUiElement.parentNode().toElement().tagName()) - .arg(desktopUiElement.tagName()) - .arg(phoneUiElement.parentNode().toElement().tagName()) - .arg(phoneUiElement.tagName()) - .arg(phoneUiElementAttributes.count()) - .arg(desktopUiElementAttributes.count()))); + .arg(desktopUiElement.parentNode().toElement().tagName(), + desktopUiElement.tagName(), + phoneUiElement.parentNode().toElement().tagName(), + phoneUiElement.tagName()) + .arg(phoneUiElementAttributes.count(), desktopUiElementAttributes.count()))); desktopUiElement = nextUiElement(desktopUiElement); phoneUiElement = nextUiElement(phoneUiElement); @@ -198,7 +203,7 @@ void DolphinMainWindowTest::testClosingTabsWithSearchBoxVisible() QVERIFY(tabWidget); // Show search box on first tab. - tabWidget->currentTabPage()->activeViewContainer()->setSearchModeEnabled(true); + tabWidget->currentTabPage()->activeViewContainer()->setSearchBarVisible(true); tabWidget->openNewActivatedTab(QUrl::fromLocalFile(QDir::homePath())); QCOMPARE(tabWidget->count(), 2);