Jacek Caban : mshtml: Added IHTMLPluginsCollection:: get_length implementation.
Alexandre Julliard
julliard at winehq.org
Mon Aug 1 13:22:09 CDT 2011
Module: wine
Branch: master
Commit: 7d4e9f77929dbb233db6e69e593e91ecb936494e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7d4e9f77929dbb233db6e69e593e91ecb936494e
Author: Jacek Caban <jacek at codeweavers.com>
Date: Sun Jul 31 16:45:08 2011 +0200
mshtml: Added IHTMLPluginsCollection::get_length implementation.
---
dlls/mshtml/omnavigator.c | 8 ++++++--
dlls/mshtml/tests/dom.c | 20 ++++++++++++++++++--
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c
index 79db598..b4b5c15 100644
--- a/dlls/mshtml/omnavigator.c
+++ b/dlls/mshtml/omnavigator.c
@@ -145,8 +145,12 @@ static HRESULT WINAPI HTMLPluginsCollection_Invoke(IHTMLPluginsCollection *iface
static HRESULT WINAPI HTMLPluginsCollection_get_length(IHTMLPluginsCollection *iface, LONG *p)
{
HTMLPluginsCollection *This = impl_from_IHTMLPluginsCollection(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ /* IE always returns 0 here */
+ *p = 0;
+ return S_OK;
}
static HRESULT WINAPI HTMLPluginsCollection_refresh(IHTMLPluginsCollection *iface, VARIANT_BOOL reload)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index adffac2..08be27d 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -3760,12 +3760,19 @@ static void test_location(IHTMLDocument2 *doc)
ok(!ref, "location chould be destroyed here\n");
}
-static void test_plugins_col(IOmNavigator *nav)
+static void test_plugins_col(IHTMLDocument2 *doc)
{
IHTMLPluginsCollection *col, *col2;
+ IHTMLWindow2 *window;
+ IOmNavigator *nav;
ULONG ref;
+ LONG len;
HRESULT hres;
+ window = get_doc_window(doc);
+ hres = IHTMLWindow2_get_navigator(window, &nav);
+ IHTMLWindow2_Release(window);
+
hres = IOmNavigator_get_plugins(nav, &col);
ok(hres == S_OK, "get_plugins failed: %08x\n", hres);
@@ -3776,8 +3783,15 @@ static void test_plugins_col(IOmNavigator *nav)
test_disp2((IUnknown*)col, &DIID_DispCPlugins, &IID_IHTMLPluginsCollection, "[object]");
+ len = 0xdeadbeef;
+ hres = IHTMLPluginsCollection_get_length(col, &len);
+ ok(hres == S_OK, "get_length failed: %08x\n", hres);
+ ok(!len, "length = %d\n", len);
+
ref = IHTMLPluginsCollection_Release(col);
ok(!ref, "ref=%d\n", ref);
+
+ IOmNavigator_Release(nav);
}
static void test_mime_types_col(IOmNavigator *nav)
@@ -3892,7 +3906,6 @@ static void test_navigator(IHTMLDocument2 *doc)
skip("nonstandard user agent\n");
}
- test_plugins_col(navigator);
test_mime_types_col(navigator);
ref = IOmNavigator_Release(navigator);
@@ -4263,6 +4276,7 @@ static void test_defaults(IHTMLDocument2 *doc)
test_compatmode(doc);
test_location(doc);
test_navigator(doc);
+ test_plugins_col(doc);
elem2 = get_elem2_iface((IUnknown*)elem);
hres = IHTMLElement2_get_currentStyle(elem2, &cstyle);
@@ -4653,6 +4667,8 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElementCollection_Release(collection);
}
+ test_plugins_col(doc);
+
elem = get_doc_elem(doc);
test_elem_all((IUnknown*)elem, all_types+1, sizeof(all_types)/sizeof(all_types[0])-1);
IHTMLElement_Release(elem);
More information about the wine-cvs
mailing list