Changeset 95180 in webkit
- Timestamp:
- Sep 15, 2011 2:10:00 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r95122 r95180 1 2011-09-15 Jochen Eisinger <jochen@chromium.org> 2 3 [chromium] extract normalization of LayoutTests URLs to a method of TestShell 4 https://bugs.webkit.org/show_bug.cgi?id=68145 5 6 This will allow for other classes in DumpRenderTree to reuse this functionality 7 8 Reviewed by David Levin. 9 10 * DumpRenderTree/chromium/TestShell.cpp: 11 (normalizeLayoutTestURLInternal): 12 (dumpHistoryItem): 13 (TestShell::normalizeLayoutTestURL): 14 * DumpRenderTree/chromium/TestShell.h: 15 1 16 2011-09-14 Ada Chan <adachan@apple.com> 2 17 -
trunk/Tools/DumpRenderTree/chromium/TestShell.cpp
r93235 r95180 397 397 } 398 398 399 static string normalizeLayoutTestURLInternal(const string& url) 400 { 401 string result = url; 402 size_t pos; 403 if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != string::npos)) { 404 // adjust file URLs to match upstream results. 405 result.replace(0, pos + layoutTestsPatternSize, fileTestPrefix); 406 } else if (!url.find(dataUrlPattern)) { 407 // URL-escape data URLs to match results upstream. 408 string path = webkit_support::EscapePath(url.substr(dataUrlPatternSize)); 409 result.replace(dataUrlPatternSize, url.length(), path); 410 } 411 return result; 412 } 413 399 414 static string dumpHistoryItem(const WebHistoryItem& item, int indent, bool isCurrent) 400 415 { … … 407 422 result.append(indent, ' '); 408 423 409 string url = item.urlString().utf8(); 410 size_t pos; 411 if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != string::npos)) { 412 // adjust file URLs to match upstream results. 413 url.replace(0, pos + layoutTestsPatternSize, fileTestPrefix); 414 } else if (!url.find(dataUrlPattern)) { 415 // URL-escape data URLs to match results upstream. 416 string path = webkit_support::EscapePath(url.substr(dataUrlPatternSize)); 417 url.replace(dataUrlPatternSize, url.length(), path); 418 } 419 424 string url = normalizeLayoutTestURLInternal(item.urlString().utf8()); 420 425 result.append(url); 421 426 if (!item.target().isEmpty()) { … … 690 695 return m_windowList.size(); 691 696 } 697 698 string TestShell::normalizeLayoutTestURL(const string& url) 699 { 700 return normalizeLayoutTestURLInternal(url); 701 } -
trunk/Tools/DumpRenderTree/chromium/TestShell.h
r90137 r95180 177 177 WindowList windowList() const { return m_windowList; } 178 178 179 // Returns a string representation of an URL's spec that does not depend on 180 // the location of the layout test in the file system. 181 std::string normalizeLayoutTestURL(const std::string&); 182 179 183 private: 180 184 WebViewHost* createNewWindow(const WebKit::WebURL&, DRTDevToolsAgent*);
Note: See TracChangeset
for help on using the changeset viewer.