Add an opt-in native file manager drag integration test
This commit is contained in:
1 parent
f0e68edad1
commit
3a6d075cbb
1 file changed
+16
@@ -170,6 +170,22 @@ private slots:
|
||||
QFile deep(folder + "/nested/deep.txt"); QVERIFY(deep.open(QIODevice::ReadOnly));
|
||||
QCOMPARE(deep.readAll(), QByteArray("folder/nested/deep.txt"));
|
||||
QVERIFY(QFileInfo(urls[1].toLocalFile()).isFile());
|
||||
// Опциональная интеграция с настоящим системным менеджером: координаты читает внешний XTest-драйвер.
|
||||
QString nativeDestination = qEnvironmentVariable("UTUN_MEMBER_FILES_NATIVE_DEST");
|
||||
if (!nativeDestination.isEmpty()) {
|
||||
for (int i = 0; i < 120; ++i) directories["folder"].append(QString("many-%1.txt").arg(i));
|
||||
browser.setWindowTitle("uTun native file copy test"); browser.raise(); browser.activateWindow();
|
||||
QTRY_VERIFY(browser.isActiveWindow());
|
||||
QPoint source = tree->viewport()->mapToGlobal(tree->visualItemRect(tree->topLevelItem(0)).center());
|
||||
QFile control(nativeDestination + "/source-position"); QVERIFY(control.open(QIODevice::WriteOnly));
|
||||
control.write(QByteArray::number(source.x()) + ' ' + QByteArray::number(source.y())); control.close();
|
||||
QTRY_VERIFY_WITH_TIMEOUT(QFile::exists(nativeDestination + "/folder/many-119.txt"), 60000);
|
||||
QFile received(nativeDestination + "/folder/nested/deep.txt"); QVERIFY(received.open(QIODevice::ReadOnly));
|
||||
QCOMPARE(received.readAll(), QByteArray("folder/nested/deep.txt"));
|
||||
QVERIFY(QFileInfo(nativeDestination + "/folder/empty").isDir());
|
||||
QVERIFY(QFileInfo(nativeDestination + "/loose.txt").isFile());
|
||||
QCOMPARE(transfers.size(), 126); // По три исходных файла и ещё 120 в native drag.
|
||||
}
|
||||
requestStarted = {}; transferStarted = {};
|
||||
}
|
||||
db.setDb(nullptr); QCOMPARE(sqlite3_close(sql), SQLITE_OK);
|
||||
|
||||
Reference in new issue
Block a user