mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-14 22:14:23 +00:00
Call OleInitialize
to fix DirectWrite
in TestPlatform
on windows (#12289)
Running the tests on windows currently fails for every gpui test using the `TestPlatform` with ```rs called `Result::unwrap()` on an `Err` value: CoInitialize has not been called. (0x800401F0) ``` trying to call `CoCreateInstance`in the `DirectWriteComponent`. The `WindowsPlatform` calls [`OleInitialize`](https://learn.microsoft.com/de-de/windows/win32/api/ole2/nf-ole2-oleinitialize) which internally calls `CoInitializeEx` so I just copied that to the `TestPlatform`. Release Notes: - N/A
This commit is contained in:
parent
9cc5ba86d1
commit
e54455bcad
1 changed files with 6 additions and 0 deletions
|
@ -38,6 +38,12 @@ pub(crate) struct TestPrompts {
|
|||
|
||||
impl TestPlatform {
|
||||
pub fn new(executor: BackgroundExecutor, foreground_executor: ForegroundExecutor) -> Rc<Self> {
|
||||
#[cfg(target_os = "windows")]
|
||||
unsafe {
|
||||
windows::Win32::System::Ole::OleInitialize(None)
|
||||
.expect("unable to initialize Windows OLE");
|
||||
}
|
||||
|
||||
Rc::new_cyclic(|weak| TestPlatform {
|
||||
background_executor: executor,
|
||||
foreground_executor,
|
||||
|
|
Loading…
Reference in a new issue