Changeset View
Changeset View
Standalone View
Standalone View
src/tests/dolphinmainwindowtest.cpp
Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Line(s) | 229 | { | |||
---|---|---|---|---|---|
233 | QTest::newRow("home") << QUrl::fromLocalFile(QDir::homePath()) << true; | 233 | QTest::newRow("home") << QUrl::fromLocalFile(QDir::homePath()) << true; | ||
234 | QTest::newRow("root") << QUrl::fromLocalFile(QDir::rootPath()) << false; | 234 | QTest::newRow("root") << QUrl::fromLocalFile(QDir::rootPath()) << false; | ||
235 | QTest::newRow("trash") << QUrl::fromUserInput(QStringLiteral("trash:/")) << false; | 235 | QTest::newRow("trash") << QUrl::fromUserInput(QStringLiteral("trash:/")) << false; | ||
236 | } | 236 | } | ||
237 | 237 | | |||
238 | void DolphinMainWindowTest::testNewFileMenuEnabled() | 238 | void DolphinMainWindowTest::testNewFileMenuEnabled() | ||
239 | { | 239 | { | ||
240 | QFETCH(QUrl, activeViewUrl); | 240 | QFETCH(QUrl, activeViewUrl); | ||
241 | m_mainWindow->openDirectories({ activeViewUrl }, false); | 241 | m_mainWindow->openDirectories({ activeViewUrl.toString() }, false); | ||
242 | m_mainWindow->show(); | 242 | m_mainWindow->show(); | ||
243 | QVERIFY(QTest::qWaitForWindowExposed(m_mainWindow.data())); | 243 | QVERIFY(QTest::qWaitForWindowExposed(m_mainWindow.data())); | ||
244 | QVERIFY(m_mainWindow->isVisible()); | 244 | QVERIFY(m_mainWindow->isVisible()); | ||
245 | 245 | | |||
246 | auto newFileMenu = m_mainWindow->findChild<DolphinNewFileMenu*>("new_menu"); | 246 | auto newFileMenu = m_mainWindow->findChild<DolphinNewFileMenu*>("new_menu"); | ||
247 | QVERIFY(newFileMenu); | 247 | QVERIFY(newFileMenu); | ||
248 | 248 | | |||
249 | QFETCH(bool, expectedEnabled); | 249 | QFETCH(bool, expectedEnabled); | ||
250 | QTRY_COMPARE(newFileMenu->isEnabled(), expectedEnabled); | 250 | QTRY_COMPARE(newFileMenu->isEnabled(), expectedEnabled); | ||
251 | } | 251 | } | ||
252 | 252 | | |||
253 | QTEST_MAIN(DolphinMainWindowTest) | 253 | QTEST_MAIN(DolphinMainWindowTest) | ||
254 | 254 | | |||
255 | #include "dolphinmainwindowtest.moc" | 255 | #include "dolphinmainwindowtest.moc" |