mshtml: Skip tests if we can't get body object - it means that there is no Gecko available.

This commit is contained in:
Jacek Caban 2007-10-07 10:49:04 +02:00 committed by Alexandre Julliard
parent 99e6592c9d
commit df4bdad94d
1 changed files with 11 additions and 1 deletions

View File

@ -597,8 +597,10 @@ typedef void (*domtest_t)(IHTMLDocument2*);
static void run_domtest(const char *str, domtest_t test)
{
IHTMLDocument2 *doc;
IHTMLElement *body = NULL;
ULONG ref;
MSG msg;
HRESULT hres;
doc = create_doc_with_string(str);
do_advise((IUnknown*)doc, &IID_IPropertyNotifySink, (IUnknown*)&PropertyNotifySink);
@ -608,7 +610,15 @@ static void run_domtest(const char *str, domtest_t test)
DispatchMessage(&msg);
}
test(doc);
hres = IHTMLDocument2_get_body(doc, &body);
ok(hres == S_OK, "get_body failed: %08x\n", hres);
if(body) {
IHTMLElement_Release(body);
test(doc);
}else {
skip("Could not get document body. Assuming no Gecko installed.\n");
}
ref = IHTMLDocument2_Release(doc);
ok(!ref, "ref = %d\n", ref);