Use NoopTextSystem during tests (#28607)

This should allow tests to be more similar across platforms.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-04-11 16:26:41 -06:00 committed by GitHub
parent 97a9a5de10
commit 5994ac5cec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 97 additions and 54 deletions

View file

@ -1,8 +1,8 @@
use crate::{
AnyWindowHandle, BackgroundExecutor, ClipboardItem, CursorStyle, DevicePixels,
ForegroundExecutor, Keymap, Platform, PlatformDisplay, PlatformTextSystem, ScreenCaptureFrame,
ScreenCaptureSource, ScreenCaptureStream, Size, Task, TestDisplay, TestWindow,
WindowAppearance, WindowParams, size,
ForegroundExecutor, Keymap, NoopTextSystem, Platform, PlatformDisplay, PlatformTextSystem,
ScreenCaptureFrame, ScreenCaptureSource, ScreenCaptureStream, Size, Task, TestDisplay,
TestWindow, WindowAppearance, WindowParams, size,
};
use anyhow::Result;
use collections::VecDeque;
@ -91,17 +91,7 @@ impl TestPlatform {
)
};
#[cfg(target_os = "macos")]
let text_system = Arc::new(crate::platform::mac::MacTextSystem::new());
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
let text_system = Arc::new(crate::platform::linux::CosmicTextSystem::new());
#[cfg(target_os = "windows")]
let text_system = Arc::new(
crate::platform::windows::DirectWriteTextSystem::new(&bitmap_factory)
.expect("Unable to initialize direct write."),
);
let text_system = Arc::new(NoopTextSystem);
Rc::new_cyclic(|weak| TestPlatform {
background_executor: executor,