Chromium Code Reviews| Index: webkit/support/test_webkit_platform_support.cc |
| diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc |
| index 750b32b4886e71a82250f797b75d801b95f6d346..c158edb532154fb0c2288ab0d9f8f49ca2af3f93 100644 |
| --- a/webkit/support/test_webkit_platform_support.cc |
| +++ b/webkit/support/test_webkit_platform_support.cc |
| @@ -611,3 +611,52 @@ WebKit::WebGestureCurve* TestWebKitPlatformSupport::createFlingAnimationCurve( |
| // Caller will retain and release. |
| return new WebGestureCurveMock(velocity, cumulative_scroll); |
| } |
| + |
| +void TestWebKitPlatformSupport::registerMockedURL( |
| + const WebKit::WebURL& url, |
| + const WebKit::WebURLResponse& response, |
| + const WebKit::WebString& file_path) { |
| + url_loader_factory_.RegisterURL(url, response, file_path); |
| +} |
| + |
| +void TestWebKitPlatformSupport::registerMockedErrorURL( |
| + const WebKit::WebURL& url, |
| + const WebKit::WebURLResponse& response, |
| + const WebKit::WebURLError& error) { |
| + url_loader_factory_.RegisterErrorURL(url, response, error); |
| +} |
| + |
| +void TestWebKitPlatformSupport::unregisterMockedURL(const WebKit::WebURL& url) { |
| + url_loader_factory_.UnregisterURL(url); |
| +} |
| + |
| +void TestWebKitPlatformSupport::unregisterAllMockedURLs() { |
| + url_loader_factory_.UnregisterAllURLs(); |
| +} |
| + |
| +void TestWebKitPlatformSupport::serveAsynchronousMockedRequests() { |
| + url_loader_factory_.ServeAsynchronousRequests(); |
| +} |
| + |
| +WebKit::WebString TestWebKitPlatformSupport::getWebKitRootDir() { |
|
darin (slow to review)
2013/02/10 05:07:03
this looks like a copy of GetWebKitRootDirFilePath
|
| + base::FilePath basePath; |
| + PathService::Get(base::DIR_SOURCE_ROOT, &basePath); |
| + if (file_util::PathExists( |
| + basePath.Append(FILE_PATH_LITERAL("third_party/WebKit")))) { |
| + // We're in a WebKit-in-chrome checkout. |
| + basePath = basePath.Append(FILE_PATH_LITERAL("third_party/WebKit")); |
| + } else if (file_util::PathExists( |
| + basePath.Append(FILE_PATH_LITERAL("chromium")))) { |
| + // We're in a WebKit-only checkout on Windows. |
| + basePath = basePath.Append(FILE_PATH_LITERAL("../..")); |
| + } else if (file_util::PathExists( |
| + basePath.Append(FILE_PATH_LITERAL("webkit/support")))) { |
| + // We're in a WebKit-only/xcodebuild checkout on Mac |
| + basePath = basePath.Append(FILE_PATH_LITERAL("../../..")); |
| + } |
| + CHECK(file_util::AbsolutePath(&basePath)); |
| + std::string path_ascii = basePath.MaybeAsASCII(); |
| + CHECK(!path_ascii.empty()); |
| + return WebKit::WebString::fromUTF8(path_ascii.c_str()); |
| +} |
| + |