|
|
|
|
@ -180,11 +180,16 @@ private slots:
|
|
|
|
|
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()); |
|
|
|
|
auto allCopied = [&] { |
|
|
|
|
QStringList files{"loose.txt", "folder/inside.txt", "folder/nested/deep.txt"}; |
|
|
|
|
for (int i = 0; i < 120; ++i) files.append(QString("folder/many-%1.txt").arg(i)); |
|
|
|
|
for (const auto& path : files) { |
|
|
|
|
QFile received(nativeDestination + '/' + path); |
|
|
|
|
if (!received.open(QIODevice::ReadOnly) || received.readAll() != path.toUtf8()) return false; |
|
|
|
|
} |
|
|
|
|
return QFileInfo(nativeDestination + "/folder/empty").isDir(); |
|
|
|
|
}; |
|
|
|
|
QTRY_VERIFY_WITH_TIMEOUT(allCopied(), 60000); |
|
|
|
|
QCOMPARE(transfers.size(), 126); // По три исходных файла и ещё 120 в native drag.
|
|
|
|
|
} |
|
|
|
|
requestStarted = {}; transferStarted = {}; |
|
|
|
|
|