Commit 360cf273 authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

shell32/tests: Test that shell view windows reference their shell view.

parent 9375b06c
......@@ -634,6 +634,7 @@ static void test_CreateViewWindow(void)
IDropTarget *dt;
HRESULT hr;
RECT r = {0};
ULONG ref1, ref2;
hr = SHGetDesktopFolder(&desktop);
ok(hr == S_OK, "got (0x%08x)\n", hr);
......@@ -676,11 +677,29 @@ if (0)
ok(hr == S_OK, "got (0x%08x)\n", hr);
IDropTarget_Release(dt);
IShellView_AddRef(view);
ref1 = IShellView_Release(view);
hr = IShellView_DestroyViewWindow(view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
ok(!IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view);
ref2 = IShellView_Release(view);
ok(ref1 > ref2, "expected %u > %u\n", ref1, ref2);
ref1 = ref2;
/* Show that releasing the shell view does not destroy the window */
hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
ok(hr == S_OK, "got (0x%08x)\n", hr);
hwnd_view = NULL;
hr = IShellView_CreateViewWindow(view, NULL, &settings, &test_shellbrowser, &r, &hwnd_view);
ok(hr == S_OK || broken(hr == S_FALSE), "got (0x%08x)\n", hr);
ok(hwnd_view != NULL, "got %p\n", hwnd_view);
ok(IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view);
ref2 = IShellView_Release(view);
ok(ref2 != 0, "ref2 = %u\n", ref2);
ok(ref2 > ref1, "expected %u > %u\n", ref2, ref1);
ok(IsWindow(hwnd_view), "hwnd %p still valid\n", hwnd_view);
DestroyWindow(hwnd_view);
IShellView_Release(view);
IShellFolder_Release(desktop);
}
......
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