shdocvw: Implement IWebBrowser2_get_Name.

This commit is contained in:
Alistair Leslie-Hughes 2009-12-04 22:49:29 +11:00 committed by Alexandre Julliard
parent 2536bfd1d8
commit e7906026bb
2 changed files with 22 additions and 2 deletions

View File

@ -139,6 +139,13 @@ static IWebBrowser2 *wb;
static HWND container_hwnd, shell_embedding_hwnd; static HWND container_hwnd, shell_embedding_hwnd;
static BOOL is_downloading = FALSE; static BOOL is_downloading = FALSE;
static int strcmp_wa(LPCWSTR strw, const char *stra)
{
CHAR buf[512];
WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
return lstrcmpA(stra, buf);
}
static const char *debugstr_guid(REFIID riid) static const char *debugstr_guid(REFIID riid)
{ {
static char buf[50]; static char buf[50];
@ -1588,6 +1595,7 @@ static void test_ie_funcs(IUnknown *unk)
int i; int i;
LONG hwnd; LONG hwnd;
HRESULT hres; HRESULT hres;
BSTR sName;
hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb); hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres); ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
@ -1807,6 +1815,12 @@ static void test_ie_funcs(IUnknown *unk)
hres = IWebBrowser2_get_Application(wb, NULL); hres = IWebBrowser2_get_Application(wb, NULL);
ok(hres == E_POINTER, "get_Application failed: %08x, expected E_POINTER\n", hres); ok(hres == E_POINTER, "get_Application failed: %08x, expected E_POINTER\n", hres);
/* Name */
hres = IWebBrowser2_get_Name(wb, &sName);
ok(hres == S_OK, "getName failed: %08x, expected S_OK\n", hres);
ok(!strcmp_wa(sName, "Microsoft Web Browser Control"), "got '%s', expected 'Microsoft Web Browser Control'\n", wine_dbgstr_w(sName));
SysFreeString(sName);
/* Quit */ /* Quit */
hres = IWebBrowser2_Quit(wb); hres = IWebBrowser2_Quit(wb);

View File

@ -530,9 +530,15 @@ static HRESULT WINAPI WebBrowser_GetProperty(IWebBrowser2 *iface, BSTR szPropert
static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name) static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name)
{ {
static const WCHAR sName[] = {'M','i','c','r','o','s','o','f','t',' ','W','e','b',\
' ','B','r','o','w','s','e','r',' ','C','o','n','t','r','o','l',0};
WebBrowser *This = WEBBROWSER_THIS(iface); WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, Name);
return E_NOTIMPL; TRACE("(%p)->(%p)\n", This, Name);
*Name = SysAllocString(sName);
return S_OK;
} }
static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND) static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND)