Francois Gouget : mshtml/tests: Some tests require that the user interface be in English.

Alexandre Julliard julliard at winehq.org
Tue Sep 13 12:18:11 CDT 2011


Module: wine
Branch: master
Commit: e931ebc704242a0c26f4b50543f8ffa226e56a7e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e931ebc704242a0c26f4b50543f8ffa226e56a7e

Author: Francois Gouget <fgouget at free.fr>
Date:   Tue Sep 13 17:35:53 2011 +0200

mshtml/tests: Some tests require that the user interface be in English.

With MUI versions of Windows checking for the default user language id is insufficient.
Skip the system language id check as it is irrelevant here.

---

 dlls/mshtml/tests/htmldoc.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index 6676020..03f2539 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -285,8 +285,18 @@ static BSTR a2bstr(const char *str)
 
 static BOOL is_english(void)
 {
-    return PRIMARYLANGID(GetSystemDefaultLangID()) == LANG_ENGLISH
-        && PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH;
+    static HMODULE hkernel32 = NULL;
+    static LANGID (WINAPI *pGetUserDefaultUILanguage)(void) = NULL;
+
+    if (!hkernel32)
+    {
+        hkernel32 = GetModuleHandleA("kernel32.dll");
+        pGetUserDefaultUILanguage = (void*)GetProcAddress(hkernel32, "GetUserDefaultUILanguage");
+    }
+    if (pGetUserDefaultUILanguage)
+        return PRIMARYLANGID(pGetUserDefaultUILanguage()) == LANG_ENGLISH;
+
+    return PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH;
 }
 
 #define EXPECT_UPDATEUI  1




More information about the wine-cvs mailing list