Commit 6f3bd0bc authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

uiautomationcore: Implement IUIAutomationTreeWalker::GetParentElement{BuildCache}.

parent b9d10cee
......@@ -11753,6 +11753,19 @@ static const struct prov_method_sequence treewalker_seq8[] = {
{ 0 }
};
static const struct prov_method_sequence treewalker_seq9[] = {
{ &Provider_child2, FRAG_NAVIGATE }, /* NavigateDirection_Parent */
NODE_CREATE_SEQ(&Provider),
{ 0 }
};
static const struct prov_method_sequence treewalker_seq10[] = {
{ &Provider_child2, FRAG_NAVIGATE }, /* NavigateDirection_Parent */
NODE_CREATE_SEQ(&Provider),
{ &Provider, FRAG_GET_RUNTIME_ID },
{ 0 }
};
static void test_CUIAutomation_TreeWalker_ifaces(IUIAutomation *uia_iface)
{
HWND hwnd = create_test_hwnd("test_CUIAutomation_TreeWalker_ifaces class");
......@@ -11879,6 +11892,26 @@ static void test_CUIAutomation_TreeWalker_ifaces(IUIAutomation *uia_iface)
IUIAutomationElement_Release(element3);
ok(Provider_child.ref == 1, "Unexpected refcnt %ld\n", Provider_child.ref);
/* NavigateDirection_Parent. */
element3 = NULL;
Provider.hwnd = NULL;
hr = IUIAutomationTreeWalker_GetParentElement(walker, element2, &element3);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Provider.ref == 3, "Unexpected refcnt %ld\n", Provider.ref);
ok(!!element3, "element3 == NULL\n");
ok_method_sequence(treewalker_seq9, "treewalker_seq9");
IUIAutomationElement_Release(element3);
ok(Provider.ref == 2, "Unexpected refcnt %ld\n", Provider.ref);
element3 = NULL;
hr = IUIAutomationTreeWalker_GetParentElementBuildCache(walker, element2, cache_req, &element3);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(Provider.ref == 3, "Unexpected refcnt %ld\n", Provider.ref);
ok(!!element3, "element3 == NULL\n");
ok_method_sequence(treewalker_seq10, "treewalker_seq10");
IUIAutomationElement_Release(element3);
ok(Provider.ref == 2, "Unexpected refcnt %ld\n", Provider.ref);
IUIAutomationElement_Release(element2);
ok(Provider_child2.ref == 1, "Unexpected refcnt %ld\n", Provider_child2.ref);
......
......@@ -2499,8 +2499,11 @@ static ULONG WINAPI uia_tree_walker_Release(IUIAutomationTreeWalker *iface)
static HRESULT WINAPI uia_tree_walker_GetParentElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem,
IUIAutomationElement **parent)
{
FIXME("%p, %p, %p: stub\n", iface, elem, parent);
return E_NOTIMPL;
struct uia_tree_walker *tree_walker = impl_from_IUIAutomationTreeWalker(iface);
TRACE("%p, %p, %p\n", iface, elem, parent);
return IUIAutomationTreeWalker_GetParentElementBuildCache(iface, elem, tree_walker->default_cache_req, parent);
}
static HRESULT WINAPI uia_tree_walker_GetFirstChildElement(IUIAutomationTreeWalker *iface, IUIAutomationElement *elem,
......@@ -2587,8 +2590,9 @@ static HRESULT uia_tree_walker_navigate(IUIAutomationTreeWalker *walker, IUIAuto
static HRESULT WINAPI uia_tree_walker_GetParentElementBuildCache(IUIAutomationTreeWalker *iface,
IUIAutomationElement *elem, IUIAutomationCacheRequest *cache_req, IUIAutomationElement **parent)
{
FIXME("%p, %p, %p, %p: stub\n", iface, elem, cache_req, parent);
return E_NOTIMPL;
TRACE("%p, %p, %p, %p\n", iface, elem, cache_req, parent);
return uia_tree_walker_navigate(iface, cache_req, elem, NavigateDirection_Parent, parent);
}
static HRESULT WINAPI uia_tree_walker_GetFirstChildElementBuildCache(IUIAutomationTreeWalker *iface,
......
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