[PATCH 3/3] Skip some tests on older IE

Paul Vriens Paul.Vriens.Wine at gmail.com
Mon Dec 7 09:43:47 CST 2009


---
 dlls/mshtml/tests/events.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c
index 46bbd4f..a158bda 100644
--- a/dlls/mshtml/tests/events.c
+++ b/dlls/mshtml/tests/events.c
@@ -1770,12 +1770,23 @@ static void set_client_site(IHTMLDocument2 *doc, BOOL set)
 static IHTMLDocument2 *create_document(void)
 {
     IHTMLDocument2 *doc;
+    IHTMLDocument5 *doc5;
     HRESULT hres;
 
     hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
             &IID_IHTMLDocument2, (void**)&doc);
     ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
+    if (FAILED(hres))
+        return NULL;
+
+    hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5);
+    if(FAILED(hres)) {
+        win_skip("Could not get IHTMLDocument5 interface, probably too old IE\n");
+        IHTMLDocument2_Release(doc);
+        return NULL;
+    }
 
+    IHTMLDocument5_Release(doc5);
     return doc;
 }
 
@@ -1792,6 +1803,8 @@ static void run_test(const char *str, testfunc_t test)
 
     xy_todo = FALSE;
     doc = create_document();
+    if (!doc)
+        return;
     set_client_site(doc, TRUE);
     doc_load_string(doc, str);
     do_advise((IUnknown*)doc, &IID_IPropertyNotifySink, (IUnknown*)&PropertyNotifySink);
-- 
1.6.2.5


--------------050500020809050103010304--



More information about the wine-patches mailing list