Changeset 105686 in webkit


Ignore:
Timestamp:
Jan 23, 2012 8:23:41 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[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:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r105685 r105686  
     12012-01-23  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        [GTK] editing/deleting/5408255.html results are incorrect
     4        https://bugs.webkit.org/show_bug.cgi?id=53644
     5
     6        Reviewed by Martin Robinson.
     7
     8        Unskip newly-passing editing test.
     9
     10        * platform/gtk/Skipped:
     11
    1122012-01-23  Julien Chaffraix  <jchaffraix@webkit.org>
    213
  • trunk/LayoutTests/platform/gtk/Skipped

    r105629 r105686  
    456456fast/forms/select-script-onchange.html
    457457fast/html/tab-order.html
    458 
    459 # The box isn't empty after a test run with this test.
    460 # https://bugs.webkit.org/show_bug.cgi?id=53644
    461  editing/deleting/5408255.html
    462458
    463459# Missing delegates:
  • trunk/Source/WebCore/ChangeLog

    r105685 r105686  
     12012-01-23  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        [GTK] editing/deleting/5408255.html results are incorrect
     4        https://bugs.webkit.org/show_bug.cgi?id=53644
     5
     6        Reviewed by Martin Robinson.
     7
     8        When the WEBKIT_TOP_LEVEL environment variable is set, resources
     9        should be loaded from the source tree to which the variable is
     10        pointing. This approach is used when performing testing on the
     11        Gtk port.
     12
     13        No new tests, changes cause one test to pass.
     14
     15        * platform/graphics/gtk/ImageGtk.cpp:
     16        (getPathToImageResource): Also make changes to the resource path
     17        construction code on Windows.
     18        (WebCore::Image::loadPlatformResource):
     19
    1202012-01-23  Julien Chaffraix  <jchaffraix@webkit.org>
    221
  • trunk/Source/WebCore/platform/graphics/gtk/ImageGtk.cpp

    r81589 r105686  
    4949}
    5050
    51 static const char* getWebKitDataDirectory()
     51static char* getPathToImageResource(char* resource)
    5252{
    5353    static char* dataDirectory = 0;
    54     if (dataDirectory)
    55         return dataDirectory;
     54    if (!dataDirectory) {
     55        dataDirectory = new char[PATH_MAX];
     56        if (!GetModuleFileName(hmodule, static_cast<CHAR*>(dataDirectory), sizeof(dataDirectory) - 10))
     57            dataDirectory = DATA_DIR;
    5658
    57     dataDirectory = new char[PATH_MAX];
    58     if (!GetModuleFileName(hmodule, static_cast<CHAR*>(dataDirectory), sizeof(dataDirectory) - 10))
    59         return DATA_DIR;
     59        // FIXME: This is pretty ugly. Ideally we should be using Windows API
     60        // functions or GLib methods to calculate paths.
     61        unsigned char *p;
     62        p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
     63        *p = '\0';
     64        p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
     65        if (p) {
     66            if (!stricmp((const char *) (p+1), "bin"))
     67                *p = '\0';
     68        }
     69        strcat(dataDirectory, "\\share\\webkitgtk-"WEBKITGTK_API_VERSION_STRING"\\images\\");
     70    }
    6071
    61     // FIXME: This is pretty ugly. Ideally we should be using Windows API
    62     // functions or GLib methods to calculate paths.
    63     unsigned char *p;
    64     p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
    65     *p = '\0';
    66     p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
    67     if (p) {
    68         if (!stricmp((const char *) (p+1), "bin"))
    69             *p = '\0';
    70     }
    71     strcat(dataDirectory, "\\share");
     72    char* imageResourcePath = new char[PATH_MAX];
     73    strcat(imageResourcePath, dataDirectory);
     74    strcat(imageResourcePath, resource);
    7275
    73     return dataDirectory;
     76    return imageResourcePath;
    7477}
    7578
    7679#else
    7780
    78 static const char* getWebKitDataDirectory()
     81static char* getPathToImageResource(char* resource)
    7982{
    80     return DATA_DIR;
     83    if (g_getenv("WEBKIT_TOP_LEVEL"))
     84        return g_build_filename(g_getenv("WEBKIT_TOP_LEVEL"), "Source", "WebCore", "Resources", resource, NULL);
     85
     86    return g_build_filename(DATA_DIR, "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "images", resource, NULL);
    8187}
    8288
     
    139145    if (fileName.isNull()) {
    140146        GOwnPtr<gchar> imageName(g_strdup_printf("%s.png", name));
    141         GOwnPtr<gchar> glibFileName(g_build_filename(getWebKitDataDirectory(), "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "images", imageName.get(), NULL));
     147        GOwnPtr<gchar> glibFileName(getPathToImageResource(imageName.get()));
    142148        fileName = glibFileName.get();
    143149    }
  • trunk/Tools/ChangeLog

    r105684 r105686  
     12012-01-23  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        [GTK] editing/deleting/5408255.html results are incorrect
     4        https://bugs.webkit.org/show_bug.cgi?id=53644
     5
     6        Reviewed by Martin Robinson.
     7
     8        WEBKIT_TOP_LEVEL environment variable is now set directly in either
     9        WebKitTestRunner or DumpRenderTree through usage of a compilation-time
     10        macro. This way both tools can be run outside the test harness without
     11        the need to manually set the environment variable.
     12
     13        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     14        (getTopLevelPath):
     15        * GNUmakefile.am:
     16        * Scripts/webkitpy/layout_tests/port/gtk.py:
     17        (GtkPort.setup_environ_for_server):
     18        * WebKitTestRunner/GNUmakefile.am:
     19        * WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp:
     20        (WTR::InjectedBundle::platformInitialize):
     21
    1222012-01-23  Dmitry Lomov  <dslomov@google.com>
    223
  • trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r105587 r105686  
    170170CString getTopLevelPath()
    171171{
    172     if (const char* topLevelDirectory = g_getenv("WEBKIT_TOP_LEVEL"))
    173         return topLevelDirectory;
    174 
    175     // If the environment variable wasn't provided then assume we were built into
    176     // WebKitBuild/Debug or WebKitBuild/Release. Obviously this will fail if the build
    177     // directory is non-standard, but we can't do much more about this.
    178     GOwnPtr<char> parentPath(g_path_get_dirname(getCurrentExecutablePath().data()));
    179     GOwnPtr<char> layoutTestsPath(g_build_filename(parentPath.get(), "..", "..", "..", NULL));
    180     GOwnPtr<char> absoluteTopLevelPath(realpath(layoutTestsPath.get(), 0));
    181     return absoluteTopLevelPath.get();
     172    if (!g_getenv("WEBKIT_TOP_LEVEL"))
     173        g_setenv("WEBKIT_TOP_LEVEL", TOP_LEVEL_DIR, FALSE);
     174
     175    return TOP_LEVEL_DIR;
    182176}
    183177
  • trunk/Tools/GNUmakefile.am

    r105315 r105686  
    7575Programs_DumpRenderTree_CPPFLAGS = \
    7676        $(global_cppflags) \
     77        -DTOP_LEVEL_DIR=\"${shell pwd}/${srcdir}\" \
    7778        -I$(srcdir)/Tools/DumpRenderTree \
    7879        -I$(srcdir)/Tools/DumpRenderTree/cairo \
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py

    r105183 r105686  
    9090        environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('TestNetscapePlugin', '.libs')
    9191        environment['WEBKIT_INSPECTOR_PATH'] = self._build_path('Programs', 'resources', 'inspector')
    92         environment['WEBKIT_TOP_LEVEL'] = self._config.webkit_base_dir()
    9392        environment['AUDIO_RESOURCES_PATH'] = self._filesystem.join(self._config.webkit_base_dir(),
    9493                                                                    'Source', 'WebCore', 'platform',
  • trunk/Tools/WebKitTestRunner/GNUmakefile.am

    r103929 r105686  
    116116Libraries_libTestRunnerInjectedBundle_la_CPPFLAGS = \
    117117        -DFONTS_CONF_DIR=\"${shell pwd}/${srcdir}/Tools/DumpRenderTree/gtk/fonts\" \
     118        -DTOP_LEVEL_DIR=\"${shell pwd}/${srcdir}\" \
    118119        -include Tools/WebKitTestRunner/WebKitTestRunnerPrefix.h \
    119120        -I$(srcdir)/Tools/WebKitTestRunner \
  • trunk/Tools/WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp

    r87760 r105686  
    4545    // messages sent to the logger.
    4646    g_log_set_default_handler(logHandler, 0);
     47
     48    if (!g_getenv("WEBKIT_TOP_LEVEL"))
     49        g_setenv("WEBKIT_TOP_LEVEL", TOP_LEVEL_DIR, FALSE);
    4750}
    4851
Note: See TracChangeset for help on using the changeset viewer.