dxgi/tests: Add tests for setting the fullscreen state of swapchains with destroyed windows.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Eikum 2019-06-20 02:29:46 +04:30 committed by Alexandre Julliard
parent 9de80e1edd
commit 67110d37e9
1 changed files with 34 additions and 0 deletions

View File

@ -2282,6 +2282,40 @@ static void test_set_fullscreen(void)
ok(!refcount, "IDXGISwapChain has %u references left.\n", refcount);
DestroyWindow(swapchain_desc.OutputWindow);
swapchain_desc.OutputWindow = CreateWindowA("static", "dxgi_test", 0, 0, 0, 400, 200, 0, 0, 0, 0);
check_window_fullscreen_state(swapchain_desc.OutputWindow, &initial_state.fullscreen_state);
hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &swapchain_desc, &swapchain);
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);
DestroyWindow(swapchain_desc.OutputWindow);
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, NULL);
todo_wine ok(hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE, "Got unexpected hr %#x.\n", hr);
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
refcount = IDXGISwapChain_Release(swapchain);
ok(!refcount, "IDXGISwapChain has %u references left.\n", refcount);
swapchain_desc.OutputWindow = CreateWindowA("static", "dxgi_test", 0, 0, 0, 400, 200, 0, 0, 0, 0);
check_window_fullscreen_state(swapchain_desc.OutputWindow, &initial_state.fullscreen_state);
hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &swapchain_desc, &swapchain);
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);
DestroyWindow(swapchain_desc.OutputWindow);
hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, NULL);
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_SetFullscreenState(swapchain, TRUE, NULL);
todo_wine ok(hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE, "Got unexpected hr %#x.\n", hr);
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
refcount = IDXGISwapChain_Release(swapchain);
ok(!refcount, "IDXGISwapChain has %u references left.\n", refcount);
swapchain_desc.OutputWindow = CreateWindowA("static", "dxgi_test", 0, 0, 0, 400, 200, 0, 0, 0, 0);
check_window_fullscreen_state(swapchain_desc.OutputWindow, &initial_state.fullscreen_state);
swapchain_desc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;