Wip tests protocol - #1297
Conversation
There was a problem hiding this comment.
Sorry @zorowk, your pull request is larger than the review limit of 150000 diff characters
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zorowk The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideIntroduce a reusable Treeland initialization helper for both production and protocol tests, add a comprehensive Wayland protocol testing framework with many C-based client tests and desktop/headless fixtures, and make several small runtime fixes around capture, wallpaper, window picking, shortcut/session handling, and texture capture paths. Sequence diagram for WTextureCapturer::doGrabToImage with QRhiTexture and QSGPlainTexturesequenceDiagram
participant Capturer as WTextureCapturer
participant Provider as WTextureProvider
participant Texture as QSGTexture
participant Rhi as QRhi
Capturer->>Provider: wTextureProvider()
Provider-->>Capturer: Texture
alt texture has rhiTexture
Capturer->>Texture: rhiTexture()
Texture-->>Capturer: QRhiTexture
Capturer->>Rhi: beginOffscreenFrame()
Capturer->>Rhi: nextResourceUpdateBatch()
Capturer->>Rhi: endOffscreenFrame()
else texture is QSGPlainTexture
Capturer->>Texture: image()
Texture-->>Capturer: QImage
Capturer-->>Capturer: imgPromise.addResult(copy)
else invalid texture
Capturer-->>Capturer: imgPromise.setException()
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
commit 信息不符合规范 |
shared compositor initialization and the protocol-test framework; - Move shared QPA and minimal test-server initialization into libtreeland. - Provide an isolated headless protocol-test fixture with generated C Wayland clients and a DDE shell example organized as named cases. Make future protocol coverage additions consistent while preserving a real C Wayland client boundary. PMS: TASK-393829
Add client-side protocol test coverage for Treeland private Wayland interfaces. - Register 14 new protocol-test targets in the protocol test build. - Add C clients, setup fixtures, and test headers for app-id, capture, output, wallpaper, window-management, and related private protocols. Exercise protocol requests, events, and error behavior against the headless server fixture. test(protocols): strengthen DDE and wallpaper shell coverage Strengthen protocol tests with real output setup and observable server-side effects. - Create a headless output for DDE overlap checks and assert DDE shell-surface state changes. - Bind the wallpaper notifier client interface and verify add/remove broadcasts. Ensure these tests validate protocol behavior instead of treating missing dependencies or manually omitted interfaces as successful coverage. PMS: TASK-393829
Protocol tests need real headless outputs and mapped xdg toplevels for server-side surface semantics. - Share headless output and wl_shm fixture support across protocol tests - Generate scanner-based xdg-shell client helpers on demand - Require the foreign toplevel test to use a configured, buffer-mapped xdg window Avoid transport-only coverage where output or window-dependent protocol paths silently no-op. Only protocol test framework and affected test fixtures; no production protocol behavior. PMS: TASK-393829
The working tree contains only the desktop protocol fixture and its consumers. - add production desktop fixture - validate foreign handles against SurfaceWrapper - add DDE SurfaceWrapper propagation test Protocol tests must observe production business effects. All current worktree changes are protocol-test framework and test sources. test(protocols): validate personalization desktop effects Desktop protocol tests run against the production Helper and its full registry. - add a mapped xdg personalization integration test - make the client registry retain stable names for all production globals - synchronize desktop clients with a headless output and fix foreign test encapsulation Verify protocol requests affect real compositor window state without relying on private setters. Only protocol test framework and protocol test sources are included. test(protocols): add desktop semantic coverage The protocol suite needs observable production outcomes for desktop-dependent private protocols. - Add desktop tests for screensaver idle inhibition, shortcut activation, and show-desktop visibility. - Generate and link extra upstream client protocols for desktop tests. - Initialize shortcut state for the already-active global session. Exercise real mapped windows, input, idle state, and workspace visibility instead of protocol-local state alone. Exclude tests/protocols/specifications and do not add rendered capture or wallpaper coverage. PMS: TASK-393829
Protocol tests need a reusable production scene with a client buffer whose pixels can be observed. - Add a desktop rendered-output fixture that maps a solid-colour xdg client buffer. - Read the production surface texture through WTextureCapturer and assert its pixels. - Extend the shared xdg test client to map solid ARGB buffers directly after the first configure. Provide a verified rendering prerequisite for capture and output-facing protocol tests. Exclude tests/protocols/specifications and do not yet implement capture selector or frame copy coverage. PMS: TASK-393829
Expose selection operations for WindowPicker and CaptureSourceSelector so callers can select a known surface without synthesizing pointer input. Connect the DDE shell PickerCreated signal to Helper, recognize wallpaper surfaces with committed buffers as ready, and update screensaver idle inhibitors through the initialized Helper. These changes make production state transitions explicit and let protocol fixtures use them deterministically. PMS: TASK-393829
Read QSGPlainTexture image data when the software renderer provides no QRhi texture, allowing headless pixman rendering to produce capture pixels. Include the wl_shm API required by the protocol test server. PMS: TASK-393829
Skip Treeland's automatic plugin discovery when a desktop protocol fixture supplies its build-tree plugin path, so the fixture can load and initialize those plugins explicitly. PMS: TASK-393829
Set button text colors through each control's palette, matching the Qt Quick Controls API used by the lockscreen and multitask plugins. PMS: TASK-393829
Exercise private and desktop Wayland protocols through production integration paths instead of only validating resources and manually emitted events. Add headless desktop clients and fixtures for app-id resolution, capture, DDE shell flows, input and keyboard state, personalization, virtual output, wallpaper, Wine windows, and foreign toplevels. Extend the shared XDG client and desktop runner to wait for production readiness and assert mapped surfaces, workspace and output state, capture pixels, and protocol events. Make desktop fixtures self-contained in headless CI by copying DConfig descriptor data and running disposable D-Bus, Accounts, and DConfig services. Load build-tree plugins explicitly, wait for output and configuration readiness, and capture QSGPlainTexture pixels when Qt uses its software backend. Keep unstable timing- and device-dependent scenarios out of the default test path. PMS: TASK-393829
Pass the native Wayland handles expected by the current wlroots APIs when resolving output layout geometry and setting XWayland workareas. PMS: TASK-393829
protocol-tests - add the protocol-test specification index and per-protocol contracts - record fixture boundaries, observable production results, and coverage gaps keep protocol coverage expectations reviewable alongside the test suite PMS: TASK-393829
protocol test source headers - add the 2026 UnionTech copyright notice to protocol fixture, framework, and test client sources - add the same notice to treeland initialization sources make ownership information consistent across the protocol test implementation PMS: TASK-393829
Install the DConfig daemon and required QML modules, and create the dde service account required by Treeland's global-session path in the minimal CI image. PMS: TASK-393829
|
| QDBusConnection::sessionBus().registerService("org.deepin.Compositor1"); | ||
| QDBusConnection::sessionBus().registerObject("/org/deepin/Compositor1", this); | ||
|
|
||
| if (qEnvironmentVariableIsEmpty("TREELAND_TEST_PLUGINS_PATH")) { |
There was a problem hiding this comment.
开始是为了在ci下面测试程序能够加载到插件,后来发现插件会加载两遍就在这里写了个判断。现在不需要了 会回撤这个地方 插件还是统一由treeland核心加载 测试客户端不在参与这个事情
| void preInit(const InitOptions &opts) | ||
| { | ||
| if (opts.headless) { | ||
| const auto testBackends = qgetenv("TREELAND_TEST_WLR_BACKENDS"); |
There was a problem hiding this comment.
这个环节变量有啥用呀,如果有需要指定backend,直接用 WLR_BACKENDS 不行吗,这里可以判断没有指定 WLR_BACKENDS时才使用 opts.headless。
| return static_cast<QPlatformTheme *>(new QDeepinTheme()); | ||
| Treeland::preInit(Treeland::InitOptions{ | ||
| .createPlatformTheme = [](const QString &) { | ||
| return static_cast<QPlatformTheme *>(new QDeepinTheme()); |
P:协议/资源级;验证请求、事件和协议错误。I:生产集成级;验证生产模块的状态、回调或生命周期。E:端到端业务级;验证真实生产对象产生了业务结果。V:渲染/像素级;在E基础上读取渲染结果或像素。(只有capture, color等在使用)已注册并有测试目录的 19 个当前协议:XML 共 185 条 request,其中测试客户端直接
调用了 165 条(89.2%)。
去掉 48 条
destroy生命周期 request 后,剩余 137 条工厂、配置和业务 request 中有120 条(87.6%) 被直接调用。
19 个协议中 16 个(84.2%) 至少有一条 E 级生产业务链路;仅 DDM、output-manager
color-control、wallpaper-color 仍停留在 I/P 层。
详细的基本覆盖情况阅读 tests/protocols/specifications/README.md
Summary by Sourcery
Establish a production-oriented Wayland protocol testing framework and expand coverage across Treeland’s protocol, desktop integration, and rendering paths.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests: