winetest: Try to trigger the Gecko install for mshtml tests, and skip them otherwise.
This commit is contained in:
parent
cd656fa7f6
commit
de02d20ec7
|
@ -4,7 +4,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = winetest.exe
|
||||
APPMODE = -mconsole
|
||||
IMPORTS = comctl32 version user32 gdi32 advapi32 wsock32 kernel32
|
||||
IMPORTS = uuid comctl32 version user32 gdi32 advapi32 wsock32 kernel32
|
||||
|
||||
EXTRARCFLAGS = -DBUILD_SHA1=\"`GIT_DIR=$(TOPSRCDIR)/.git git rev-parse HEAD 2>/dev/null`\"
|
||||
|
||||
|
|
|
@ -28,9 +28,11 @@
|
|||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#define COBJMACROS
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <windows.h>
|
||||
#include <mshtml.h>
|
||||
|
||||
#include "winetest.h"
|
||||
#include "resource.h"
|
||||
|
@ -149,6 +151,34 @@ static int running_on_visible_desktop (void)
|
|||
return IsWindowVisible(desktop);
|
||||
}
|
||||
|
||||
/* check if Gecko is present, trying to trigger the install if not */
|
||||
static BOOL gecko_check(void)
|
||||
{
|
||||
HMODULE mshtml;
|
||||
HRESULT (WINAPI *pDllGetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID *ppv);
|
||||
IClassFactory *factory = NULL;
|
||||
IHTMLDocument2 *doc = NULL;
|
||||
IHTMLElement *body;
|
||||
BOOL ret = FALSE;
|
||||
|
||||
if (!(mshtml = LoadLibraryA( "mshtml.dll" ))) return FALSE;
|
||||
if (!(pDllGetClassObject = (void *)GetProcAddress( mshtml, "DllGetClassObject" )))
|
||||
goto done;
|
||||
if (FAILED(pDllGetClassObject( &CLSID_HTMLDocument, &IID_IClassFactory, (void **)&factory )))
|
||||
goto done;
|
||||
if (FAILED(IClassFactory_CreateInstance( factory, NULL, &IID_IHTMLDocument2, (void **)&doc )))
|
||||
goto done;
|
||||
if (FAILED(IHTMLDocument2_get_body( doc, &body )))
|
||||
goto done;
|
||||
IHTMLElement_Release( body );
|
||||
ret = TRUE;
|
||||
done:
|
||||
if (doc) IHTMLDocument_Release( doc );
|
||||
if (factory) IClassFactory_Release( factory );
|
||||
FreeLibrary( mshtml );
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void print_version (void)
|
||||
{
|
||||
#ifdef __i386__
|
||||
|
@ -520,6 +550,12 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType,
|
|||
xprintf (" %s=dll is missing\n", dllname);
|
||||
return TRUE;
|
||||
}
|
||||
if (!strcmp( dllname, "mshtml" ) && running_under_wine() && !gecko_check())
|
||||
{
|
||||
FreeLibrary(dll);
|
||||
xprintf (" %s=load error Gecko is not installed\n", dllname);
|
||||
return TRUE;
|
||||
}
|
||||
GetModuleFileNameA(dll, filename, MAX_PATH);
|
||||
FreeLibrary(dll);
|
||||
|
||||
|
|
Loading…
Reference in New Issue