From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- .../windows.perception.stub/tests/Makefile.in | 2 +- .../tests/perception.c | 88 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.perception.stub/tests/Makefile.in b/dlls/windows.perception.stub/tests/Makefile.in index 9de867787b3..0783751d75e 100644 --- a/dlls/windows.perception.stub/tests/Makefile.in +++ b/dlls/windows.perception.stub/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = windows.perception.stub.dll -IMPORTS = combase +IMPORTS = combase user32
SOURCES = \ perception.c diff --git a/dlls/windows.perception.stub/tests/perception.c b/dlls/windows.perception.stub/tests/perception.c index 29d7f1ea475..fe21144dc05 100644 --- a/dlls/windows.perception.stub/tests/perception.c +++ b/dlls/windows.perception.stub/tests/perception.c @@ -102,8 +102,11 @@ static void test_HolographicSpaceStatics(void) static const WCHAR *holographicspace_statics_name = L"Windows.Graphics.Holographic.HolographicSpace"; IHolographicSpaceStatics2 *holographicspace_statics2; IHolographicSpaceStatics3 *holographicspace_statics3; + IHolographicSpaceInterop *holographic_space_interop; + IHolographicSpace *holographic_space; IActivationFactory *factory; BOOLEAN value; + HWND window; HSTRING str; HRESULT hr; LONG ref; @@ -163,6 +166,91 @@ static void test_HolographicSpaceStatics(void)
ref = IHolographicSpaceStatics3_Release( holographicspace_statics3 ); ok( ref == 2, "got ref %ld.\n", ref ); + + hr = IActivationFactory_QueryInterface( factory, &IID_IHolographicSpaceInterop, (void **)&holographic_space_interop ); + if (hr == E_NOINTERFACE) /* win1703 */ + { + win_skip( "IHolographicSpaceInterop is not supported, skipping tests.\n" ); + goto done; + } + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + holographicspace_statics2 = (void *)0xdeadbeef; + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, NULL, &IID_IHolographicSpaceStatics2, (void **)&holographicspace_statics2 ); + todo_wine + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + todo_wine + ok( holographicspace_statics2 == (void *)0xdeadbeef, "got holographicspace_statics2 %p.\n", holographicspace_statics2 ); + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, (void *)0xdeadbeef, &IID_IHolographicSpaceStatics2, (void **)&holographicspace_statics2 ); + todo_wine + ok( hr == E_INVALIDARG || broken(hr == E_ACCESSDENIED) /* w1064v1709 */ || broken(hr == E_NOINTERFACE) /* w11 */, "got hr %#lx.\n", hr ); + ok( holographicspace_statics2 == NULL, "got holographicspace_statics2 %p.\n", holographicspace_statics2 ); + if (hr == E_ACCESSDENIED) goto cleanup; + + window = CreateWindowW( L"static", NULL, WS_VISIBLE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, NULL, NULL ); + ok( IsWindow( window ), "CreateWindowW failed.\n" ); + + holographicspace_statics2 = (void *)0xdeadbeef; + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, window, &IID_ISpatialSurfaceObserverStatics2, (void **)&holographicspace_statics2 ); + todo_wine + ok( hr == E_NOINTERFACE, "got hr %#lx.\n", hr ); + ok( holographicspace_statics2 == NULL, "got holographicspace_statics2 %p.\n", holographicspace_statics2 ); + + holographicspace_statics2 = (void *)0xdeadbeef; + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, window, &IID_ISpatialSurfaceObserverStatics2, (void **)&holographicspace_statics2 ); + todo_wine + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + ok( holographicspace_statics2 == NULL, "got holographicspace_statics2 %p.\n", holographicspace_statics2 ); + DestroyWindow( window ); + + window = CreateWindowW( L"static", NULL, WS_VISIBLE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, NULL, NULL ); + ok( IsWindow( window ), "CreateWindowW failed.\n" ); + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, window, &IID_IHolographicSpaceStatics2, (void **)&holographicspace_statics2 ); + todo_wine + ok( hr == E_NOINTERFACE, "got hr %#lx.\n", hr ); + DestroyWindow( window ); + + window = CreateWindowW( L"static", NULL, WS_VISIBLE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, NULL, NULL ); + ok( IsWindow( window ), "CreateWindowW failed.\n" ); + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, window, &IID_IHolographicSpaceStatics3, (void **)&holographicspace_statics3 ); + todo_wine + ok( hr == E_NOINTERFACE, "got hr %#lx.\n", hr ); + DestroyWindow( window ); + + window = CreateWindowW( L"static", NULL, WS_VISIBLE, 100, 100, 100, 100, NULL, NULL, NULL, NULL ); + ok( IsWindow( window ), "CreateWindowW failed.\n" ); + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, window, &IID_IHolographicSpace, (void **)&holographic_space ); + todo_wine + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + DestroyWindow( window ); + + window = CreateWindowW( L"static", NULL, WS_VISIBLE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, NULL, NULL ); + ok( IsWindow( window ), "CreateWindowW failed.\n" ); + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, window, &IID_IAgileObject, (void **)&holographic_space ); + todo_wine + ok( hr == S_OK, "got hr %#lx.\n", hr ); + DestroyWindow( window ); + if (SUCCEEDED( hr )) + { + ref = IHolographicSpace_Release( holographic_space ); + ok( ref == 0, "got ref %ld.\n", ref ); + } + + window = CreateWindowW( L"static", NULL, WS_VISIBLE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, NULL, NULL ); + ok( IsWindow( window ), "CreateWindowW failed.\n" ); + hr = IHolographicSpaceInterop_CreateForWindow( holographic_space_interop, window, &IID_IHolographicSpace, (void **)&holographic_space ); + todo_wine + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + DestroyWindow( window ); + if (SUCCEEDED( hr )) + { + ref = IHolographicSpace_Release( holographic_space ); + ok( ref == 0, "got ref %ld.\n", ref ); + } +cleanup: + ref = IHolographicSpaceInterop_Release( holographic_space_interop ); + ok( ref == 2, "got ref %ld.\n", ref ); done: ref = IActivationFactory_Release( factory ); ok( ref == 1, "got ref %ld.\n", ref );