重构:完善串流就绪检测并补充 GPU 联调记录
变更详情:kiosk 会话就绪检测重构(Moonlight 输出解析器/事件化回调/单元测试);GPU 直通实操记录(vfio Subsystem 注入、sysfs vBIOS、7zr+pnputil 安装、566.36 驱动、Sunshine 配对断链修复)
This commit is contained in:
1 parent
b08486046b
commit
13f645a503
14 files changed
+743
-225
No files matched your search
@@ -0,0 +1,53 @@
|
||||
#include <QPushButton>
|
||||
#include <QSignalSpy>
|
||||
#include <QtTest>
|
||||
|
||||
#include "desktop_list_page.h"
|
||||
|
||||
using namespace vdi;
|
||||
|
||||
class DesktopListPageTest : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void firstClickDisablesActionsAndBlocksDuplicate();
|
||||
};
|
||||
|
||||
void DesktopListPageTest::firstClickDisablesActionsAndBlocksDuplicate() {
|
||||
DesktopListPage page;
|
||||
DesktopInfo desktop;
|
||||
desktop.id = QStringLiteral("desktop-1");
|
||||
desktop.name = QStringLiteral("Windows 10");
|
||||
desktop.os = QStringLiteral("Windows");
|
||||
desktop.state = DesktopState::kAvailable;
|
||||
page.setDesktops({desktop});
|
||||
|
||||
QPushButton* connectButton = nullptr;
|
||||
QPushButton* editButton = nullptr;
|
||||
const auto buttons = page.findChildren<QPushButton*>();
|
||||
for (QPushButton* button : buttons) {
|
||||
if (button->text() == QStringLiteral("连接")) {
|
||||
connectButton = button;
|
||||
} else if (button->text() == QStringLiteral("设置")) {
|
||||
editButton = button;
|
||||
}
|
||||
}
|
||||
QVERIFY(connectButton);
|
||||
QVERIFY(editButton);
|
||||
|
||||
QSignalSpy spy(&page, &DesktopListPage::desktopSelected);
|
||||
connectButton->click();
|
||||
QCOMPARE(spy.count(), 1);
|
||||
QVERIFY(!connectButton->isEnabled());
|
||||
QVERIFY(!editButton->isEnabled());
|
||||
|
||||
connectButton->click();
|
||||
QCOMPARE(spy.count(), 1);
|
||||
|
||||
page.setBusy(false);
|
||||
QVERIFY(connectButton->isEnabled());
|
||||
QVERIFY(editButton->isEnabled());
|
||||
}
|
||||
|
||||
QTEST_MAIN(DesktopListPageTest)
|
||||
#include "test_desktop_list_page.moc"
|
||||
Reference in new issue
Block a user