Browse Source

Wait for the file manager to finish copying every entry

master
evgeny 2 days ago
parent
commit
4a6765c49a
  1. 15
      tools/chatgui/tests/test_member_files_browser.cpp

15
tools/chatgui/tests/test_member_files_browser.cpp

@ -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 = {};

Loading…
Cancel
Save