oleacc/tests: Add tests for IIS_IsOleaccProxy service on default accessible objects.

Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Connor McAdams 2022-04-25 15:08:00 -04:00 committed by Alexandre Julliard
parent 7af93f497c
commit e75ceba11a
1 changed files with 29 additions and 0 deletions

View File

@ -27,6 +27,7 @@
#include <ole2.h>
#include <commctrl.h>
#include <oleacc.h>
#include <servprov.h>
#define DEFINE_EXPECT(func) \
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
@ -1409,6 +1410,32 @@ static LRESULT WINAPI test_query_class(HWND hwnd, UINT msg, WPARAM wparam, LPARA
return 0;
}
#define check_acc_proxy_service( acc ) \
check_acc_proxy_service_( (acc), __LINE__)
static void check_acc_proxy_service_(IAccessible *acc, int line)
{
IServiceProvider *service = NULL;
IUnknown *unk = NULL;
HRESULT hr;
hr = IAccessible_QueryInterface(acc, &IID_IServiceProvider, (void **)&service);
todo_wine ok(hr == S_OK, "got %#lx\n", hr);
if (SUCCEEDED(hr))
{
hr = IServiceProvider_QueryService(service, &IIS_IsOleaccProxy, &IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "got %#lx\n", hr);
ok(!!unk, "unk == NULL\n");
ok(iface_cmp(unk, (IUnknown*)acc), "unk != acc\n");
IUnknown_Release(unk);
unk = (IUnknown*)0xdeadbeef;
hr = IServiceProvider_QueryService(service, &IID_IUnknown, &IID_IUnknown, (void **)&unk);
ok(hr == E_INVALIDARG, "got %#lx\n", hr);
ok(!unk, "unk != NULL\n");
IServiceProvider_Release(service);
}
}
static void test_CreateStdAccessibleObject_classes(void)
{
static const struct {
@ -1463,6 +1490,7 @@ static void test_CreateStdAccessibleObject_classes(void)
ok(hr == S_OK, "CreateStdAccessibleObject failed %lx\n", hr);
if (tests[i].client)
CHECK_CALLED(winproc_GETOBJECT);
check_acc_proxy_service(acc);
IAccessible_Release(acc);
if (tests[i].window)
@ -1471,6 +1499,7 @@ static void test_CreateStdAccessibleObject_classes(void)
ok(hr == S_OK, "CreateStdAccessibleObject failed %lx\n", hr);
if (tests[i].window)
CHECK_CALLED(winproc_GETOBJECT);
check_acc_proxy_service(acc);
IAccessible_Release(acc);
SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)win_proc);