Commit de02d20e authored by Alexandre Julliard's avatar Alexandre Julliard

winetest: Try to trigger the Gecko install for mshtml tests, and skip them otherwise.

parent cd656fa7
...@@ -4,7 +4,7 @@ SRCDIR = @srcdir@ ...@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = winetest.exe MODULE = winetest.exe
APPMODE = -mconsole 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`\" EXTRARCFLAGS = -DBUILD_SHA1=\"`GIT_DIR=$(TOPSRCDIR)/.git git rev-parse HEAD 2>/dev/null`\"
......
...@@ -28,9 +28,11 @@ ...@@ -28,9 +28,11 @@
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
#define COBJMACROS
#include <stdio.h> #include <stdio.h>
#include <assert.h> #include <assert.h>
#include <windows.h> #include <windows.h>
#include <mshtml.h>
#include "winetest.h" #include "winetest.h"
#include "resource.h" #include "resource.h"
...@@ -149,6 +151,34 @@ static int running_on_visible_desktop (void) ...@@ -149,6 +151,34 @@ static int running_on_visible_desktop (void)
return IsWindowVisible(desktop); 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) static void print_version (void)
{ {
#ifdef __i386__ #ifdef __i386__
...@@ -520,6 +550,12 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType, ...@@ -520,6 +550,12 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType,
xprintf (" %s=dll is missing\n", dllname); xprintf (" %s=dll is missing\n", dllname);
return TRUE; 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); GetModuleFileNameA(dll, filename, MAX_PATH);
FreeLibrary(dll); FreeLibrary(dll);
......
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