From e75ceba11a62ae226d2530cad610c120df4303ac Mon Sep 17 00:00:00 2001 From: Connor McAdams Date: Mon, 25 Apr 2022 15:08:00 -0400 Subject: [PATCH] oleacc/tests: Add tests for IIS_IsOleaccProxy service on default accessible objects. Signed-off-by: Connor McAdams Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/oleacc/tests/main.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c index 5522867b085..ba7ac3cc3ac 100644 --- a/dlls/oleacc/tests/main.c +++ b/dlls/oleacc/tests/main.c @@ -27,6 +27,7 @@ #include #include #include +#include #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);