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

Alexandre Julliard julliard at winehq.org
Tue Apr 26 16:25:25 CDT 2022


Module: wine
Branch: master
Commit: e75ceba11a62ae226d2530cad610c120df4303ac
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e75ceba11a62ae226d2530cad610c120df4303ac

Author: Connor McAdams <cmcadams at codeweavers.com>
Date:   Mon Apr 25 15:08:00 2022 -0400

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

Signed-off-by: Connor McAdams <cmcadams at codeweavers.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 <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);




More information about the wine-cvs mailing list