Add test case for open-in-new-tab title regression

Fix will be in D15112.

CCBUG: 397910
This commit is contained in:
Elvis Angelaccio 2018-09-02 10:53:32 +02:00
parent 50702506fa
commit a23acffd5e

View file

@ -39,6 +39,7 @@ private slots:
void testActiveViewAfterClosingSplitView_data(); void testActiveViewAfterClosingSplitView_data();
void testActiveViewAfterClosingSplitView(); void testActiveViewAfterClosingSplitView();
void testUpdateWindowTitleAfterClosingSplitView(); void testUpdateWindowTitleAfterClosingSplitView();
void testOpenInNewTabTitle();
private: private:
QScopedPointer<DolphinMainWindow> m_mainWindow; QScopedPointer<DolphinMainWindow> m_mainWindow;
@ -170,6 +171,23 @@ void DolphinMainWindowTest::testUpdateWindowTitleAfterClosingSplitView()
QCOMPARE(currentUrlChangedSpy.count(), 1); QCOMPARE(currentUrlChangedSpy.count(), 1);
} }
// Test case for bug #397910
void DolphinMainWindowTest::testOpenInNewTabTitle()
{
m_mainWindow->openDirectories({ QUrl::fromLocalFile(QDir::homePath()) }, false);
m_mainWindow->show();
QVERIFY(QTest::qWaitForWindowExposed(m_mainWindow.data()));
QVERIFY(m_mainWindow->isVisible());
auto tabWidget = m_mainWindow->findChild<DolphinTabWidget*>("tabWidget");
QVERIFY(tabWidget);
tabWidget->openNewTab(QUrl::fromLocalFile(QDir::tempPath()));
QCOMPARE(tabWidget->count(), 2);
QVERIFY(tabWidget->tabIcon(0).name() != tabWidget->tabIcon(1).name());
QVERIFY(tabWidget->tabText(0) != tabWidget->tabText(1));
}
QTEST_MAIN(DolphinMainWindowTest) QTEST_MAIN(DolphinMainWindowTest)
#include "dolphinmainwindowtest.moc" #include "dolphinmainwindowtest.moc"