summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/image_decoder_unittest.cc40
-rw-r--r--webkit/tools/test_shell/image_decoder_unittest.h12
-rw-r--r--webkit/tools/test_shell/plugin_tests.cc12
-rw-r--r--webkit/tools/test_shell/run_all_tests.cc2
-rw-r--r--webkit/tools/test_shell/simple_appcache_system.cc2
-rw-r--r--webkit/tools/test_shell/simple_appcache_system.h6
-rw-r--r--webkit/tools/test_shell/simple_file_system.cc8
-rw-r--r--webkit/tools/test_shell/simple_file_system.h4
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc12
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.h7
-rw-r--r--webkit/tools/test_shell/test_shell.cc16
-rw-r--r--webkit/tools/test_shell/test_shell.h6
-rw-r--r--webkit/tools/test_shell/test_shell_gtk.cc18
-rw-r--r--webkit/tools/test_shell/test_shell_mac.mm20
-rw-r--r--webkit/tools/test_shell/test_shell_main.cc6
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.cc6
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.h6
-rw-r--r--webkit/tools/test_shell/test_shell_test.cc2
-rw-r--r--webkit/tools/test_shell/test_shell_test.h4
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.cc6
-rw-r--r--webkit/tools/test_shell/test_shell_win.cc18
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.h4
-rw-r--r--webkit/tools/test_shell/test_webview_delegate_gtk.cc2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate_mac.mm2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate_win.cc2
-rw-r--r--webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp4
27 files changed, 117 insertions, 112 deletions
diff --git a/webkit/tools/test_shell/image_decoder_unittest.cc b/webkit/tools/test_shell/image_decoder_unittest.cc
index 849d1b2..0458af2 100644
--- a/webkit/tools/test_shell/image_decoder_unittest.cc
+++ b/webkit/tools/test_shell/image_decoder_unittest.cc
@@ -23,7 +23,7 @@ const int kFirstFrameIndex = 0;
// Determine if we should test with file specified by |path| based
// on |file_selection| and the |threshold| for the file size.
-bool ShouldSkipFile(const FilePath& path,
+bool ShouldSkipFile(const base::FilePath& path,
ImageDecoderTestFileSelection file_selection,
const int64 threshold) {
if (file_selection == TEST_ALL)
@@ -36,21 +36,21 @@ bool ShouldSkipFile(const FilePath& path,
} // namespace
-void ReadFileToVector(const FilePath& path, std::vector<char>* contents) {
+void ReadFileToVector(const base::FilePath& path, std::vector<char>* contents) {
std::string raw_image_data;
file_util::ReadFileToString(path, &raw_image_data);
contents->resize(raw_image_data.size());
memcpy(&contents->at(0), raw_image_data.data(), raw_image_data.size());
}
-FilePath GetMD5SumPath(const FilePath& path) {
- static const FilePath::StringType kDecodedDataExtension(
+base::FilePath GetMD5SumPath(const base::FilePath& path) {
+ static const base::FilePath::StringType kDecodedDataExtension(
FILE_PATH_LITERAL(".md5sum"));
- return FilePath(path.value() + kDecodedDataExtension);
+ return base::FilePath(path.value() + kDecodedDataExtension);
}
#if defined(CALCULATE_MD5_SUMS)
-void SaveMD5Sum(const FilePath& path, const WebKit::WebImage& web_image) {
+void SaveMD5Sum(const base::FilePath& path, const WebKit::WebImage& web_image) {
// Calculate MD5 sum.
base::MD5Digest digest;
web_image.getSkBitmap().lockPixels();
@@ -69,8 +69,8 @@ void SaveMD5Sum(const FilePath& path, const WebKit::WebImage& web_image) {
#if !defined(CALCULATE_MD5_SUMS)
void VerifyImage(const WebKit::WebImageDecoder& decoder,
- const FilePath& path,
- const FilePath& md5_sum_path,
+ const base::FilePath& path,
+ const base::FilePath& md5_sum_path,
size_t frame_index) {
// Make sure decoding can complete successfully.
EXPECT_TRUE(decoder.isSizeAvailable()) << path.value();
@@ -103,7 +103,7 @@ void VerifyImage(const WebKit::WebImageDecoder& decoder,
#endif
void ImageDecoderTest::SetUp() {
- FilePath data_dir;
+ base::FilePath data_dir;
ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_dir));
data_dir_ = data_dir.AppendASCII("webkit").
AppendASCII("data").
@@ -111,17 +111,17 @@ void ImageDecoderTest::SetUp() {
ASSERT_TRUE(file_util::PathExists(data_dir_)) << data_dir_.value();
}
-std::vector<FilePath> ImageDecoderTest::GetImageFiles() const {
+std::vector<base::FilePath> ImageDecoderTest::GetImageFiles() const {
std::string pattern = "*." + format_;
file_util::FileEnumerator enumerator(data_dir_,
false,
file_util::FileEnumerator::FILES);
- std::vector<FilePath> image_files;
- FilePath next_file_name;
+ std::vector<base::FilePath> image_files;
+ base::FilePath next_file_name;
while (!(next_file_name = enumerator.Next()).empty()) {
- FilePath base_name = next_file_name.BaseName();
+ base::FilePath base_name = next_file_name.BaseName();
#if defined(OS_WIN)
std::string base_name_ascii = WideToASCII(base_name.value());
#else
@@ -135,8 +135,8 @@ std::vector<FilePath> ImageDecoderTest::GetImageFiles() const {
return image_files;
}
-bool ImageDecoderTest::ShouldImageFail(const FilePath& path) const {
- static const FilePath::StringType kBadSuffix(FILE_PATH_LITERAL(".bad."));
+bool ImageDecoderTest::ShouldImageFail(const base::FilePath& path) const {
+ static const base::FilePath::StringType kBadSuffix(FILE_PATH_LITERAL(".bad."));
return (path.value().length() > (kBadSuffix.length() + format_.length()) &&
!path.value().compare(path.value().length() - format_.length() -
kBadSuffix.length(),
@@ -146,18 +146,18 @@ bool ImageDecoderTest::ShouldImageFail(const FilePath& path) const {
void ImageDecoderTest::TestDecoding(
ImageDecoderTestFileSelection file_selection,
const int64 threshold) {
- const std::vector<FilePath> image_files(GetImageFiles());
- for (std::vector<FilePath>::const_iterator i = image_files.begin();
+ const std::vector<base::FilePath> image_files(GetImageFiles());
+ for (std::vector<base::FilePath>::const_iterator i = image_files.begin();
i != image_files.end(); ++i) {
if (ShouldSkipFile(*i, file_selection, threshold))
continue;
- const FilePath md5_sum_path(GetMD5SumPath(*i));
+ const base::FilePath md5_sum_path(GetMD5SumPath(*i));
TestWebKitImageDecoder(*i, md5_sum_path, kFirstFrameIndex);
}
}
-void ImageDecoderTest::TestWebKitImageDecoder(const FilePath& image_path,
- const FilePath& md5_sum_path, int desired_frame_index) const {
+void ImageDecoderTest::TestWebKitImageDecoder(const base::FilePath& image_path,
+ const base::FilePath& md5_sum_path, int desired_frame_index) const {
bool should_test_chunking = true;
bool should_test_failed_images = true;
#ifdef CALCULATE_MD5_SUMS
diff --git a/webkit/tools/test_shell/image_decoder_unittest.h b/webkit/tools/test_shell/image_decoder_unittest.h
index d9bff21..85b88c2 100644
--- a/webkit/tools/test_shell/image_decoder_unittest.h
+++ b/webkit/tools/test_shell/image_decoder_unittest.h
@@ -37,7 +37,7 @@ enum ImageDecoderTestFileSelection {
};
// Returns the path the decoded data is saved at.
-FilePath GetMD5SumPath(const FilePath& path);
+base::FilePath GetMD5SumPath(const base::FilePath& path);
class ImageDecoderTest : public testing::Test {
public:
@@ -47,16 +47,16 @@ class ImageDecoderTest : public testing::Test {
virtual void SetUp() OVERRIDE;
// Returns the vector of image files for testing.
- std::vector<FilePath> GetImageFiles() const;
+ std::vector<base::FilePath> GetImageFiles() const;
// Returns true if the image is bogus and should not be successfully decoded.
- bool ShouldImageFail(const FilePath& path) const;
+ bool ShouldImageFail(const base::FilePath& path) const;
// Tests if decoder decodes image at image_path with underlying frame at
// index desired_frame_index. The md5_sum_path is needed if the test is not
// asked to generate one i.e. if # #define CALCULATE_MD5_SUMS is set.
- void TestWebKitImageDecoder(const FilePath& image_path,
- const FilePath& md5_sum_path, int desired_frame_index) const;
+ void TestWebKitImageDecoder(const base::FilePath& image_path,
+ const base::FilePath& md5_sum_path, int desired_frame_index) const;
// Verifies each of the test image files is decoded correctly and matches the
// expected state. |file_selection| and |threshold| can be used to select
@@ -77,7 +77,7 @@ class ImageDecoderTest : public testing::Test {
protected:
// Path to the test files.
- FilePath data_dir_;
+ base::FilePath data_dir_;
private:
DISALLOW_COPY_AND_ASSIGN(ImageDecoderTest);
diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc
index 8a4dbda..ec352b4 100644
--- a/webkit/tools/test_shell/plugin_tests.cc
+++ b/webkit/tools/test_shell/plugin_tests.cc
@@ -42,7 +42,7 @@ const char kPluginsDir[] = "plugins";
class PluginTest : public TestShellTest {
public:
PluginTest() {
- FilePath executable_directory;
+ base::FilePath executable_directory;
PathService::Get(base::DIR_EXE, &executable_directory);
plugin_src_ = executable_directory.AppendASCII(TEST_PLUGIN_NAME);
CHECK(file_util::PathExists(plugin_src_));
@@ -69,8 +69,8 @@ class PluginTest : public TestShellTest {
TestShellTest::SetUp();
}
- FilePath plugin_src_;
- FilePath plugin_file_path_;
+ base::FilePath plugin_src_;
+ base::FilePath plugin_file_path_;
};
// Tests navigator.plugins.refresh() works.
@@ -126,7 +126,7 @@ TEST_F(PluginTest, Refresh) {
// Tests that if a frame is deleted as a result of calling NPP_HandleEvent, we
// don't crash.
TEST_F(PluginTest, DeleteFrameDuringEvent) {
- FilePath test_html = data_dir_;
+ base::FilePath test_html = data_dir_;
test_html = test_html.AppendASCII(kPluginsDir);
test_html = test_html.AppendASCII("delete_frame.html");
test_shell_->LoadFile(test_html);
@@ -144,7 +144,7 @@ TEST_F(PluginTest, DeleteFrameDuringEvent) {
// Tests that a forced reload of the plugin will not crash.
TEST_F(PluginTest, ForceReload) {
- FilePath test_html = data_dir_;
+ base::FilePath test_html = data_dir_;
test_html = test_html.AppendASCII(kPluginsDir);
test_html = test_html.AppendASCII("force_reload.html");
test_shell_->LoadFile(test_html);
@@ -174,7 +174,7 @@ BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lparam) {
#endif
TEST_F(PluginTest, MAYBE_PluginVisibilty) {
- FilePath test_html = data_dir_;
+ base::FilePath test_html = data_dir_;
test_html = test_html.AppendASCII(kPluginsDir);
test_html = test_html.AppendASCII("plugin_visibility.html");
test_shell_->LoadFile(test_html);
diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc
index 19d1a30..9b3ec46 100644
--- a/webkit/tools/test_shell/run_all_tests.cc
+++ b/webkit/tools/test_shell/run_all_tests.cc
@@ -43,7 +43,7 @@ class TestShellTestSuite : public base::TestSuite {
virtual void Initialize() {
// Override DIR_EXE early in case anything in base::TestSuite uses it.
#if defined(OS_MACOSX)
- FilePath path;
+ base::FilePath path;
PathService::Get(base::DIR_EXE, &path);
path = path.AppendASCII("TestShell.app");
base::mac::SetOverrideFrameworkBundlePath(path);
diff --git a/webkit/tools/test_shell/simple_appcache_system.cc b/webkit/tools/test_shell/simple_appcache_system.cc
index 6c066db..8503672 100644
--- a/webkit/tools/test_shell/simple_appcache_system.cc
+++ b/webkit/tools/test_shell/simple_appcache_system.cc
@@ -387,7 +387,7 @@ SimpleAppCacheSystem::~SimpleAppCacheSystem() {
}
}
-void SimpleAppCacheSystem::InitOnUIThread(const FilePath& cache_directory) {
+void SimpleAppCacheSystem::InitOnUIThread(const base::FilePath& cache_directory) {
DCHECK(!ui_message_loop_);
ui_message_loop_ = MessageLoop::current();
cache_directory_ = cache_directory;
diff --git a/webkit/tools/test_shell/simple_appcache_system.h b/webkit/tools/test_shell/simple_appcache_system.h
index 2975268a..7371913 100644
--- a/webkit/tools/test_shell/simple_appcache_system.h
+++ b/webkit/tools/test_shell/simple_appcache_system.h
@@ -38,7 +38,7 @@ class SimpleAppCacheSystem {
virtual ~SimpleAppCacheSystem();
// One-time main UI thread initialization.
- static void InitializeOnUIThread(const FilePath& cache_directory) {
+ static void InitializeOnUIThread(const base::FilePath& cache_directory) {
if (instance_)
instance_->InitOnUIThread(cache_directory);
}
@@ -85,7 +85,7 @@ class SimpleAppCacheSystem {
friend class SimpleFrontendProxy;
// Instance methods called by our static public methods
- void InitOnUIThread(const FilePath& cache_directory);
+ void InitOnUIThread(const base::FilePath& cache_directory);
void InitOnIOThread(net::URLRequestContext* request_context);
void CleanupIOThread();
WebKit::WebApplicationCacheHost* CreateCacheHostForWebKit(
@@ -109,7 +109,7 @@ class SimpleAppCacheSystem {
return ui_message_loop_ ? true : false;
}
- FilePath cache_directory_;
+ base::FilePath cache_directory_;
MessageLoop* io_message_loop_;
MessageLoop* ui_message_loop_;
scoped_refptr<SimpleBackendProxy> backend_proxy_;
diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc
index f665541..87aabf4 100644
--- a/webkit/tools/test_shell/simple_file_system.cc
+++ b/webkit/tools/test_shell/simple_file_system.cc
@@ -54,10 +54,10 @@ namespace {
MessageLoop* g_io_thread;
webkit_blob::BlobStorageController* g_blob_storage_controller;
-void RegisterBlob(const GURL& blob_url, const FilePath& file_path) {
+void RegisterBlob(const GURL& blob_url, const base::FilePath& file_path) {
DCHECK(g_blob_storage_controller);
- FilePath::StringType extension = file_path.Extension();
+ base::FilePath::StringType extension = file_path.Extension();
if (!extension.empty())
extension = extension.substr(1); // Strip leading ".".
@@ -324,7 +324,7 @@ void SimpleFileSystem::DidFinish(WebFileSystemCallbacks* callbacks,
void SimpleFileSystem::DidGetMetadata(WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
- const FilePath& platform_path) {
+ const base::FilePath& platform_path) {
if (result == base::PLATFORM_FILE_OK) {
WebFileInfo web_file_info;
web_file_info.length = info.size;
@@ -388,7 +388,7 @@ void SimpleFileSystem::DidCreateSnapshotFile(
WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
DCHECK(g_io_thread);
if (result == base::PLATFORM_FILE_OK) {
diff --git a/webkit/tools/test_shell/simple_file_system.h b/webkit/tools/test_shell/simple_file_system.h
index 7d55a9f..099aeba 100644
--- a/webkit/tools/test_shell/simple_file_system.h
+++ b/webkit/tools/test_shell/simple_file_system.h
@@ -128,7 +128,7 @@ class SimpleFileSystem
void DidGetMetadata(WebKit::WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
- const FilePath& platform_path);
+ const base::FilePath& platform_path);
void DidReadDirectory(
WebKit::WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
@@ -144,7 +144,7 @@ class SimpleFileSystem
WebKit::WebFileSystemCallbacks* callbacks,
base::PlatformFileError result,
const base::PlatformFileInfo& info,
- const FilePath& platform_path,
+ const base::FilePath& platform_path,
const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
// A temporary directory for FileSystem API.
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index 02aaf80..743ba26 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -93,14 +93,14 @@ namespace {
struct TestShellRequestContextParams {
TestShellRequestContextParams(
- const FilePath& in_cache_path,
+ const base::FilePath& in_cache_path,
net::HttpCache::Mode in_cache_mode,
bool in_no_proxy)
: cache_path(in_cache_path),
cache_mode(in_cache_mode),
no_proxy(in_no_proxy) {}
- FilePath cache_path;
+ base::FilePath cache_path;
net::HttpCache::Mode cache_mode;
bool no_proxy;
};
@@ -177,7 +177,7 @@ class TestShellNetworkDelegate : public net::NetworkDelegate {
return rv == net::OK;
}
virtual bool OnCanAccessFile(const net::URLRequest& request,
- const FilePath& path) const OVERRIDE {
+ const base::FilePath& path) const OVERRIDE {
return true;
}
virtual bool OnCanThrottleRequest(
@@ -475,7 +475,7 @@ class RequestProxy
download_to_file_ = params->download_to_file;
if (download_to_file_) {
- FilePath path;
+ base::FilePath path;
if (file_util::CreateTemporaryFile(&path)) {
downloaded_file_ = ShareableFileReference::GetOrCreate(
path, ShareableFileReference::DELETE_ON_FINAL_RELEASE,
@@ -755,7 +755,7 @@ class RequestProxy
// Get the File URL.
original_request.replace(0, http_prefix.size(), file_url_prefix_);
- FilePath file_path;
+ base::FilePath file_path;
if (!net::FileURLToFilePath(GURL(original_request), &file_path)) {
NOTREACHED();
}
@@ -1027,7 +1027,7 @@ class CookieGetter : public base::RefCountedThreadSafe<CookieGetter> {
// static
void SimpleResourceLoaderBridge::Init(
- const FilePath& cache_path,
+ const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy) {
// Make sure to stop any existing IO thread since it may be using the
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.h b/webkit/tools/test_shell/simple_resource_loader_bridge.h
index 6d1c63a..35d38b5 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.h
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.h
@@ -10,9 +10,12 @@
#include "net/http/http_cache.h"
#include "webkit/glue/resource_loader_bridge.h"
-class FilePath;
class GURL;
+namespace base {
+class FilePath;
+}
+
class SimpleResourceLoaderBridge {
public:
// Call this function to initialize the simple resource loader bridge.
@@ -21,7 +24,7 @@ class SimpleResourceLoaderBridge {
// NOTE: If this function is not called, then a default request context will
// be initialized lazily.
//
- static void Init(const FilePath& cache_path,
+ static void Init(const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy);
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 763495ea..677dc42 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -88,7 +88,7 @@ class URLRequestTestShellFileJob : public net::URLRequestFileJob {
net::URLRequest* request,
net::NetworkDelegate* network_delegate,
const std::string& scheme) {
- FilePath path;
+ base::FilePath path;
PathService::Get(base::DIR_EXE, &path);
path = path.AppendASCII("resources");
path = path.AppendASCII("inspector");
@@ -99,7 +99,7 @@ class URLRequestTestShellFileJob : public net::URLRequestFileJob {
private:
URLRequestTestShellFileJob(net::URLRequest* request,
net::NetworkDelegate* network_delegate,
- const FilePath& path)
+ const base::FilePath& path)
: net::URLRequestFileJob(request, network_delegate, path) {
}
virtual ~URLRequestTestShellFileJob() { }
@@ -263,7 +263,7 @@ void TestShell::InitLogging(bool suppress_error_dialogs,
destination = logging::LOG_ONLY_TO_FILE;
// We might have multiple test_shell processes going at once
- FilePath log_filename;
+ base::FilePath log_filename;
PathService::Get(base::DIR_EXE, &log_filename);
log_filename = log_filename.AppendASCII("test_shell.log");
logging::InitLogging(
@@ -459,9 +459,9 @@ WebView* TestShell::CreateWebView() {
void TestShell::ShowDevTools() {
if (!devtools_shell_) {
- FilePath dir_exe;
+ base::FilePath dir_exe;
PathService::Get(base::DIR_EXE, &dir_exe);
- FilePath devtools_path =
+ base::FilePath devtools_path =
dir_exe.AppendASCII("resources/inspector/devtools.html");
TestShell* devtools_shell;
TestShell::CreateNewWindow(GURL(devtools_path.value()),
@@ -502,7 +502,7 @@ void TestShell::ResetTestController() {
geolocation_client_mock_->resetMock();
}
-void TestShell::LoadFile(const FilePath& file) {
+void TestShell::LoadFile(const base::FilePath& file) {
LoadURLForFrame(net::FilePathToFileURL(file), string16());
}
@@ -559,7 +559,7 @@ void TestShell::GoBackOrForward(int offset) {
}
void TestShell::DumpDocumentText() {
- FilePath file_path;
+ base::FilePath file_path;
if (!PromptForSaveFile(L"Dump document text", &file_path))
return;
@@ -569,7 +569,7 @@ void TestShell::DumpDocumentText() {
}
void TestShell::DumpRenderTree() {
- FilePath file_path;
+ base::FilePath file_path;
if (!PromptForSaveFile(L"Dump render tree", &file_path))
return;
diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h
index 58118ab..e464423 100644
--- a/webkit/tools/test_shell/test_shell.h
+++ b/webkit/tools/test_shell/test_shell.h
@@ -59,7 +59,7 @@ public:
bool dump_pixels;
// Filename we dump pixels to (when pixel testing is enabled).
- FilePath pixel_file_name;
+ base::FilePath pixel_file_name;
// The md5 hash of the bitmap dump (when pixel testing is enabled).
std::string pixel_hash;
// URL of the test.
@@ -150,14 +150,14 @@ public:
return true;
}
- void LoadFile(const FilePath& file);
+ void LoadFile(const base::FilePath& file);
void LoadURL(const GURL& url);
void LoadURLForFrame(const GURL& url, const string16& frame_name);
void GoBackOrForward(int offset);
void Reload();
bool Navigate(const TestNavigationEntry& entry, bool reload);
- bool PromptForSaveFile(const wchar_t* prompt_title, FilePath* result);
+ bool PromptForSaveFile(const wchar_t* prompt_title, base::FilePath* result);
string16 GetDocumentText();
void DumpDocumentText();
void DumpRenderTree();
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index 0ec3fd5..6576d07 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -41,9 +41,9 @@ using WebKit::WebWidget;
namespace {
-// Convert a FilePath into an FcChar* (used by fontconfig).
+// Convert a base::FilePath into an FcChar* (used by fontconfig).
// The pointer only lives for the duration for the expression.
-const FcChar8* FilePathAsFcChar(const FilePath& path) {
+const FcChar8* FilePathAsFcChar(const base::FilePath& path) {
return reinterpret_cast<const FcChar8*>(path.value().c_str());
}
@@ -159,12 +159,12 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
web_prefs_ = new webkit_glue::WebPreferences;
- FilePath data_path;
+ base::FilePath data_path;
PathService::Get(base::DIR_EXE, &data_path);
data_path = data_path.Append("test_shell.pak");
ResourceBundle::InitSharedInstanceWithPakPath(data_path);
- FilePath resources_dir;
+ base::FilePath resources_dir;
PathService::Get(base::DIR_SOURCE_ROOT, &resources_dir);
resources_dir = resources_dir.Append("webkit/tools/test_shell/resources");
@@ -185,7 +185,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
FcInit();
FcConfig* fontcfg = FcConfigCreate();
- FilePath fontconfig_path = resources_dir.Append("fonts.conf");
+ base::FilePath fontconfig_path = resources_dir.Append("fonts.conf");
if (!FcConfigParseAndLoad(fontcfg, FilePathAsFcChar(fontconfig_path),
true)) {
LOG(FATAL) << "Failed to parse fontconfig config file";
@@ -263,7 +263,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
}
// Also load the layout-test-specific "Ahem" font.
- FilePath ahem_path = resources_dir.Append("AHEM____.TTF");
+ base::FilePath ahem_path = resources_dir.Append("AHEM____.TTF");
if (!FcConfigAppFontAddFile(fontcfg, FilePathAsFcChar(ahem_path))) {
LOG(FATAL) << "Failed to load font " << ahem_path.value().c_str();
}
@@ -508,7 +508,7 @@ void TestShell::LoadURLForFrame(const GURL& url,
}
bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
- FilePath* result) {
+ base::FilePath* result) {
GtkWidget* dialog;
dialog = gtk_file_chooser_dialog_new(WideToUTF8(prompt_title).c_str(),
GTK_WINDOW(m_mainWnd),
@@ -525,7 +525,7 @@ bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
}
char* path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
gtk_widget_destroy(dialog);
- *result = FilePath(path);
+ *result = base::FilePath(path);
g_free(path);
return true;
}
@@ -538,7 +538,7 @@ std::string TestShell::RewriteLocalUrl(const std::string& url) {
std::string new_url(url);
if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) {
- FilePath replace_path;
+ base::FilePath replace_path;
PathService::Get(base::DIR_SOURCE_ROOT, &replace_path);
replace_path = replace_path.Append(
"third_party/WebKit/LayoutTests/");
diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm
index ccfaa67..fe86310 100644
--- a/webkit/tools/test_shell/test_shell_mac.mm
+++ b/webkit/tools/test_shell/test_shell_mac.mm
@@ -78,12 +78,12 @@ base::LazyInstance <std::map<gfx::NativeWindow, TestShell *> >
TestShell::window_map_ = LAZY_INSTANCE_INITIALIZER;
// Helper method for getting the path to the test shell resources directory.
-FilePath GetResourcesFilePath() {
- FilePath path;
+base::FilePath GetResourcesFilePath() {
+ base::FilePath path;
// We need to know if we're bundled or not to know which path to use.
if (base::mac::AmIBundled()) {
PathService::Get(base::DIR_EXE, &path);
- path = path.Append(FilePath::kParentDirectory);
+ path = path.Append(base::FilePath::kParentDirectory);
return path.AppendASCII("Resources");
} else {
PathService::Get(base::DIR_SOURCE_ROOT, &path);
@@ -215,7 +215,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
NSString *resource_path =
[base::mac::FrameworkBundle() pathForResource:@"test_shell"
ofType:@"pak"];
- FilePath resources_pak_path([resource_path fileSystemRepresentation]);
+ base::FilePath resources_pak_path([resource_path fileSystemRepresentation]);
if (!g_resource_data_pack->LoadFromPath(resources_pak_path)) {
LOG(FATAL) << "failed to load test_shell.pak";
}
@@ -236,7 +236,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode,
// Add <app bundle's parent dir>/plugins to the plugin path so we can load
// test plugins.
- FilePath plugins_dir;
+ base::FilePath plugins_dir;
PathService::Get(base::DIR_EXE, &plugins_dir);
if (base::mac::AmIBundled()) {
plugins_dir = plugins_dir.AppendASCII("../../../plugins");
@@ -539,7 +539,7 @@ void TestShell::LoadURLForFrame(const GURL& url,
}
bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
- FilePath* result)
+ base::FilePath* result)
{
NSSavePanel* save_panel = [NSSavePanel savePanel];
@@ -552,7 +552,7 @@ bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
[save_panel setDirectoryURL:[NSURL fileURLWithPath:NSHomeDirectory()]];
[save_panel setNameFieldStringValue:@""];
if ([save_panel runModal] == NSFileHandlingPanelOKButton) {
- *result = FilePath([[[save_panel URL] path] fileSystemRepresentation]);
+ *result = base::FilePath([[[save_panel URL] path] fileSystemRepresentation]);
return true;
}
return false;
@@ -566,7 +566,7 @@ std::string TestShell::RewriteLocalUrl(const std::string& url) {
std::string new_url(url);
if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) {
- FilePath replace_path;
+ base::FilePath replace_path;
PathService::Get(base::DIR_SOURCE_ROOT, &replace_path);
replace_path = replace_path.Append(
"third_party/WebKit/LayoutTests/");
@@ -628,7 +628,7 @@ base::StringPiece TestShellWebKitInit::GetDataResource(
// Use webkit's broken image icon (16x16)
static std::string broken_image_data;
if (broken_image_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
// In order to match WebKit's colors for the missing image, we have to
// use a PNG. The GIF doesn't have the color range needed to correctly
// match the TIFF they use in Safari.
@@ -644,7 +644,7 @@ base::StringPiece TestShellWebKitInit::GetDataResource(
// Use webkit's text area resizer image.
static std::string resize_corner_data;
if (resize_corner_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
path = path.AppendASCII("textAreaResizeCorner.png");
bool success = file_util::ReadFileToString(path, &resize_corner_data);
if (!success) {
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index 5bebaad..5c98d98 100644
--- a/webkit/tools/test_shell/test_shell_main.cc
+++ b/webkit/tools/test_shell/test_shell_main.cc
@@ -160,7 +160,7 @@ int main(int argc, char* argv[]) {
if (parsed_command_line.HasSwitch(test_shell::kEnableFileCookies))
net::CookieMonster::EnableFileScheme();
- FilePath cache_path =
+ base::FilePath cache_path =
parsed_command_line.GetSwitchValuePath(test_shell::kCacheDir);
if (cache_path.empty()) {
PathService::Get(base::DIR_EXE, &cache_path);
@@ -214,7 +214,7 @@ int main(int argc, char* argv[]) {
// Treat the first argument as the initial URL to open.
GURL starting_url;
- FilePath path;
+ base::FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
path = path.AppendASCII("webkit").AppendASCII("data")
.AppendASCII("test_shell").AppendASCII("index.html");
@@ -227,7 +227,7 @@ int main(int argc, char* argv[]) {
starting_url = url;
} else {
// Treat as a relative file path.
- FilePath path = FilePath(args[0]);
+ base::FilePath path = base::FilePath(args[0]);
file_util::AbsolutePath(&path);
starting_url = net::FilePathToFileURL(path);
}
diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc
index 5bdf4c9..eec8e82 100644
--- a/webkit/tools/test_shell/test_shell_request_context.cc
+++ b/webkit/tools/test_shell/test_shell_request_context.cc
@@ -58,11 +58,11 @@ class TestShellHttpUserAgentSettings : public net::HttpUserAgentSettings {
TestShellRequestContext::TestShellRequestContext()
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
- Init(FilePath(), net::HttpCache::NORMAL, false);
+ Init(base::FilePath(), net::HttpCache::NORMAL, false);
}
TestShellRequestContext::TestShellRequestContext(
- const FilePath& cache_path,
+ const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy)
: ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
@@ -70,7 +70,7 @@ TestShellRequestContext::TestShellRequestContext(
}
void TestShellRequestContext::Init(
- const FilePath& cache_path,
+ const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy) {
storage_.set_cookie_store(new net::CookieMonster(NULL, NULL));
diff --git a/webkit/tools/test_shell/test_shell_request_context.h b/webkit/tools/test_shell/test_shell_request_context.h
index 27ef6fe..bcd59e4 100644
--- a/webkit/tools/test_shell/test_shell_request_context.h
+++ b/webkit/tools/test_shell/test_shell_request_context.h
@@ -10,7 +10,9 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_storage.h"
+namespace base {
class FilePath;
+}
namespace fileapi {
class FileSystemContext;
@@ -28,7 +30,7 @@ class TestShellRequestContext : public net::URLRequestContext {
// Use an on-disk cache at the specified location. Optionally, use the cache
// in playback or record mode.
- TestShellRequestContext(const FilePath& cache_path,
+ TestShellRequestContext(const base::FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy);
@@ -43,7 +45,7 @@ class TestShellRequestContext : public net::URLRequestContext {
}
private:
- void Init(const FilePath& cache_path, net::HttpCache::Mode cache_mode,
+ void Init(const base::FilePath& cache_path, net::HttpCache::Mode cache_mode,
bool no_proxy);
net::URLRequestContextStorage storage_;
diff --git a/webkit/tools/test_shell/test_shell_test.cc b/webkit/tools/test_shell/test_shell_test.cc
index 16357f2..2ea5e74 100644
--- a/webkit/tools/test_shell/test_shell_test.cc
+++ b/webkit/tools/test_shell/test_shell_test.cc
@@ -17,7 +17,7 @@
#include "webkit/user_agent/user_agent.h"
#include "webkit/user_agent/user_agent_util.h"
-GURL TestShellTest::GetTestURL(const FilePath& test_case_path,
+GURL TestShellTest::GetTestURL(const base::FilePath& test_case_path,
const std::string& test_case) {
return net::FilePathToFileURL(test_case_path.AppendASCII(test_case));
}
diff --git a/webkit/tools/test_shell/test_shell_test.h b/webkit/tools/test_shell/test_shell_test.h
index 3e2e354..c29a37d 100644
--- a/webkit/tools/test_shell/test_shell_test.h
+++ b/webkit/tools/test_shell/test_shell_test.h
@@ -20,7 +20,7 @@
class TestShellTest : public testing::Test {
protected:
// Returns the path "test_case_path/test_case".
- GURL GetTestURL(const FilePath& test_case_path,
+ GURL GetTestURL(const base::FilePath& test_case_path,
const std::string& test_case);
virtual void SetUp() OVERRIDE;
@@ -31,7 +31,7 @@ class TestShellTest : public testing::Test {
protected:
// Location of SOURCE_ROOT/webkit/data/
- FilePath data_dir_;
+ base::FilePath data_dir_;
TestShell* test_shell_;
};
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.cc b/webkit/tools/test_shell/test_shell_webkit_init.cc
index ded88b3..72ddbbf 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.cc
+++ b/webkit/tools/test_shell/test_shell_webkit_init.cc
@@ -52,7 +52,7 @@ TestShellWebKitInit::TestShellWebKitInit(bool layout_test_mode)
WebKit::WebRuntimeFeatures::enableJavaScriptI18NAPI(true);
// Load libraries for media and enable the media player.
- FilePath module_path;
+ base::FilePath module_path;
WebKit::WebRuntimeFeatures::enableMediaPlayer(
PathService::Get(base::DIR_MODULE, &module_path) &&
media::InitializeMediaLibrary(module_path));
@@ -277,7 +277,7 @@ void TestShellWebKitInit::GetPlugins(
webkit::npapi::PluginList::Singleton()->GetPlugins(plugins);
// Don't load the forked TestNetscapePlugIn in the chromium code, use
// the copy in webkit.org's repository instead.
- const FilePath::StringType kPluginBlackList[] = {
+ const base::FilePath::StringType kPluginBlackList[] = {
FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"),
FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"),
FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"),
@@ -285,7 +285,7 @@ void TestShellWebKitInit::GetPlugins(
for (int i = plugins->size() - 1; i >= 0; --i) {
webkit::WebPluginInfo plugin_info = plugins->at(i);
for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) {
- if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) {
+ if (plugin_info.path.BaseName() == base::FilePath(kPluginBlackList[j])) {
plugins->erase(plugins->begin() + i);
}
}
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc
index b2d2c46..0897c44 100644
--- a/webkit/tools/test_shell/test_shell_win.cc
+++ b/webkit/tools/test_shell/test_shell_win.cc
@@ -101,13 +101,13 @@ bool MinidumpCallback(const wchar_t *dumpPath,
// will be happening on developers' machines where they have debuggers.
base::StackString16<kPathBufSize * 2> origPath;
origPath->append(dumpPath);
- origPath->push_back(FilePath::kSeparators[0]);
+ origPath->push_back(base::FilePath::kSeparators[0]);
origPath->append(minidumpID);
origPath->append(L".dmp");
base::StackString16<kPathBufSize * 2> newPath;
newPath->append(dumpPath);
- newPath->push_back(FilePath::kSeparators[0]);
+ newPath->push_back(base::FilePath::kSeparators[0]);
newPath->append(g_currentTestName);
newPath->append(L"-");
newPath->append(minidumpID);
@@ -121,8 +121,8 @@ bool MinidumpCallback(const wchar_t *dumpPath,
}
// Helper method for getting the path to the test shell resources directory.
-FilePath GetResourcesFilePath() {
- FilePath path;
+base::FilePath GetResourcesFilePath() {
+ base::FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
path = path.AppendASCII("webkit");
path = path.AppendASCII("tools");
@@ -251,7 +251,7 @@ std::string TestShell::RewriteLocalUrl(const std::string& url) {
std::string new_url(url);
if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) {
- FilePath replace_url;
+ base::FilePath replace_url;
PathService::Get(base::DIR_EXE, &replace_url);
replace_url = replace_url.DirName();
replace_url = replace_url.DirName();
@@ -640,7 +640,7 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
}
bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
- FilePath* result) {
+ base::FilePath* result) {
wchar_t path_buf[MAX_PATH] = L"data.txt";
OPENFILENAME info = {0};
@@ -654,7 +654,7 @@ bool TestShell::PromptForSaveFile(const wchar_t* prompt_title,
if (!GetSaveFileName(&info))
return false;
- *result = FilePath(info.lpstrFile);
+ *result = base::FilePath(info.lpstrFile);
return true;
}
@@ -689,7 +689,7 @@ base::StringPiece TestShellWebKitInit::GetDataResource(
// Use webkit's broken image icon (16x16)
static std::string broken_image_data;
if (broken_image_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
path = path.AppendASCII("missingImage.gif");
bool success = file_util::ReadFileToString(path, &broken_image_data);
if (!success) {
@@ -702,7 +702,7 @@ base::StringPiece TestShellWebKitInit::GetDataResource(
// Use webkit's text area resizer image.
static std::string resize_corner_data;
if (resize_corner_data.empty()) {
- FilePath path = GetResourcesFilePath();
+ base::FilePath path = GetResourcesFilePath();
path = path.AppendASCII("textAreaResizeCorner.png");
bool success = file_util::ReadFileToString(path, &resize_corner_data);
if (!success) {
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index e946255..1fb12e0 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -823,7 +823,7 @@ void TestWebViewDelegate::openFileSystem(
// WebPluginPageDelegate -----------------------------------------------------
WebKit::WebPlugin* TestWebViewDelegate::CreatePluginReplacement(
- const FilePath& file_path) {
+ const base::FilePath& file_path) {
return NULL;
}
diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h
index be1464d..e882017 100644
--- a/webkit/tools/test_shell/test_webview_delegate.h
+++ b/webkit/tools/test_shell/test_webview_delegate.h
@@ -236,10 +236,10 @@ class TestWebViewDelegate : public WebKit::WebViewClient,
// webkit::npapi::WebPluginPageDelegate
virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate(
- const FilePath& url,
+ const base::FilePath& url,
const std::string& mime_type) OVERRIDE;
virtual WebKit::WebPlugin* CreatePluginReplacement(
- const FilePath& file_path) OVERRIDE;
+ const base::FilePath& file_path) OVERRIDE;
virtual void CreatedPluginWindow(
gfx::PluginWindowHandle handle) OVERRIDE;
virtual void WillDestroyPluginWindow(
diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
index 8141b1c..ec72930 100644
--- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc
+++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
@@ -198,7 +198,7 @@ void TestWebViewDelegate::runModal() {
// WebPluginPageDelegate ------------------------------------------------------
webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
- const FilePath& path,
+ const base::FilePath& path,
const std::string& mime_type) {
return webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type);
}
diff --git a/webkit/tools/test_shell/test_webview_delegate_mac.mm b/webkit/tools/test_shell/test_webview_delegate_mac.mm
index 197ad97..42f5a64 100644
--- a/webkit/tools/test_shell/test_webview_delegate_mac.mm
+++ b/webkit/tools/test_shell/test_webview_delegate_mac.mm
@@ -227,7 +227,7 @@ void TestWebViewDelegate::runModal() {
// WebPluginPageDelegate ------------------------------------------------------
webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
- const FilePath& path,
+ const base::FilePath& path,
const std::string& mime_type) {
WebWidgetHost *host = GetWidgetHost();
if (!host)
diff --git a/webkit/tools/test_shell/test_webview_delegate_win.cc b/webkit/tools/test_shell/test_webview_delegate_win.cc
index f9ea1a7..c811f0e 100644
--- a/webkit/tools/test_shell/test_webview_delegate_win.cc
+++ b/webkit/tools/test_shell/test_webview_delegate_win.cc
@@ -133,7 +133,7 @@ void TestWebViewDelegate::runModal() {
// WebPluginPageDelegate ------------------------------------------------------
webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
- const FilePath& path,
+ const base::FilePath& path,
const std::string& mime_type) {
HWND hwnd = shell_->webViewHost()->view_handle();
if (!hwnd)
diff --git a/webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp b/webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp
index f4cdd3d..0c905ca 100644
--- a/webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp
+++ b/webkit/tools/webcore_unit_tests/ICOImageDecoder_unittest.cpp
@@ -26,8 +26,8 @@ TEST_F(ICOImageDecoderTest, Decoding) {
TEST_F(ICOImageDecoderTest, ImageNonZeroFrameIndex) {
// Test that the decoder decodes multiple sizes of icons which have them.
// Load an icon that has both favicon-size and larger entries.
- FilePath multisize_icon_path(data_dir_.AppendASCII("yahoo.ico"));
- const FilePath md5_sum_path(
+ base::FilePath multisize_icon_path(data_dir_.AppendASCII("yahoo.ico"));
+ const base::FilePath md5_sum_path(
GetMD5SumPath(multisize_icon_path).value() + FILE_PATH_LITERAL("2"));
static const int kDesiredFrameIndex = 3;
TestWebKitImageDecoder(multisize_icon_path, md5_sum_path, kDesiredFrameIndex);