Changeset 142253 in webkit
- Timestamp:
- Feb 8, 2013 3:51:31 AM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r142249 r142253 1 2013-02-08 Jochen Eisinger <jochen@chromium.org> 2 3 [chromium] copy normalizeLayoutTestURL code to TestRunner library 4 https://bugs.webkit.org/show_bug.cgi?id=109269 5 6 Reviewed by Kent Tamura. 7 8 The method doesn't have any external dependencies, so there's no reason 9 it should be on the delegate. It's still required by TestShell, however, 10 by making a copy, we can avoid implementing this in content shell. 11 12 * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h: 13 (WebTestDelegate): 14 * DumpRenderTree/chromium/TestRunner/src/WebPermissions.cpp: 15 (WebTestRunner::WebPermissions::allowImage): 16 (WebTestRunner::WebPermissions::allowScriptFromSource): 17 * DumpRenderTree/chromium/TestShell.cpp: 18 (TestShell::windowCount): 19 * DumpRenderTree/chromium/TestShell.h: 20 * DumpRenderTree/chromium/WebViewHost.cpp: 21 * DumpRenderTree/chromium/WebViewHost.h: 22 (WebViewHost): 23 1 24 2013-02-08 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 25 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h
r141381 r142253 55 55 virtual void clearContextMenuData() = 0; 56 56 virtual void clearEditCommand() = 0; 57 virtual void fillSpellingSuggestionList(const WebKit::WebString&, WebKit::WebVector<WebKit::WebString>*) { }58 57 virtual void setEditCommand(const std::string& name, const std::string& value) = 0; 59 58 virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0; … … 80 79 virtual WebKit::WebIntentRequest* currentWebIntentRequest() { return 0; } 81 80 virtual std::string makeURLErrorDescription(const WebKit::WebURLError&) { return std::string(); } 82 virtual std::string normalizeLayoutTestURL(const std::string&) { return std::string(); }83 81 virtual void setClientWindowRect(const WebKit::WebRect&) { } 84 82 virtual void showDevTools() { } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebPermissions.cpp
r140565 r142253 36 36 #include <public/WebURL.h> 37 37 38 using namespace std; 39 38 40 namespace WebTestRunner { 41 42 namespace { 43 44 const char layoutTestsPattern[] = "/LayoutTests/"; 45 const string::size_type layoutTestsPatternSize = sizeof(layoutTestsPattern) - 1; 46 const char fileUrlPattern[] = "file:/"; 47 const char fileTestPrefix[] = "(file test):"; 48 const char dataUrlPattern[] = "data:"; 49 const string::size_type dataUrlPatternSize = sizeof(dataUrlPattern) - 1; 50 51 string normalizeLayoutTestURL(const string& url) 52 { 53 string result = url; 54 size_t pos; 55 if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != string::npos)) { 56 // adjust file URLs to match upstream results. 57 result.replace(0, pos + layoutTestsPatternSize, fileTestPrefix); 58 } else if (!url.find(dataUrlPattern)) { 59 // URL-escape data URLs to match results upstream. 60 string path = url.substr(dataUrlPatternSize); 61 result.replace(dataUrlPatternSize, url.length(), path); 62 } 63 return result; 64 } 65 66 } 39 67 40 68 WebPermissions::WebPermissions() … … 52 80 bool allowed = enabledPerSettings && m_imagesAllowed; 53 81 if (m_dumpCallbacks && m_delegate) 54 m_delegate->printMessage(std::string("PERMISSION CLIENT: allowImage(") + m_delegate->normalizeLayoutTestURL(imageURL.spec()) + "): " + (allowed ? "true" : "false") + "\n");82 m_delegate->printMessage(std::string("PERMISSION CLIENT: allowImage(") + normalizeLayoutTestURL(imageURL.spec()) + "): " + (allowed ? "true" : "false") + "\n"); 55 83 return allowed; 56 84 } … … 60 88 bool allowed = enabledPerSettings && m_scriptsAllowed; 61 89 if (m_dumpCallbacks && m_delegate) 62 m_delegate->printMessage(std::string("PERMISSION CLIENT: allowScriptFromSource(") + m_delegate->normalizeLayoutTestURL(scriptURL.spec()) + "): " + (allowed ? "true" : "false") + "\n");90 m_delegate->printMessage(std::string("PERMISSION CLIENT: allowScriptFromSource(") + normalizeLayoutTestURL(scriptURL.spec()) + "): " + (allowed ? "true" : "false") + "\n"); 63 91 return allowed; 64 92 } -
trunk/Tools/DumpRenderTree/chromium/TestShell.cpp
r141926 r142253 826 826 return m_windowList.size(); 827 827 } 828 829 string TestShell::normalizeLayoutTestURL(const string& url)830 {831 return normalizeLayoutTestURLInternal(url);832 } -
trunk/Tools/DumpRenderTree/chromium/TestShell.h
r141926 r142253 179 179 WindowList windowList() const { return m_windowList; } 180 180 181 // Returns a string representation of an URL's spec that does not depend on182 // the location of the layout test in the file system.183 std::string normalizeLayoutTestURL(const std::string&);184 185 181 private: 186 182 WebViewHost* createNewWindow(const WebKit::WebURL&, DRTDevToolsAgent*, WebTestRunner::WebTestInterfaces*); -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r141823 r142253 733 733 } 734 734 735 std::string WebViewHost::normalizeLayoutTestURL(const std::string& url)736 {737 return m_shell->normalizeLayoutTestURL(url);738 }739 740 735 void WebViewHost::showDevTools() 741 736 { -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.h
r141823 r142253 130 130 #endif 131 131 virtual std::string makeURLErrorDescription(const WebKit::WebURLError&) OVERRIDE; 132 virtual std::string normalizeLayoutTestURL(const std::string&) OVERRIDE;133 132 virtual void setClientWindowRect(const WebKit::WebRect&) OVERRIDE; 134 133 virtual void showDevTools() OVERRIDE;
Note: See TracChangeset
for help on using the changeset viewer.