[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
tkent at chromium.org
tkent at chromium.org
Wed Dec 22 13:08:55 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit f0874fd9675fb6950b785dff02cad0b92db3740f
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 7 21:00:04 2010 +0000
2010-09-07 Kent Tamura <tkent at chromium.org>
Reviewed by Dimitri Glazkov.
[DRT/Chromium] Implement --check-layout-test-sys-deps
https://bugs.webkit.org/show_bug.cgi?id=45283
* DumpRenderTree/chromium/DumpRenderTree.cpp:
(main): Check --check-layout-test-sys-deps and call checkLayoutTestSystemDependencies().
* DumpRenderTree/chromium/TestShell.h: Declare checkLayoutTestSystemDependencies().
* DumpRenderTree/chromium/TestShellGtk.cpp:
(checkLayoutTestSystemDependencies): Add an empty implementation.
* DumpRenderTree/chromium/TestShellMac.mm:
(checkLayoutTestSystemDependencies): Add an empty implementation.
* DumpRenderTree/chromium/TestShellWin.cpp:
(checkLayoutTestSystemDependencies): Port similar function of test_shell.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f7ef7fe..c30b35f 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-07 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Implement --check-layout-test-sys-deps
+ https://bugs.webkit.org/show_bug.cgi?id=45283
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main): Check --check-layout-test-sys-deps and call checkLayoutTestSystemDependencies().
+ * DumpRenderTree/chromium/TestShell.h: Declare checkLayoutTestSystemDependencies().
+ * DumpRenderTree/chromium/TestShellGtk.cpp:
+ (checkLayoutTestSystemDependencies): Add an empty implementation.
+ * DumpRenderTree/chromium/TestShellMac.mm:
+ (checkLayoutTestSystemDependencies): Add an empty implementation.
+ * DumpRenderTree/chromium/TestShellWin.cpp:
+ (checkLayoutTestSystemDependencies): Port similar function of test_shell.
+
2010-09-07 Jessie Berlin <jberlin at apple.com>
Unreviewed. Mac build fix.
diff --git a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
index 726e412..6e180d0 100644
--- a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -47,6 +47,7 @@ static const char optionPixelTestsWithName[] = "--pixel-tests=";
static const char optionTestShell[] = "--test-shell";
static const char optionAllowExternalPages[] = "--allow-external-pages";
static const char optionStartupDialog[] = "--testshell-startup-dialog";
+static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-deps";
static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode)
{
@@ -109,6 +110,8 @@ int main(int argc, char* argv[])
allowExternalPages = true;
else if (argument == optionStartupDialog)
startupDialog = true;
+ else if (argument == optionCheckLayoutTestSystemDeps)
+ exit(checkLayoutTestSystemDependencies() ? EXIT_SUCCESS : EXIT_FAILURE);
else if (argument.size() && argument[0] == '-')
fprintf(stderr, "Unknown option: %s\n", argv[i]);
else
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
index 47261a3..cb5f862 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -186,5 +186,6 @@ private:
void platformInit(int*, char***);
void openStartupDialog();
+bool checkLayoutTestSystemDependencies();
#endif // TestShell_h
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
index 56ee618..60408b9 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
@@ -203,3 +203,8 @@ void openStartupDialog()
gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop.
gtk_widget_destroy(dialog);
}
+
+bool checkLayoutTestSystemDependencies()
+{
+ return true;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm b/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm
index 71d990e..53ede56 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm
@@ -137,3 +137,9 @@ void openStartupDialog()
[alert addButtonWithTitle:@"OK"];
[alert runModal];
}
+
+bool checkLayoutTestSystemDependencies()
+{
+ return true;
+}
+
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp b/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp
index 0d818c4..9efcf5a 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp
@@ -35,9 +35,18 @@
#include "webkit/support/webkit_support.h"
#include <fcntl.h>
#include <io.h>
+#include <list>
#include <process.h>
#include <shlwapi.h>
+#include <string>
#include <sys/stat.h>
+#include <windows.h>
+
+#define SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(structName, member) \
+ offsetof(structName, member) + \
+ (sizeof static_cast<structName*>(0)->member)
+#define NONCLIENTMETRICS_SIZE_PRE_VISTA \
+ SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(NONCLIENTMETRICS, lfMessageFont)
// Theme engine
static WebThemeEngineDRT themeEngine;
@@ -154,3 +163,82 @@ void openStartupDialog()
{
::MessageBox(0, L"Attach to me?", L"DumpRenderTree", MB_OK);
}
+
+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);
+ if (verticalScrollSize != requiredVScrollSize)
+ errors.push_back("Must use normal size fonts (96 dpi).");
+
+ // ClearType must be disabled, because the rendering is unpredictable.
+ BOOL fontSmoothingEnabled;
+ ::SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &fontSmoothingEnabled, 0);
+ int fontSmoothingType;
+ ::SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &fontSmoothingType, 0);
+ 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;
+ const bool success = !!::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0);
+ ASSERT(success);
+ LOGFONTW* systemFonts[] =
+ {&metrics.lfStatusFont, &metrics.lfMenuFont, &metrics.lfSmCaptionFont};
+
+ 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).");
+ break;
+ }
+ }
+
+ if (!errors.empty()) {
+ fprintf(stderr, "%s",
+ "##################################################################\n"
+ "## Layout test system dependencies check failed.\n"
+ "##\n");
+ for (std::list<std::string>::iterator it = errors.begin(); it != errors.end(); ++it)
+ fprintf(stderr, "## %s\n", it->c_str());
+ fprintf(stderr, "%s",
+ "##\n"
+ "##################################################################\n");
+ }
+ return errors.empty();
+}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list