Changeset 84070 in webkit


Ignore:
Timestamp:
Apr 15, 2011 6:53:00 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-15 Chang Shu <cshu@webkit.org>

Reviewed by Alexey Proskuryakov.

When a message with url embedded is added to console, the "file:" scheme
and path should be stripped.
https://bugs.webkit.org/show_bug.cgi?id=58665

Unskip passed tests.

  • platform/mac-wk2/Skipped:
  • platform/qt-wk2/Skipped:

2011-04-15 Chang Shu <cshu@webkit.org>

Reviewed by Alexey Proskuryakov.

When a message with url embedded is added to console, the "file:" scheme
and path should be stripped.
https://bugs.webkit.org/show_bug.cgi?id=58665

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::lastFileURLPathComponent): (WTR::InjectedBundlePage::willAddMessageToConsole):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r84060 r84070  
     12011-04-15  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        When a message with url embedded is added to console, the "file:" scheme
     6        and path should be stripped.
     7        https://bugs.webkit.org/show_bug.cgi?id=58665
     8
     9        Unskip passed tests.
     10
     11        * platform/mac-wk2/Skipped:
     12        * platform/qt-wk2/Skipped:
     13
    1142011-04-15  Vsevolod Vlasov  <vsevik@chromium.org>
    215
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r83970 r84070  
    18911891fast/workers/storage/interrupt-database.html
    18921892fast/workers/storage/use-same-database-in-page-and-workers.html
    1893 fast/xmlhttprequest/xmlhttprequest-no-file-access.html
    18941893fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html
    18951894http/tests/appcache/different-https-origin-resource-main.html
  • trunk/LayoutTests/platform/qt-wk2/Skipped

    r83723 r84070  
    21522152fast/workers/storage/change-version-handle-reuse-sync.html
    21532153fast/workers/storage/multiple-databases-garbage-collection.html
    2154 fast/xmlhttprequest/xmlhttprequest-no-file-access.html
    21552154fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html
    21562155storage/open-database-while-transaction-in-progress.html
  • trunk/Tools/ChangeLog

    r84064 r84070  
     12011-04-15  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        When a message with url embedded is added to console, the "file:" scheme
     6        and path should be stripped.
     7        https://bugs.webkit.org/show_bug.cgi?id=58665
     8
     9        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     10        (WTR::lastFileURLPathComponent):
     11        (WTR::InjectedBundlePage::willAddMessageToConsole):
     12
    1132011-04-15  Jeff Miller  <jeffm@apple.com>
    214
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r83550 r84070  
    749749}
    750750
     751static string lastFileURLPathComponent(const string& path)
     752{
     753    size_t pos = path.find("file://");
     754    ASSERT(string::npos != pos);
     755
     756    string tmpPath = path.substr(pos + 7);
     757    if (tmpPath.empty())
     758        return tmpPath;
     759
     760    // Remove the trailing delimiter
     761    if (tmpPath[tmpPath.length() - 1] == '/')
     762        tmpPath.erase(tmpPath.length() - 1);
     763
     764    pos = tmpPath.rfind('/');
     765    if (string::npos != pos)
     766        return tmpPath.substr(pos + 1);
     767
     768    return tmpPath;
     769}
     770
    751771void InjectedBundlePage::willAddMessageToConsole(WKStringRef message, uint32_t lineNumber)
    752772{
     
    754774        return;
    755775
    756     // FIXME: Strip file: urls.
    757     InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << message << "\n";
     776    string messageString = toSTD(message);
     777    size_t fileProtocolStart = messageString.find("file://");
     778    if (fileProtocolStart != string::npos)
     779        // FIXME: The code below does not handle additional text after url nor multiple urls. This matches DumpRenderTree implementation.
     780        messageString = messageString.substr(0, fileProtocolStart) + lastFileURLPathComponent(messageString.substr(fileProtocolStart));
     781
     782    InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << messageString << "\n";
    758783}
    759784
Note: See TracChangeset for help on using the changeset viewer.