Commit b12e967d authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3d9/tests: Fix test_lost_device() D3D9Ex test on Windows 10.

parent c71469be
......@@ -2058,20 +2058,21 @@ static void test_lost_device(void)
hr = IDirect3DDevice9Ex_CheckDeviceState(device, window);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
ok(hr == S_PRESENT_OCCLUDED || broken(hr == D3D_OK), "Got unexpected hr %#x.\n", hr);
ret = SetForegroundWindow(GetDesktopWindow());
ok(ret, "Failed to set foreground window.\n");
hr = IDirect3DDevice9Ex_TestCooperativeLevel(device);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_Present(device, NULL, NULL, NULL, NULL);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
ok(hr == S_PRESENT_OCCLUDED || hr == S_PRESENT_MODE_CHANGED || broken(hr == D3D_OK),
"Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_PresentEx(device, NULL, NULL, NULL, NULL, 0);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
ok(hr == S_PRESENT_OCCLUDED || hr == S_PRESENT_MODE_CHANGED, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_CheckDeviceState(device, window);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK || hr == S_PRESENT_MODE_CHANGED, "Got unexpected hr %#x.\n", hr);
ret = SetForegroundWindow(window);
ok(ret, "Failed to set foreground window.\n");
......@@ -2084,7 +2085,7 @@ static void test_lost_device(void)
hr = IDirect3DDevice9Ex_CheckDeviceState(device, window);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
ok(hr == S_PRESENT_OCCLUDED || hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
desc.width = 1024;
desc.height = 768;
......@@ -2099,7 +2100,7 @@ static void test_lost_device(void)
hr = IDirect3DDevice9Ex_CheckDeviceState(device, window);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
ok(hr == S_PRESENT_OCCLUDED || hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
desc.flags = 0;
hr = reset_device(device, &desc);
......@@ -2166,24 +2167,24 @@ static void test_lost_device(void)
hr = IDirect3DDevice9Ex_CheckDeviceState(device, window);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
ok(hr == S_PRESENT_OCCLUDED || hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ret = SetForegroundWindow(GetDesktopWindow());
ok(ret, "Failed to set foreground window.\n");
hr = IDirect3DDevice9Ex_Present(device, NULL, NULL, NULL, NULL);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
ok(hr == S_PRESENT_OCCLUDED || broken(hr == D3D_OK), "Got unexpected hr %#x.\n", hr);
hr = reset_device(device, &desc);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_TestCooperativeLevel(device);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_Present(device, NULL, NULL, NULL, NULL);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK || broken(hr == S_FALSE), "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_PresentEx(device, NULL, NULL, NULL, NULL, 0);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
ok(hr == D3D_OK || broken(hr == S_FALSE), "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_CheckDeviceState(device, window);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL);
ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr);
ok(hr == S_PRESENT_OCCLUDED || hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
refcount = IDirect3DDevice9Ex_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
......
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