[GTK] editing/deleting/5408255.html results are incorrect

https://bugs.webkit.org/show_bug.cgi?id=53644

Patch by Zan Dobersek <zandobersek@gmail.com> on 2012-01-23
Reviewed by Martin Robinson.

Source/WebCore:

When the WEBKIT_TOP_LEVEL environment variable is set, resources
should be loaded from the source tree to which the variable is
pointing. This approach is used when performing testing on the
Gtk port.

No new tests, changes cause one test to pass.

* platform/graphics/gtk/ImageGtk.cpp:
(getPathToImageResource): Also make changes to the resource path
construction code on Windows.
(WebCore::Image::loadPlatformResource):

Tools:

WEBKIT_TOP_LEVEL environment variable is now set directly in either
WebKitTestRunner or DumpRenderTree through usage of a compilation-time
macro. This way both tools can be run outside the test harness without
the need to manually set the environment variable.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(getTopLevelPath):
* GNUmakefile.am:
* Scripts/webkitpy/layout_tests/port/gtk.py:
(GtkPort.setup_environ_for_server):
* WebKitTestRunner/GNUmakefile.am:
* WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp:
(WTR::InjectedBundle::platformInitialize):

LayoutTests:

Unskip newly-passing editing test.

* platform/gtk/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dd34df48
2012-01-23 Zan Dobersek <zandobersek@gmail.com>
[GTK] editing/deleting/5408255.html results are incorrect
https://bugs.webkit.org/show_bug.cgi?id=53644
Reviewed by Martin Robinson.
Unskip newly-passing editing test.
* platform/gtk/Skipped:
2012-01-23 Julien Chaffraix <jchaffraix@webkit.org>
Crash in WebCore::RenderTableSection::rowLogicalHeightChanged
......@@ -456,10 +456,6 @@ fast/forms/select-double-onchange.html
fast/forms/select-script-onchange.html
fast/html/tab-order.html
# The box isn't empty after a test run with this test.
# https://bugs.webkit.org/show_bug.cgi?id=53644
editing/deleting/5408255.html
# Missing delegates:
# Need proper frame loader callbacks reporting
# See https://bugs.webkit.org/show_bug.cgi?id=32170
......
2012-01-23 Zan Dobersek <zandobersek@gmail.com>
[GTK] editing/deleting/5408255.html results are incorrect
https://bugs.webkit.org/show_bug.cgi?id=53644
Reviewed by Martin Robinson.
When the WEBKIT_TOP_LEVEL environment variable is set, resources
should be loaded from the source tree to which the variable is
pointing. This approach is used when performing testing on the
Gtk port.
No new tests, changes cause one test to pass.
* platform/graphics/gtk/ImageGtk.cpp:
(getPathToImageResource): Also make changes to the resource path
construction code on Windows.
(WebCore::Image::loadPlatformResource):
2012-01-23 Julien Chaffraix <jchaffraix@webkit.org>
Crash in WebCore::RenderTableSection::rowLogicalHeightChanged
......@@ -48,36 +48,42 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
}
static const char* getWebKitDataDirectory()
static char* getPathToImageResource(char* resource)
{
static char* dataDirectory = 0;
if (dataDirectory)
return dataDirectory;
dataDirectory = new char[PATH_MAX];
if (!GetModuleFileName(hmodule, static_cast<CHAR*>(dataDirectory), sizeof(dataDirectory) - 10))
return DATA_DIR;
// FIXME: This is pretty ugly. Ideally we should be using Windows API
// functions or GLib methods to calculate paths.
unsigned char *p;
p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
*p = '\0';
p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
if (p) {
if (!stricmp((const char *) (p+1), "bin"))
*p = '\0';
if (!dataDirectory) {
dataDirectory = new char[PATH_MAX];
if (!GetModuleFileName(hmodule, static_cast<CHAR*>(dataDirectory), sizeof(dataDirectory) - 10))
dataDirectory = DATA_DIR;
// FIXME: This is pretty ugly. Ideally we should be using Windows API
// functions or GLib methods to calculate paths.
unsigned char *p;
p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
*p = '\0';
p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
if (p) {
if (!stricmp((const char *) (p+1), "bin"))
*p = '\0';
}
strcat(dataDirectory, "\\share\\webkitgtk-"WEBKITGTK_API_VERSION_STRING"\\images\\");
}
strcat(dataDirectory, "\\share");
return dataDirectory;
char* imageResourcePath = new char[PATH_MAX];
strcat(imageResourcePath, dataDirectory);
strcat(imageResourcePath, resource);
return imageResourcePath;
}
#else
static const char* getWebKitDataDirectory()
static char* getPathToImageResource(char* resource)
{
return DATA_DIR;
if (g_getenv("WEBKIT_TOP_LEVEL"))
return g_build_filename(g_getenv("WEBKIT_TOP_LEVEL"), "Source", "WebCore", "Resources", resource, NULL);
return g_build_filename(DATA_DIR, "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "images", resource, NULL);
}
#endif
......@@ -138,7 +144,7 @@ PassRefPtr<Image> Image::loadPlatformResource(const char* name)
fileName = getThemeIconFileName(GTK_STOCK_MISSING_IMAGE, 16);
if (fileName.isNull()) {
GOwnPtr<gchar> imageName(g_strdup_printf("%s.png", name));
GOwnPtr<gchar> glibFileName(g_build_filename(getWebKitDataDirectory(), "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "images", imageName.get(), NULL));
GOwnPtr<gchar> glibFileName(getPathToImageResource(imageName.get()));
fileName = glibFileName.get();
}
......
2012-01-23 Zan Dobersek <zandobersek@gmail.com>
[GTK] editing/deleting/5408255.html results are incorrect
https://bugs.webkit.org/show_bug.cgi?id=53644
Reviewed by Martin Robinson.
WEBKIT_TOP_LEVEL environment variable is now set directly in either
WebKitTestRunner or DumpRenderTree through usage of a compilation-time
macro. This way both tools can be run outside the test harness without
the need to manually set the environment variable.
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(getTopLevelPath):
* GNUmakefile.am:
* Scripts/webkitpy/layout_tests/port/gtk.py:
(GtkPort.setup_environ_for_server):
* WebKitTestRunner/GNUmakefile.am:
* WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp:
(WTR::InjectedBundle::platformInitialize):
2012-01-23 Dmitry Lomov <dslomov@google.com>
[Chromium] Implement layoutTestController.workerThreadCount in DRT
......@@ -169,16 +169,10 @@ static void initializeGtkFontSettings(const char* testURL)
CString getTopLevelPath()
{
if (const char* topLevelDirectory = g_getenv("WEBKIT_TOP_LEVEL"))
return topLevelDirectory;
// If the environment variable wasn't provided then assume we were built into
// WebKitBuild/Debug or WebKitBuild/Release. Obviously this will fail if the build
// directory is non-standard, but we can't do much more about this.
GOwnPtr<char> parentPath(g_path_get_dirname(getCurrentExecutablePath().data()));
GOwnPtr<char> layoutTestsPath(g_build_filename(parentPath.get(), "..", "..", "..", NULL));
GOwnPtr<char> absoluteTopLevelPath(realpath(layoutTestsPath.get(), 0));
return absoluteTopLevelPath.get();
if (!g_getenv("WEBKIT_TOP_LEVEL"))
g_setenv("WEBKIT_TOP_LEVEL", TOP_LEVEL_DIR, FALSE);
return TOP_LEVEL_DIR;
}
static void initializeFonts(const char* testURL = 0)
......
......@@ -74,6 +74,7 @@ libWebCoreInternals_la_CFLAGS = \
# DumpRenderTree
Programs_DumpRenderTree_CPPFLAGS = \
$(global_cppflags) \
-DTOP_LEVEL_DIR=\"${shell pwd}/${srcdir}\" \
-I$(srcdir)/Tools/DumpRenderTree \
-I$(srcdir)/Tools/DumpRenderTree/cairo \
-I$(srcdir)/Tools/DumpRenderTree/gtk \
......
......@@ -89,7 +89,6 @@ class GtkPort(WebKitPort):
environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('Libraries', 'libTestRunnerInjectedBundle.la')
environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('TestNetscapePlugin', '.libs')
environment['WEBKIT_INSPECTOR_PATH'] = self._build_path('Programs', 'resources', 'inspector')
environment['WEBKIT_TOP_LEVEL'] = self._config.webkit_base_dir()
environment['AUDIO_RESOURCES_PATH'] = self._filesystem.join(self._config.webkit_base_dir(),
'Source', 'WebCore', 'platform',
'audio', 'resources')
......
......@@ -115,6 +115,7 @@ Libraries_libTestRunnerInjectedBundle_la_LDFLAGS = \
Libraries_libTestRunnerInjectedBundle_la_CPPFLAGS = \
-DFONTS_CONF_DIR=\"${shell pwd}/${srcdir}/Tools/DumpRenderTree/gtk/fonts\" \
-DTOP_LEVEL_DIR=\"${shell pwd}/${srcdir}\" \
-include Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h \
-I$(srcdir)/Tools/WebKitTestRunner \
-I$(srcdir)/Tools/WebKitTestRunner/InjectedBundle \
......
......@@ -44,6 +44,9 @@ void InjectedBundle::platformInitialize(WKTypeRef)
// will cause tests to fail because of unexpected output. We squelch all debug
// messages sent to the logger.
g_log_set_default_handler(logHandler, 0);
if (!g_getenv("WEBKIT_TOP_LEVEL"))
g_setenv("WEBKIT_TOP_LEVEL", TOP_LEVEL_DIR, FALSE);
}
} // namespace WTR
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