From a7984a3a9a38101f2775ca2889c64f905ad31ac7 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 24 Jan 2020 19:32:08 +0330 Subject: [PATCH] dxgi/tests: Test the fullscreen state after the swapchain window is destroyed. Signed-off-by: Andrew Eikum Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/dxgi/tests/dxgi.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index b2b53f7a4ca..aaef8113640 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -2363,6 +2363,7 @@ static void test_set_fullscreen(IUnknown *device, BOOL is_d3d12) IDXGISwapChain *swapchain; IDXGIFactory *factory; IDXGIOutput *output; + BOOL fullscreen; ULONG refcount; HRESULT hr; @@ -2432,11 +2433,20 @@ static void test_set_fullscreen(IUnknown *device, BOOL is_d3d12) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!fullscreen, "Got unexpected fullscreen %#x.\n", fullscreen); DestroyWindow(swapchain_desc.OutputWindow); hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!fullscreen, "Got unexpected fullscreen %#x.\n", fullscreen); hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, NULL); ok(hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE, "Got unexpected hr %#x.\n", hr); + hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!fullscreen, "Got unexpected fullscreen %#x.\n", fullscreen); hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); refcount = IDXGISwapChain_Release(swapchain); @@ -2448,13 +2458,25 @@ static void test_set_fullscreen(IUnknown *device, BOOL is_d3d12) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!!fullscreen, "Got unexpected fullscreen %#x.\n", fullscreen); DestroyWindow(swapchain_desc.OutputWindow); hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!!fullscreen, "Got unexpected fullscreen %#x.\n", fullscreen); hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!fullscreen, "Got unexpected fullscreen %#x.\n", fullscreen); hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, NULL); ok(hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE, "Got unexpected hr %#x.\n", hr); + hr = IDXGISwapChain_GetFullscreenState(swapchain, &fullscreen, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!fullscreen, "Got unexpected fullscreen %#x.\n", fullscreen); hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); refcount = IDXGISwapChain_Release(swapchain);