diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Tools/DumpRenderTree/chromium/TestShellWin.cpp | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Tools/DumpRenderTree/chromium/TestShellWin.cpp')
-rw-r--r-- | Tools/DumpRenderTree/chromium/TestShellWin.cpp | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/Tools/DumpRenderTree/chromium/TestShellWin.cpp b/Tools/DumpRenderTree/chromium/TestShellWin.cpp index 3b3ddd9..f82771f 100644 --- a/Tools/DumpRenderTree/chromium/TestShellWin.cpp +++ b/Tools/DumpRenderTree/chromium/TestShellWin.cpp @@ -166,39 +166,11 @@ void openStartupDialog() bool checkLayoutTestSystemDependencies() { - std::list<std::string> errors; - - OSVERSIONINFOEX versionInfo; - ::ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX)); - versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - ::GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&versionInfo)); - - // Default to XP metrics, override if on Vista or win 7. - int requiredVScrollSize = 17; - int requiredFontSize = -11; // 8 pt - const wchar_t* requiredFont = L"Tahoma"; - bool isVista = false; - bool isWin7 = false; - const DWORD major = versionInfo.dwMajorVersion; - const DWORD minor = versionInfo.dwMinorVersion; - const WORD type = versionInfo.wProductType; - if (major == 6 && minor == 1 && type == VER_NT_WORKSTATION) { - requiredFont = L"Segoe UI"; - requiredFontSize = -12; - isWin7 = true; - } else if (major == 6 && !minor && type == VER_NT_WORKSTATION) { - requiredFont = L"Segoe UI"; - requiredFontSize = -12; // 9 pt - isVista = true; - } else if (!(major == 5 && minor == 1 && type == VER_NT_WORKSTATION)) { - // The above check is for XP, so that means ... - errors.push_back("Unsupported Operating System version " - "(must use XP, Vista, or Windows 7)."); - } - // This metric will be 17 when font size is "Normal". // The size of drop-down menus depends on it. int verticalScrollSize = ::GetSystemMetrics(SM_CXVSCROLL); + int requiredVScrollSize = 17; + std::list<std::string> errors; if (verticalScrollSize != requiredVScrollSize) errors.push_back("Must use normal size fonts (96 dpi)."); @@ -210,21 +182,22 @@ bool checkLayoutTestSystemDependencies() if (fontSmoothingEnabled && (fontSmoothingType == FE_FONTSMOOTHINGCLEARTYPE)) errors.push_back("ClearType must be disabled."); - // Check that we're using the default system fonts - NONCLIENTMETRICS metrics; - // Checks Vista or later. - metrics.cbSize = major >= 6 ? sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA; + // Check that we're using the default system fonts. + OSVERSIONINFO versionInfo = {0}; + versionInfo.dwOSVersionInfoSize = sizeof(versionInfo); + ::GetVersionEx(&versionInfo); + const bool isVistaOrLater = (versionInfo.dwMajorVersion >= 6); + NONCLIENTMETRICS metrics = {0}; + metrics.cbSize = isVistaOrLater ? (sizeof NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA; const bool success = !!::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0); ASSERT(success); LOGFONTW* systemFonts[] = {&metrics.lfStatusFont, &metrics.lfMenuFont, &metrics.lfSmCaptionFont}; - + const wchar_t* const requiredFont = isVistaOrLater ? L"Segoe UI" : L"Tahoma"; + const int requiredFontSize = isVistaOrLater ? -12 : -11; for (size_t i = 0; i < arraysize(systemFonts); ++i) { if (systemFonts[i]->lfHeight != requiredFontSize || wcscmp(requiredFont, systemFonts[i]->lfFaceName)) { - if (isVista || isWin7) - errors.push_back("Must use either the Aero or Basic theme."); - else - errors.push_back("Must use the default XP theme (Luna)."); + errors.push_back(isVistaOrLater ? "Must use either the Aero or Basic theme." : "Must use the default XP theme (Luna)."); break; } } |