#include <string>
#include <vector>
-#include "base/file_util.h"
#include "base/files/file_enumerator.h"
+#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "content/public/test/async_file_test_helper.h"
#include "content/public/test/test_file_system_context.h"
#include "content/test/fileapi_test_file_set.h"
+#include "storage/browser/fileapi/dragged_file_util.h"
+#include "storage/browser/fileapi/file_system_context.h"
+#include "storage/browser/fileapi/file_system_operation_context.h"
+#include "storage/browser/fileapi/isolated_context.h"
+#include "storage/browser/fileapi/local_file_util.h"
+#include "storage/browser/fileapi/native_file_util.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/browser/fileapi/dragged_file_util.h"
-#include "webkit/browser/fileapi/file_system_context.h"
-#include "webkit/browser/fileapi/file_system_operation_context.h"
-#include "webkit/browser/fileapi/isolated_context.h"
-#include "webkit/browser/fileapi/local_file_util.h"
-#include "webkit/browser/fileapi/native_file_util.h"
using content::AsyncFileTestHelper;
-using fileapi::FileSystemContext;
-using fileapi::FileSystemOperationContext;
-using fileapi::FileSystemType;
-using fileapi::FileSystemURL;
+using storage::FileSystemContext;
+using storage::FileSystemOperationContext;
+using storage::FileSystemType;
+using storage::FileSystemURL;
namespace content {
virtual void SetUp() {
ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
ASSERT_TRUE(partition_dir_.CreateUniqueTempDir());
- file_util_.reset(new fileapi::DraggedFileUtil());
+ file_util_.reset(new storage::DraggedFileUtil());
// Register the files/directories of RegularTestCases (with random
// root paths) as dropped files.
}
protected:
- fileapi::IsolatedContext* isolated_context() const {
- return fileapi::IsolatedContext::GetInstance();
+ storage::IsolatedContext* isolated_context() const {
+ return storage::IsolatedContext::GetInstance();
}
const base::FilePath& root_path() const {
return data_dir_.path();
FileSystemContext* file_system_context() const {
return file_system_context_.get();
}
- fileapi::FileSystemFileUtil* file_util() const { return file_util_.get(); }
+ storage::FileSystemFileUtil* file_util() const { return file_util_.get(); }
std::string filesystem_id() const { return filesystem_id_; }
base::FilePath GetTestCasePlatformPath(
filesystem_id()).Append(path);
return file_system_context_->CreateCrackedFileSystemURL(
GURL("http://example.com"),
- fileapi::kFileSystemTypeIsolated,
+ storage::kFileSystemTypeIsolated,
virtual_path);
}
FileSystemURL GetOtherFileSystemURL(const base::FilePath& path) const {
return file_system_context()->CreateCrackedFileSystemURL(
GURL("http://example.com"),
- fileapi::kFileSystemTypeTemporary,
+ storage::kFileSystemTypeTemporary,
base::FilePath().AppendASCII("dest").Append(path));
}
}
}
- scoped_ptr<fileapi::FileSystemOperationContext> GetOperationContext() {
- return make_scoped_ptr(
- new fileapi::FileSystemOperationContext(file_system_context())).Pass();
+ scoped_ptr<storage::FileSystemOperationContext> GetOperationContext() {
+ return make_scoped_ptr(new storage::FileSystemOperationContext(
+ file_system_context())).Pass();
}
void SimulateDropFiles() {
size_t root_path_index = 0;
- fileapi::IsolatedContext::FileInfoSet toplevels;
+ storage::IsolatedContext::FileInfoSet toplevels;
for (size_t i = 0; i < kRegularFileSystemTestCaseSize; ++i) {
const FileSystemTestCaseRecord& test_case =
kRegularFileSystemTestCases[i];
std::string filesystem_id_;
scoped_refptr<FileSystemContext> file_system_context_;
std::map<base::FilePath, base::FilePath> toplevel_root_map_;
- scoped_ptr<fileapi::DraggedFileUtil> file_util_;
+ scoped_ptr<storage::DraggedFileUtil> file_util_;
DISALLOW_COPY_AND_ASSIGN(DraggedFileUtilTest);
};
<< ": " << test_case.path);
// Read entries in the directory to construct the expected results map.
- typedef std::map<base::FilePath::StringType, fileapi::DirectoryEntry>
+ typedef std::map<base::FilePath::StringType, storage::DirectoryEntry>
EntryMap;
EntryMap expected_entry_map;
base::FilePath current;
while (!(current = file_enum.Next()).empty()) {
base::FileEnumerator::FileInfo file_info = file_enum.GetInfo();
- fileapi::DirectoryEntry entry;
+ storage::DirectoryEntry entry;
entry.is_directory = file_info.IsDirectory();
entry.name = current.BaseName().value();
entry.size = file_info.GetSize();
EXPECT_EQ(expected_entry_map.size(), entries.size());
for (size_t i = 0; i < entries.size(); ++i) {
- const fileapi::DirectoryEntry& entry = entries[i];
+ const storage::DirectoryEntry& entry = entries[i];
EntryMap::iterator found = expected_entry_map.find(entry.name);
EXPECT_TRUE(found != expected_entry_map.end());
EXPECT_EQ(found->second.name, entry.name);