Commit f4ded1c2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Added mime filters tests.

parent 8a669c9a
......@@ -935,6 +935,13 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pOuter,
REFIID riid, void **ppv)
{
ok(0, "unexpected call\n");
return E_NOTIMPL;
}
static HRESULT WINAPI ProtocolCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter,
REFIID riid, void **ppv)
{
CHECK_EXPECT(CreateInstance);
ok(iface == expect_cf, "unexpected iface\n");
......@@ -960,8 +967,17 @@ static const IClassFactoryVtbl ClassFactoryVtbl = {
ClassFactory_LockServer
};
static IClassFactory test_protocol_cf = { &ClassFactoryVtbl };
static IClassFactory test_protocol_cf2 = { &ClassFactoryVtbl };
static const IClassFactoryVtbl ProtocolCFVtbl = {
ClassFactory_QueryInterface,
ClassFactory_AddRef,
ClassFactory_Release,
ProtocolCF_CreateInstance,
ClassFactory_LockServer
};
static IClassFactory test_protocol_cf = { &ProtocolCFVtbl };
static IClassFactory test_protocol_cf2 = { &ProtocolCFVtbl };
static IClassFactory test_cf = { &ClassFactoryVtbl };
static void test_NameSpace(void)
{
......@@ -1089,6 +1105,33 @@ static void test_NameSpace(void)
IInternetSession_Release(session);
}
static void test_MimeFilter(void)
{
IInternetSession *session;
HRESULT hres;
static const WCHAR mimeW[] = {'t','e','s','t','/','m','i','m','e',0};
hres = CoInternetGetSession(0, &session, 0);
ok(hres == S_OK, "CoInternetGetSession failed: %08x\n", hres);
if(FAILED(hres))
return;
hres = IInternetSession_RegisterMimeFilter(session, &test_cf, &IID_NULL, mimeW);
ok(hres == S_OK, "RegisterMimeFilter failed: %08x\n", hres);
hres = IInternetSession_UnregisterMimeFilter(session, &test_cf, mimeW);
ok(hres == S_OK, "UnregisterMimeFilter failed: %08x\n", hres);
hres = IInternetSession_UnregisterMimeFilter(session, &test_cf, mimeW);
ok(hres == S_OK, "UnregisterMimeFilter failed: %08x\n", hres);
hres = IInternetSession_UnregisterMimeFilter(session, (void*)0xdeadbeef, mimeW);
ok(hres == S_OK, "UnregisterMimeFilter failed: %08x\n", hres);
IInternetSession_Release(session);
}
static ULONG WINAPI unk_Release(IUnknown *iface)
{
CHECK_EXPECT(unk_Release);
......@@ -1243,6 +1286,7 @@ START_TEST(misc)
test_SecurityManager();
test_ZoneManager();
test_NameSpace();
test_MimeFilter();
test_ReleaseBindInfo();
test_UrlMkGetSessionOption();
test_ObtainUserAgentString();
......
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