-- v2: uiautomationcore: Return TRUE from UiaClientsAreListening().
From: connor cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/uiautomationcore/tests/uiautomation.c | 19 +++++++++++++++++++ dlls/uiautomationcore/uia_provider.c | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 9210583062f..6cb6e56d99b 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -3836,6 +3836,7 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) IRawElementProviderFragmentRoot *elroot, *elroot2; IRawElementProviderFragment *elfrag, *elfrag2; IRawElementProviderSimple *elprov; + SAFEARRAY *ret_arr; ULONG old_ref; HRESULT hr;
@@ -3852,6 +3853,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n");
+ /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * get_FragmentRoot does the equivalent of calling * AccessibleObjectFromWindow with OBJID_CLIENT on the HWND associated @@ -4161,6 +4168,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n");
+ /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * Simple child element queries HWND as well, does not just return its * parent. @@ -4212,6 +4225,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n");
+ /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * Again, same behavior as simple children. It doesn't just retrieve the * parent IAccessible, it queries the HWND. diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 4ecef2a4752..33bed429ec6 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1005,9 +1005,9 @@ static HRESULT WINAPI msaa_fragment_get_BoundingRectangle(IRawElementProviderFra static HRESULT WINAPI msaa_fragment_GetEmbeddedFragmentRoots(IRawElementProviderFragment *iface, SAFEARRAY **ret_val) { - FIXME("%p, %p: stub!\n", iface, ret_val); + TRACE("%p, %p\n", iface, ret_val); *ret_val = NULL; - return E_NOTIMPL; + return S_OK; }
static HRESULT WINAPI msaa_fragment_SetFocus(IRawElementProviderFragment *iface)
From: connor cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/uiautomationcore/uia_provider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 33bed429ec6..2e5f0e6c6ea 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1883,7 +1883,7 @@ static HRESULT WINAPI base_hwnd_fragment_GetEmbeddedFragmentRoots(IRawElementPro { FIXME("%p, %p: stub!\n", iface, ret_val); *ret_val = NULL; - return E_NOTIMPL; + return S_OK; }
static HRESULT WINAPI base_hwnd_fragment_SetFocus(IRawElementProviderFragment *iface)
From: connor cmcadams@codeweavers.com
create_uia_node_from_hwnd() is expected to fail if the HWND doesn't have a native serverside provider.
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/uiautomationcore/uia_com_client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/uiautomationcore/uia_com_client.c b/dlls/uiautomationcore/uia_com_client.c index 5c0d0cd0b9e..43b16db74f8 100644 --- a/dlls/uiautomationcore/uia_com_client.c +++ b/dlls/uiautomationcore/uia_com_client.c @@ -1372,8 +1372,7 @@ static HRESULT uia_event_handlers_add_handler(IUnknown *handler_iface, SAFEARRAY { HUIANODE node = NULL;
- hr = create_uia_node_from_hwnd(info.hwndFocus, &node, NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS); - if (SUCCEEDED(hr)) + if (SUCCEEDED(create_uia_node_from_hwnd(info.hwndFocus, &node, NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS))) uia_com_focus_handler_advise_node(event, node, info.hwndFocus); UiaNodeRelease(node); }
From: connor cmcadams@codeweavers.com
This function always returns TRUE on Windows 7 and above, and now that we have stubs for all the event raising functions there should be no harm in doing the same.
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/uiautomationcore/tests/uiautomation.c | 10 ++++++++++ dlls/uiautomationcore/uia_main.c | 4 ++-- include/uiautomationcoreapi.h | 1 + 3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 6cb6e56d99b..67dcb04dadc 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -18607,6 +18607,15 @@ static void test_uia_event_ProxyProviderWinEventHandler(void) UiaRegisterProviderCallback(NULL); }
+static void test_UiaClientsAreListening(void) +{ + BOOL ret; + + /* Always returns TRUE on Windows 7 and above. */ + ret = UiaClientsAreListening(); + ok(!!ret, "ret != TRUE\n"); +} + /* * Once a process returns a UI Automation provider with * UiaReturnRawElementProvider it ends up in an implicit MTA until exit. This @@ -18663,6 +18672,7 @@ START_TEST(uiautomation) return; }
+ test_UiaClientsAreListening(); test_UiaHostProviderFromHwnd(); test_uia_reserved_value_ifaces(); test_UiaLookupId(); diff --git a/dlls/uiautomationcore/uia_main.c b/dlls/uiautomationcore/uia_main.c index 9ca320b1ba0..8c7a72bb35e 100644 --- a/dlls/uiautomationcore/uia_main.c +++ b/dlls/uiautomationcore/uia_main.c @@ -264,8 +264,8 @@ static const IRawElementProviderSimpleVtbl hwnd_host_provider_vtbl = { */ BOOL WINAPI UiaClientsAreListening(void) { - FIXME("()\n"); - return FALSE; + TRACE("()\n"); + return TRUE; }
/*********************************************************************** diff --git a/include/uiautomationcoreapi.h b/include/uiautomationcoreapi.h index 0fd942f3f37..fbfbc46b09c 100644 --- a/include/uiautomationcoreapi.h +++ b/include/uiautomationcoreapi.h @@ -559,6 +559,7 @@ HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent); HRESULT WINAPI UiaEventAddWindow(HUIAEVENT huiaevent, HWND hwnd); HRESULT WINAPI UiaEventRemoveWindow(HUIAEVENT huiaevent, HWND hwnd); BOOL WINAPI UiaHasServerSideProvider(HWND hwnd); +BOOL WINAPI UiaClientsAreListening(void);
#ifdef __cplusplus }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=139211
Your paranoid android.
=== w10pro64 (32 bit report) ===
uiautomationcore: uiautomation.c:3282: Test failed: unexpected call winproc_GETOBJECT_UiaRoot uiautomation.c:9002: Test failed: unexpected call prov_callback_nonclient uiautomation.c:8985: Test failed: unexpected call prov_callback_base_hwnd
This merge request was approved by Esme Povirk.
Could you please fix the authorship of the git commits?