Changeset 94676 in webkit


Ignore:
Timestamp:
Sep 7, 2011 10:04:22 AM (13 years ago)
Author:
Csaba Osztrogonác
Message:

[Qt][DRT] Normalize file:///tmp/LayoutTests in LayoutTestController::pathToLocalResource()
https://bugs.webkit.org/show_bug.cgi?id=67254

Patch by Jarred Nicholls <jarred@sencha.com> on 2011-09-07
Reviewed by Csaba Osztrogonác.

Translate file:///tmp/LayoutTests/* urls into the repository LayoutTests directory, which is
derived from the running location of DumpRenderTree binary.

  • DumpRenderTree/qt/LayoutTestControllerQt.cpp:

(LayoutTestController::pathToLocalResource):
(LayoutTestController::setUserStyleSheetLocation): pass the url through pathToLocalResource

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r94667 r94676  
     12011-09-07  Jarred Nicholls  <jarred@sencha.com>
     2
     3        [Qt][DRT] Normalize file:///tmp/LayoutTests in LayoutTestController::pathToLocalResource()
     4        https://bugs.webkit.org/show_bug.cgi?id=67254
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        Translate file:///tmp/LayoutTests/* urls into the repository LayoutTests directory, which is
     9        derived from the running location of DumpRenderTree binary.
     10
     11        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     12        (LayoutTestController::pathToLocalResource):
     13        (LayoutTestController::setUserStyleSheetLocation): pass the url through pathToLocalResource
     14
    1152011-09-07  Csaba Osztrogonác  <ossy@webkit.org>
    216
  • trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r94343 r94676  
    3434#include "WorkQueue.h"
    3535#include "WorkQueueItemQt.h"
     36#include <QCoreApplication>
    3637#include <QDir>
    3738#include <QLocale>
     
    242243QString LayoutTestController::pathToLocalResource(const QString& url)
    243244{
    244     // Function introduced in r28690.
    245     return QDir::toNativeSeparators(url);
     245    QString localTmpUrl(QLatin1String("file:///tmp/LayoutTests"));
     246
     247    // Translate a request for /tmp/LayoutTests to the repository LayoutTests directory.
     248    // Do not rely on a symlink to be created via the test runner, which will not work on Windows.
     249    if (url.startsWith(localTmpUrl)) {
     250        // DumpRenderTree lives in WebKit/WebKitBuild/<build_mode>/bin.
     251        // Translate from WebKit/WebKitBuild/Release/bin => WebKit/LayoutTests.
     252        QFileInfo layoutTestsRoot(QCoreApplication::applicationDirPath() + QLatin1String("/../../../LayoutTests/"));
     253        if (layoutTestsRoot.exists())
     254            return QLatin1String("file://") + layoutTestsRoot.absolutePath() + url.mid(localTmpUrl.length());
     255    }
     256
     257    return url;
    246258}
    247259
     
    688700void LayoutTestController::setUserStyleSheetLocation(const QString& url)
    689701{
    690     m_userStyleSheetLocation = QUrl::fromEncoded(url.toAscii(), QUrl::StrictMode);
     702    QByteArray urlData = pathToLocalResource(url).toLatin1();
     703    m_userStyleSheetLocation = QUrl::fromEncoded(urlData, QUrl::StrictMode);
    691704
    692705    if (m_userStyleSheetEnabled)
Note: See TracChangeset for help on using the changeset viewer.