Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions openless-all/app/scripts/windows-ui-config.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const sharedTypesRs = await readFile(
);
// Contract check over the union of the capsule subsystem compiled into the binary; native
// window manipulation belongs to the explicit Tauri Host.
const capsuleHitTestRs = await readFile(
new URL('../src-tauri/src/capsule_hit_test.rs', import.meta.url),
'utf-8',
);
const coordinatorRs =
(await readFile(new URL('../src-tauri/src/coordinator.rs', import.meta.url), 'utf-8')) +
'\n' +
Expand All @@ -43,7 +47,9 @@ const coordinatorRs =
'\n' +
(await readFile(new URL('../src-tauri/src/capsule_snapshot.rs', import.meta.url), 'utf-8')) +
'\n' +
(await readFile(new URL('../src-tauri/src/tauri_coordinator_host.rs', import.meta.url), 'utf-8'));
(await readFile(new URL('../src-tauri/src/tauri_coordinator_host.rs', import.meta.url), 'utf-8')) +
'\n' +
capsuleHitTestRs;
const tauriEventsRs = await readFile(
new URL('../src-tauri/src/tauri_events.rs', import.meta.url),
'utf-8',
Expand Down Expand Up @@ -404,24 +410,24 @@ assertMatch(
'capsule hit testing should cover X/Y and use a real native input region',
);
assertMatch(
coordinatorRs,
/control_left:[\s\S]*?control_right:[\s\S]*?control_top:[\s\S]*?control_bottom:/,
'capsule hit-test state should store both X and Y bounds',
capsuleHitTestRs,
/struct CapsuleHitTestRect \{[\s\S]*?left: i32,[\s\S]*?right: i32,[\s\S]*?top: i32,[\s\S]*?bottom: i32,/,
'window-owned capsule hit-test state should store both X and Y bounds',
);
assertMatch(
coordinatorRs,
/CreateRoundRectRgn[\s\S]*?SetWindowRgn/,
'capsule input region should be native',
);
assertMatch(
coordinatorRs,
/WM_NCDESTROY[\s\S]*?remove\([\s\S]*?SetWindowLongPtrW/,
'subclass teardown should restore the old WndProc and remove its table entry',
capsuleHitTestRs,
/WM_NCDESTROY[\s\S]*?RemoveWindowSubclass[\s\S]*?drop\(Box::from_raw\([\s\S]*?DefSubclassProc/,
'subclass teardown should release window-owned state and preserve message forwarding',
);
assertMatch(
coordinatorRs,
/SetLastError[\s\S]*?GetLastError/,
'WndProc installation should detect SetWindowLongPtrW failure',
capsuleHitTestRs,
/if !SetWindowSubclass\([\s\S]*?\.as_bool\(\)[\s\S]*?drop\(Box::from_raw\(data\)\);[\s\S]*?return Err/,
'failed subclass installation should release its allocation and return an error',
);
assertMatch(
coordinatorRs,
Expand Down
2 changes: 1 addition & 1 deletion openless-all/app/src-tauri/backend-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ parking_lot = "0.12"
futures-util = "0.3"

[target.'cfg(windows)'.dev-dependencies]
windows = { version = "0.58", features = ["Win32_Foundation", "Win32_System_Threading", "Win32_UI_WindowsAndMessaging", "Win32_UI_Input_KeyboardAndMouse"] }
windows = { version = "0.58", features = ["Win32_Foundation", "Win32_Graphics_Gdi", "Win32_System_Threading", "Win32_UI_Shell", "Win32_UI_WindowsAndMessaging", "Win32_UI_Input_KeyboardAndMouse"] }

[target.'cfg(target_os = "linux")'.dev-dependencies]
# Exercise the production recorder worker without the retired Linux Tauri host.
Expand Down
11 changes: 11 additions & 0 deletions openless-all/app/src-tauri/backend-tests/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fn main() {
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows")
&& std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc")
{
// Subclass helper exports require Common Controls v6 in the test executables.
println!("cargo:rustc-link-arg-tests=/MANIFEST:EMBED");
println!(
r#"cargo:rustc-link-arg-tests=/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"#
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#![cfg(target_os = "windows")]

#[path = "../../src/capsule_hit_test.rs"]
mod capsule_hit_test;
Loading
Loading