Commit 7c63087a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added navigator's IDispatchEx test.

parent d0ddece8
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "mshtmcid.h" #include "mshtmcid.h"
#include "mshtmhst.h" #include "mshtmhst.h"
#include "docobj.h" #include "docobj.h"
#include "dispex.h"
static const char doc_blank[] = "<html></html>"; static const char doc_blank[] = "<html></html>";
static const char doc_str1[] = "<html><body>test</body></html>"; static const char doc_str1[] = "<html><body>test</body></html>";
...@@ -268,6 +269,41 @@ static void _test_ifaces(unsigned line, IUnknown *iface, REFIID *iids) ...@@ -268,6 +269,41 @@ static void _test_ifaces(unsigned line, IUnknown *iface, REFIID *iids)
} }
} }
#define test_disp(u,id) _test_disp(__LINE__,u,id)
static void _test_disp(unsigned line, IUnknown *unk, const IID *diid)
{
IDispatchEx *dispex;
ITypeInfo *typeinfo;
UINT ticnt;
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IDispatchEx, (void**)&dispex);
ok_(__FILE__,line) (hres == S_OK, "Could not get IDispatch: %08x\n", hres);
if(FAILED(hres))
return;
ticnt = 0xdeadbeef;
hres = IDispatchEx_GetTypeInfoCount(dispex, &ticnt);
ok_(__FILE__,line) (hres == S_OK, "GetTypeInfoCount failed: %08x\n", hres);
ok_(__FILE__,line) (ticnt == 1, "ticnt=%u\n", ticnt);
hres = IDispatchEx_GetTypeInfo(dispex, 0, 0, &typeinfo);
ok_(__FILE__,line) (hres == S_OK, "GetTypeInfo failed: %08x\n", hres);
if(SUCCEEDED(hres)) {
TYPEATTR *type_attr;
hres = ITypeInfo_GetTypeAttr(typeinfo, &type_attr);
ok_(__FILE__,line) (hres == S_OK, "GetTypeAttr failed: %08x\n", hres);
ok_(__FILE__,line) (IsEqualGUID(&type_attr->guid, diid), "unexpected guid %s\n", dbgstr_guid(&type_attr->guid));
ITypeInfo_ReleaseTypeAttr(typeinfo, type_attr);
ITypeInfo_Release(typeinfo);
}
IDispatchEx_Release(dispex);
}
#define test_node_name(u,n) _test_node_name(__LINE__,u,n) #define test_node_name(u,n) _test_node_name(__LINE__,u,n)
static void _test_node_name(unsigned line, IUnknown *unk, const char *exname) static void _test_node_name(unsigned line, IUnknown *unk, const char *exname)
{ {
...@@ -1050,6 +1086,7 @@ static void test_navigator(IHTMLDocument2 *doc) ...@@ -1050,6 +1086,7 @@ static void test_navigator(IHTMLDocument2 *doc)
hres = IHTMLWindow2_get_navigator(window, &navigator); hres = IHTMLWindow2_get_navigator(window, &navigator);
ok(hres == S_OK, "get_navigator failed: %08x\n", hres); ok(hres == S_OK, "get_navigator failed: %08x\n", hres);
ok(navigator != NULL, "navigator == NULL\n"); ok(navigator != NULL, "navigator == NULL\n");
test_disp((IUnknown*)navigator, &IID_IOmNavigator);
hres = IHTMLWindow2_get_navigator(window, &navigator2); hres = IHTMLWindow2_get_navigator(window, &navigator2);
ok(hres == S_OK, "get_navigator failed: %08x\n", hres); ok(hres == S_OK, "get_navigator failed: %08x\n", hres);
......
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