feat(mosstank): add VTank-style automation PoC
This commit is contained in:
parent
f6fe0f2a4f
commit
4e6e9bc9d9
212 changed files with 49462 additions and 416 deletions
|
|
@ -0,0 +1,46 @@
|
|||
using AcDream.App.Platform;
|
||||
|
||||
namespace AcDream.App.Tests.Platform;
|
||||
|
||||
public sealed class Win32GlfwActiveWindowGuardTests
|
||||
{
|
||||
[Fact]
|
||||
public void CurrentProcessWindowRemainsVisibleToGlfw()
|
||||
{
|
||||
nint window = (nint)0x1234;
|
||||
|
||||
Assert.Equal(
|
||||
window,
|
||||
Win32GlfwActiveWindowGuard.AcceptWindow(
|
||||
window,
|
||||
ownerProcessId: 47,
|
||||
currentProcessId: 47));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ForeignProcessWindowBecomesGlfwsExistingNoWindowPath()
|
||||
{
|
||||
Assert.Equal(
|
||||
0,
|
||||
Win32GlfwActiveWindowGuard.AcceptWindow(
|
||||
(nint)0x1234,
|
||||
ownerProcessId: 48,
|
||||
currentProcessId: 47));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0, 47, 47)]
|
||||
[InlineData(0x1234, 0, 47)]
|
||||
public void MissingOrUnownedWindowIsRejected(
|
||||
long window,
|
||||
uint ownerProcessId,
|
||||
uint currentProcessId)
|
||||
{
|
||||
Assert.Equal(
|
||||
0,
|
||||
Win32GlfwActiveWindowGuard.AcceptWindow(
|
||||
(nint)window,
|
||||
ownerProcessId,
|
||||
currentProcessId));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue