dxgi/tests: Add test for creating swapchains for windows with empty client rect.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-05-17 15:46:55 +02:00 committed by Alexandre Julliard
parent 1cc74ea215
commit 9f96ada78a
1 changed files with 23 additions and 0 deletions

View File

@ -1385,6 +1385,29 @@ static void test_create_swapchain(void)
expected_width = expected_client_rect->right;
expected_height = expected_client_rect->bottom;
creation_desc.BufferDesc.Width = 0;
creation_desc.BufferDesc.Height = 0;
hr = IDXGIFactory_CreateSwapChain(factory, obj, &creation_desc, &swapchain);
ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);
ok(SUCCEEDED(hr), "GetDesc failed, hr %#x.\n", hr);
ok(result_desc.BufferDesc.Width == expected_width, "Got width %u, expected %u.\n",
result_desc.BufferDesc.Width, expected_width);
ok(result_desc.BufferDesc.Height == expected_height, "Got height %u, expected %u.\n",
result_desc.BufferDesc.Height, expected_height);
check_swapchain_fullscreen_state(swapchain, &expected_state);
IDXGISwapChain_Release(swapchain);
DestroyWindow(creation_desc.OutputWindow);
creation_desc.OutputWindow = CreateWindowA("static", "dxgi_test",
WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
1, 1, 0, 0, 0, 0, 0, 0);
SetRect(&expected_state.fullscreen_state.window_rect, 1, 1, 1, 1);
SetRectEmpty(expected_client_rect);
expected_width = expected_height = 8;
creation_desc.BufferDesc.Width = 0;
creation_desc.BufferDesc.Height = 0;
hr = IDXGIFactory_CreateSwapChain(factory, obj, &creation_desc, &swapchain);
ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr);
hr = IDXGISwapChain_GetDesc(swapchain, &result_desc);