forked from Mirrors/wine-wine
uiautomationcore: Add UiaHostProviderFromHwnd() stub.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>stable
parent
9781b5433c
commit
35b01d6205
|
@ -19985,6 +19985,7 @@ wine_fn_config_makefile dlls/tzres enable_tzres
|
||||||
wine_fn_config_makefile dlls/ucrtbase enable_ucrtbase
|
wine_fn_config_makefile dlls/ucrtbase enable_ucrtbase
|
||||||
wine_fn_config_makefile dlls/ucrtbase/tests enable_tests
|
wine_fn_config_makefile dlls/ucrtbase/tests enable_tests
|
||||||
wine_fn_config_makefile dlls/uiautomationcore enable_uiautomationcore
|
wine_fn_config_makefile dlls/uiautomationcore enable_uiautomationcore
|
||||||
|
wine_fn_config_makefile dlls/uiautomationcore/tests enable_tests
|
||||||
wine_fn_config_makefile dlls/uiribbon enable_uiribbon
|
wine_fn_config_makefile dlls/uiribbon enable_uiribbon
|
||||||
wine_fn_config_makefile dlls/unicows enable_unicows
|
wine_fn_config_makefile dlls/unicows enable_unicows
|
||||||
wine_fn_config_makefile dlls/updspapi enable_updspapi
|
wine_fn_config_makefile dlls/updspapi enable_updspapi
|
||||||
|
|
|
@ -3724,6 +3724,7 @@ WINE_CONFIG_MAKEFILE(dlls/tzres)
|
||||||
WINE_CONFIG_MAKEFILE(dlls/ucrtbase)
|
WINE_CONFIG_MAKEFILE(dlls/ucrtbase)
|
||||||
WINE_CONFIG_MAKEFILE(dlls/ucrtbase/tests)
|
WINE_CONFIG_MAKEFILE(dlls/ucrtbase/tests)
|
||||||
WINE_CONFIG_MAKEFILE(dlls/uiautomationcore)
|
WINE_CONFIG_MAKEFILE(dlls/uiautomationcore)
|
||||||
|
WINE_CONFIG_MAKEFILE(dlls/uiautomationcore/tests)
|
||||||
WINE_CONFIG_MAKEFILE(dlls/uiribbon)
|
WINE_CONFIG_MAKEFILE(dlls/uiribbon)
|
||||||
WINE_CONFIG_MAKEFILE(dlls/unicows)
|
WINE_CONFIG_MAKEFILE(dlls/unicows)
|
||||||
WINE_CONFIG_MAKEFILE(dlls/updspapi)
|
WINE_CONFIG_MAKEFILE(dlls/updspapi)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
MODULE = uiautomationcore.dll
|
MODULE = uiautomationcore.dll
|
||||||
|
IMPORTLIB = uiautomationcore
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
uia_main.c
|
uia_main.c
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
TESTDLL = uiautomationcore.dll
|
||||||
|
IMPORTS = uiautomationcore user32
|
||||||
|
|
||||||
|
C_SRCS = \
|
||||||
|
uiautomation.c
|
|
@ -0,0 +1,92 @@
|
||||||
|
/*
|
||||||
|
* UI Automation tests
|
||||||
|
*
|
||||||
|
* Copyright 2019 Nikolay Sivov for CodeWeavers
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
|
|
||||||
|
#include "windows.h"
|
||||||
|
#include "initguid.h"
|
||||||
|
#include "uiautomation.h"
|
||||||
|
|
||||||
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
static LRESULT WINAPI test_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
return DefWindowProcA(hwnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void test_UiaHostProviderFromHwnd(void)
|
||||||
|
{
|
||||||
|
IRawElementProviderSimple *p, *p2;
|
||||||
|
WNDCLASSA cls;
|
||||||
|
HRESULT hr;
|
||||||
|
HWND hwnd;
|
||||||
|
|
||||||
|
cls.style = 0;
|
||||||
|
cls.lpfnWndProc = test_wnd_proc;
|
||||||
|
cls.cbClsExtra = 0;
|
||||||
|
cls.cbWndExtra = 0;
|
||||||
|
cls.hInstance = GetModuleHandleA(NULL);
|
||||||
|
cls.hIcon = 0;
|
||||||
|
cls.hCursor = NULL;
|
||||||
|
cls.hbrBackground = NULL;
|
||||||
|
cls.lpszMenuName = NULL;
|
||||||
|
cls.lpszClassName = "HostProviderFromHwnd class";
|
||||||
|
|
||||||
|
RegisterClassA(&cls);
|
||||||
|
|
||||||
|
hwnd = CreateWindowExA(0, "HostProviderFromHwnd class", "Test window 1",
|
||||||
|
WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE,
|
||||||
|
0, 0, 100, 100, GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL);
|
||||||
|
ok(hwnd != NULL, "Failed to create a test window.\n");
|
||||||
|
|
||||||
|
p = (void *)0xdeadbeef;
|
||||||
|
hr = UiaHostProviderFromHwnd(NULL, &p);
|
||||||
|
todo_wine {
|
||||||
|
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||||
|
ok(p == NULL, "Unexpected instance.\n");
|
||||||
|
}
|
||||||
|
p = NULL;
|
||||||
|
hr = UiaHostProviderFromHwnd(hwnd, &p);
|
||||||
|
todo_wine
|
||||||
|
ok(hr == S_OK, "Failed to get host provider, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
if (hr == S_OK)
|
||||||
|
{
|
||||||
|
p2 = NULL;
|
||||||
|
hr = UiaHostProviderFromHwnd(hwnd, &p2);
|
||||||
|
ok(hr == S_OK, "Failed to get host provider, hr %#x.\n", hr);
|
||||||
|
ok(p != p2, "Unexpected instance.\n");
|
||||||
|
IRawElementProviderSimple_Release(p2);
|
||||||
|
|
||||||
|
hr = IRawElementProviderSimple_get_HostRawElementProvider(p, &p2);
|
||||||
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
ok(p2 == NULL, "Unexpected instance.\n");
|
||||||
|
|
||||||
|
IRawElementProviderSimple_Release(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
DestroyWindow(hwnd);
|
||||||
|
UnregisterClassA("HostProviderFromHwnd class", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
START_TEST(uiautomation)
|
||||||
|
{
|
||||||
|
test_UiaHostProviderFromHwnd();
|
||||||
|
}
|
|
@ -93,3 +93,9 @@ HRESULT WINAPI UiaRaiseAutomationEvent(IRawElementProviderSimple *provider, EVEN
|
||||||
FIXME("(%p, %d): stub\n", provider, id);
|
FIXME("(%p, %d): stub\n", provider, id);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI UiaHostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **provider)
|
||||||
|
{
|
||||||
|
FIXME("(%p, %p): stub\n", hwnd, provider);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
@ stub UiaHTextRangeFromVariant
|
@ stub UiaHTextRangeFromVariant
|
||||||
@ stub UiaHUiaNodeFromVariant
|
@ stub UiaHUiaNodeFromVariant
|
||||||
@ stub UiaHasServerSideProvider
|
@ stub UiaHasServerSideProvider
|
||||||
@ stub UiaHostProviderFromHwnd
|
@ stdcall UiaHostProviderFromHwnd(long ptr)
|
||||||
#@ stub UiaIAccessibleFromProvider
|
#@ stub UiaIAccessibleFromProvider
|
||||||
@ stdcall UiaLookupId(long ptr)
|
@ stdcall UiaLookupId(long ptr)
|
||||||
@ stub UiaNavigate
|
@ stub UiaNavigate
|
||||||
|
|
|
@ -59,6 +59,7 @@ BOOL WINAPI UiaPatternRelease(HUIAPATTERNOBJECT hobj);
|
||||||
HRESULT WINAPI UiaRaiseAutomationEvent(IRawElementProviderSimple *provider, EVENTID id);
|
HRESULT WINAPI UiaRaiseAutomationEvent(IRawElementProviderSimple *provider, EVENTID id);
|
||||||
LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *elprov);
|
LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *elprov);
|
||||||
BOOL WINAPI UiaTextRangeRelease(HUIATEXTRANGE hobj);
|
BOOL WINAPI UiaTextRangeRelease(HUIATEXTRANGE hobj);
|
||||||
|
HRESULT WINAPI UiaHostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **elprov);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue