Commit 9f96ada7 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

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

parent 1cc74ea2
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment