| Index: chrome/browser/chromeos/drive/drive_file_system_unittest.cc
|
| diff --git a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
|
| index b9a5e01514d2a405890e20b2ec5d2eb1dbb7fc7e..8c2cc24e99a8de57321922370c740a4b13e45477 100644
|
| --- a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
|
| +++ b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
|
| @@ -46,7 +46,7 @@ using ::testing::Return;
|
| using ::testing::StrictMock;
|
| using ::testing::_;
|
|
|
| -namespace gdata {
|
| +namespace drive {
|
| namespace {
|
|
|
| const char kSymLinkToDevNull[] = "/dev/null";
|
| @@ -91,7 +91,7 @@ ACTION_P2(MockGetDocumentEntry, status, value) {
|
| // DriveUploaderInterface::UploadExistingFile().
|
| ACTION_P4(MockUploadExistingFile,
|
| error, drive_path, local_file_path, document_entry) {
|
| - scoped_ptr<DocumentEntry> scoped_document_entry(document_entry);
|
| + scoped_ptr<gdata::DocumentEntry> scoped_document_entry(document_entry);
|
| base::MessageLoopProxy::current()->PostTask(FROM_HERE,
|
| base::Bind(arg5,
|
| error,
|
| @@ -107,9 +107,9 @@ ACTION_P4(MockUploadExistingFile,
|
| // DriveUploaderInterface::UploadNewFile().
|
| ACTION(MockUploadNewFile) {
|
| scoped_ptr<base::Value> value =
|
| - test_util::LoadJSONFile("gdata/uploaded_file.json");
|
| - scoped_ptr<DocumentEntry> document_entry(
|
| - DocumentEntry::ExtractAndParse(*value));
|
| + gdata::test_util::LoadJSONFile("gdata/uploaded_file.json");
|
| + scoped_ptr<gdata::DocumentEntry> document_entry(
|
| + gdata::DocumentEntry::ExtractAndParse(*value));
|
|
|
| base::MessageLoopProxy::current()->PostTask(FROM_HERE,
|
| base::Bind(arg7,
|
| @@ -204,7 +204,7 @@ class DriveFileSystemTest : public testing::Test {
|
|
|
| file_system_->Initialize();
|
| cache_->RequestInitializeOnUIThreadForTesting();
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| virtual void TearDown() OVERRIDE {
|
| @@ -217,7 +217,7 @@ class DriveFileSystemTest : public testing::Test {
|
| SetFreeDiskSpaceGetterForTesting(NULL);
|
| cache_->DestroyOnUIThread();
|
| // The cache destruction requires to post a task to the blocking pool.
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| profile_.reset(NULL);
|
| }
|
| @@ -238,7 +238,7 @@ class DriveFileSystemTest : public testing::Test {
|
|
|
| void AddDirectoryFromFile(const FilePath& directory_path,
|
| const std::string& filename) {
|
| - scoped_ptr<Value> atom = test_util::LoadJSONFile(filename);
|
| + scoped_ptr<Value> atom = gdata::test_util::LoadJSONFile(filename);
|
| ASSERT_TRUE(atom.get());
|
| ASSERT_TRUE(atom->GetType() == Value::TYPE_DICTIONARY);
|
|
|
| @@ -262,8 +262,8 @@ class DriveFileSystemTest : public testing::Test {
|
| false, // is_exclusive
|
| false, // is_recursive
|
| base::Bind(&test_util::CopyErrorCodeFromFileOperationCallback, &error));
|
| - file_system_->AddNewDirectory(params, HTTP_SUCCESS, atom.Pass());
|
| - test_util::RunBlockingPoolTask();
|
| + file_system_->AddNewDirectory(params, gdata::HTTP_SUCCESS, atom.Pass());
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_OK, error);
|
| }
|
|
|
| @@ -274,7 +274,7 @@ class DriveFileSystemTest : public testing::Test {
|
| file_path, false,
|
| base::Bind(&test_util::CopyErrorCodeFromFileOperationCallback, &error));
|
|
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| return error == DRIVE_FILE_OK;
|
| }
|
|
|
| @@ -293,7 +293,7 @@ class DriveFileSystemTest : public testing::Test {
|
| file_path,
|
| base::Bind(&CallbackHelper::GetEntryInfoCallback,
|
| callback_helper_.get()));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| return callback_helper_->entry_proto_.Pass();
|
| }
|
| @@ -305,7 +305,7 @@ class DriveFileSystemTest : public testing::Test {
|
| file_path,
|
| base::Bind(&CallbackHelper::ReadDirectoryCallback,
|
| callback_helper_.get()));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| return callback_helper_->directory_entries_.Pass();
|
| }
|
| @@ -339,7 +339,7 @@ class DriveFileSystemTest : public testing::Test {
|
| md5,
|
| cache_entry,
|
| &result));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| return result;
|
| }
|
|
|
| @@ -387,7 +387,7 @@ class DriveFileSystemTest : public testing::Test {
|
| base::Bind(&DriveFileSystemTest::VerifyCacheFileState,
|
| base::Unretained(this)));
|
|
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| void TestPin(
|
| @@ -405,7 +405,7 @@ class DriveFileSystemTest : public testing::Test {
|
| base::Bind(&DriveFileSystemTest::VerifyCacheFileState,
|
| base::Unretained(this)));
|
|
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| void TestMarkDirty(
|
| @@ -427,7 +427,7 @@ class DriveFileSystemTest : public testing::Test {
|
| resource_id,
|
| md5));
|
|
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| void VerifyMarkDirty(const std::string& resource_id,
|
| @@ -464,7 +464,7 @@ class DriveFileSystemTest : public testing::Test {
|
| base::Bind(&DriveFileSystemTest::VerifyCacheFileState,
|
| base::Unretained(this)));
|
|
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| // Verify the file identified by |resource_id| and |md5| is in the expected
|
| @@ -589,7 +589,7 @@ class DriveFileSystemTest : public testing::Test {
|
| // filesystem has a root at 'drive'
|
| void TestLoadMetadataFromCache() {
|
| file_system_->LoadRootFeedFromCacheForTesting();
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| // Creates a proto file representing a filesystem with directories:
|
| @@ -1175,7 +1175,7 @@ TEST_F(DriveFileSystemTest, CachedFeadLoadingThenServerFeedLoading) {
|
| // SaveTestFileSystem and "account_metadata.json" have the same changestamp,
|
| // so no request for new feeds (i.e., call to GetDocuments) should happen.
|
| mock_drive_service_->set_account_metadata(
|
| - test_util::LoadJSONFile("gdata/account_metadata.json").release());
|
| + gdata::test_util::LoadJSONFile("gdata/account_metadata.json").release());
|
| EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
|
| EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
|
| EXPECT_CALL(*mock_drive_service_, GetDocuments(_, _, _, _, _)).Times(0);
|
| @@ -1187,12 +1187,12 @@ TEST_F(DriveFileSystemTest, CachedFeadLoadingThenServerFeedLoading) {
|
| // it should change its state to FROM_SERVER, which admits periodic refresh.
|
| // To test it, call CheckForUpdates and verify it does try to check updates.
|
| mock_drive_service_->set_account_metadata(
|
| - test_util::LoadJSONFile("gdata/account_metadata.json").release());
|
| + gdata::test_util::LoadJSONFile("gdata/account_metadata.json").release());
|
| EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_)).Times(1);
|
| EXPECT_CALL(*mock_webapps_registry_, UpdateFromFeed(_)).Times(1);
|
|
|
| file_system_->CheckForUpdates();
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| TEST_F(DriveFileSystemTest, TransferFileFromLocalToRemote_RegularFile) {
|
| @@ -1221,9 +1221,9 @@ TEST_F(DriveFileSystemTest, TransferFileFromLocalToRemote_RegularFile) {
|
| EXPECT_FALSE(EntryExists(remote_dest_file_path));
|
|
|
| scoped_ptr<base::Value> value =
|
| - test_util::LoadJSONFile("gdata/document_to_download.json");
|
| - scoped_ptr<DocumentEntry> document_entry(
|
| - DocumentEntry::ExtractAndParse(*value));
|
| + gdata::test_util::LoadJSONFile("gdata/document_to_download.json");
|
| + scoped_ptr<gdata::DocumentEntry> document_entry(
|
| + gdata::DocumentEntry::ExtractAndParse(*value));
|
|
|
| EXPECT_CALL(*mock_uploader_, UploadNewFile(_, _, _, _, _, _, _, _, _))
|
| .WillOnce(MockUploadNewFile());
|
| @@ -1231,7 +1231,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromLocalToRemote_RegularFile) {
|
| // Transfer the local file to Drive.
|
| file_system_->TransferFileFromLocalToRemote(
|
| local_src_file_path, remote_dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
|
|
| @@ -1267,7 +1267,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromLocalToRemote_HostedDocument) {
|
| // We'll copy a hosted document using CopyDocument.
|
| // ".gdoc" suffix should be stripped when copying.
|
| scoped_ptr<base::Value> document =
|
| - test_util::LoadJSONFile("gdata/uploaded_document.json");
|
| + gdata::test_util::LoadJSONFile("gdata/uploaded_document.json");
|
| EXPECT_CALL(*mock_drive_service_,
|
| CopyDocument(kResourceId,
|
| FILE_PATH_LITERAL("Document 1"),
|
| @@ -1284,7 +1284,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromLocalToRemote_HostedDocument) {
|
| // Transfer the local file to Drive.
|
| file_system_->TransferFileFromLocalToRemote(
|
| local_src_file_path, remote_dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
|
|
| @@ -1321,7 +1321,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromRemoteToLocal_RegularFile) {
|
| // Before Download starts metadata from server will be fetched.
|
| // We will read content url from the result.
|
| scoped_ptr<base::Value> document =
|
| - test_util::LoadJSONFile("gdata/document_to_download.json");
|
| + gdata::test_util::LoadJSONFile("gdata/document_to_download.json");
|
| SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
|
|
|
| // The file is obtained with the mock DriveService.
|
| @@ -1334,7 +1334,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromRemoteToLocal_RegularFile) {
|
|
|
| file_system_->TransferFileFromRemoteToLocal(
|
| remote_src_file_path, local_dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
|
|
| @@ -1361,7 +1361,7 @@ TEST_F(DriveFileSystemTest, TransferFileFromRemoteToLocal_HostedDocument) {
|
| FilePath remote_src_file_path(FILE_PATH_LITERAL("drive/Document 1.gdoc"));
|
| file_system_->TransferFileFromRemoteToLocal(
|
| remote_src_file_path, local_dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
|
|
| @@ -1384,7 +1384,7 @@ TEST_F(DriveFileSystemTest, CopyNotExistingFile) {
|
| callback_helper_.get());
|
|
|
| file_system_->Copy(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_);
|
|
|
| EXPECT_FALSE(EntryExists(src_file_path));
|
| @@ -1413,7 +1413,7 @@ TEST_F(DriveFileSystemTest, CopyFileToNonExistingDirectory) {
|
| callback_helper_.get());
|
|
|
| file_system_->Move(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_);
|
|
|
| EXPECT_TRUE(EntryExists(src_file_path));
|
| @@ -1449,7 +1449,7 @@ TEST_F(DriveFileSystemTest, CopyFileToInvalidPath) {
|
| callback_helper_.get());
|
|
|
| file_system_->Copy(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NOT_A_DIRECTORY,
|
| callback_helper_->last_error_);
|
|
|
| @@ -1488,7 +1488,7 @@ TEST_F(DriveFileSystemTest, RenameFile) {
|
| Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1);
|
|
|
| file_system_->Move(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
|
|
| EXPECT_FALSE(EntryExists(src_file_path));
|
| @@ -1537,7 +1537,7 @@ TEST_F(DriveFileSystemTest, MoveFileFromRootToSubDirectory) {
|
| Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1);
|
|
|
| file_system_->Move(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
|
|
| EXPECT_FALSE(EntryExists(src_file_path));
|
| @@ -1588,7 +1588,7 @@ TEST_F(DriveFileSystemTest, MoveFileFromSubDirectoryToRoot) {
|
| Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1);
|
|
|
| file_system_->Move(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
|
|
| EXPECT_FALSE(EntryExists(src_file_path));
|
| @@ -1663,7 +1663,7 @@ TEST_F(DriveFileSystemTest, MoveFileBetweenSubDirectories) {
|
| Eq(FilePath(FILE_PATH_LITERAL("drive/New Folder 1"))))).Times(1);
|
|
|
| file_system_->Move(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
|
|
| EXPECT_FALSE(EntryExists(src_file_path));
|
| @@ -1687,7 +1687,7 @@ TEST_F(DriveFileSystemTest, MoveNotExistingFile) {
|
| callback_helper_.get());
|
|
|
| file_system_->Move(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_);
|
|
|
| EXPECT_FALSE(EntryExists(src_file_path));
|
| @@ -1716,7 +1716,7 @@ TEST_F(DriveFileSystemTest, MoveFileToNonExistingDirectory) {
|
| callback_helper_.get());
|
|
|
| file_system_->Move(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_);
|
|
|
|
|
| @@ -1752,7 +1752,7 @@ TEST_F(DriveFileSystemTest, MoveFileToInvalidPath) {
|
| callback_helper_.get());
|
|
|
| file_system_->Move(src_file_path, dest_file_path, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NOT_A_DIRECTORY,
|
| callback_helper_->last_error_);
|
|
|
| @@ -1812,7 +1812,7 @@ TEST_F(DriveFileSystemTest, RemoveEntries) {
|
| EXPECT_FALSE(RemoveEntry(FilePath(FILE_PATH_LITERAL("drive"))));
|
|
|
| // Need this to ensure OnDirectoryChanged() is run.
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| TEST_F(DriveFileSystemTest, CreateDirectory) {
|
| @@ -1848,7 +1848,7 @@ TEST_F(DriveFileSystemTest, FindFirstMissingParentDirectory) {
|
| dir_path,
|
| base::Bind(&CopyResultFromFindFirstMissingParentDirectory,
|
| &result));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DriveFileSystem::FIND_FIRST_FOUND_MISSING, result.error);
|
| EXPECT_EQ(FilePath(FILE_PATH_LITERAL("drive/New Folder 1")),
|
| result.first_missing_parent_path);
|
| @@ -1860,7 +1860,7 @@ TEST_F(DriveFileSystemTest, FindFirstMissingParentDirectory) {
|
| dir_path2,
|
| base::Bind(&CopyResultFromFindFirstMissingParentDirectory,
|
| &result));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DriveFileSystem::FIND_FIRST_FOUND_MISSING, result.error);
|
| EXPECT_EQ(FilePath(FILE_PATH_LITERAL("drive/Directory 1/New Folder 2")),
|
| result.first_missing_parent_path);
|
| @@ -1872,7 +1872,7 @@ TEST_F(DriveFileSystemTest, FindFirstMissingParentDirectory) {
|
| dir_path3,
|
| base::Bind(&CopyResultFromFindFirstMissingParentDirectory,
|
| &result));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DriveFileSystem::FIND_FIRST_FOUND_MISSING, result.error);
|
| EXPECT_EQ(FilePath(FILE_PATH_LITERAL("drive/Directory 1/New Folder 2")),
|
| result.first_missing_parent_path);
|
| @@ -1883,7 +1883,7 @@ TEST_F(DriveFileSystemTest, FindFirstMissingParentDirectory) {
|
| FilePath(FILE_PATH_LITERAL("drive/File 1.txt/BadDir")),
|
| base::Bind(&CopyResultFromFindFirstMissingParentDirectory,
|
| &result));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DriveFileSystem::FIND_FIRST_FOUND_INVALID, result.error);
|
|
|
| // Existing folder.
|
| @@ -1891,7 +1891,7 @@ TEST_F(DriveFileSystemTest, FindFirstMissingParentDirectory) {
|
| FilePath(FILE_PATH_LITERAL("drive/Directory 1")),
|
| base::Bind(&CopyResultFromFindFirstMissingParentDirectory,
|
| &result));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DriveFileSystem::FIND_FIRST_DIRECTORY_ALREADY_PRESENT,
|
| result.error);
|
| }
|
| @@ -1912,7 +1912,7 @@ TEST_F(DriveFileSystemTest, CreateDirectoryWithService) {
|
| true, // is_recursive
|
| base::Bind(&CallbackHelper::FileOperationCallback,
|
| callback_helper_.get()));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| // TODO(gspencer): Uncomment this when we get a blob that
|
| // works that can be returned from the mock.
|
| // EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
| @@ -1939,7 +1939,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_EnoughSpace) {
|
| // Before Download starts metadata from server will be fetched.
|
| // We will read content url from the result.
|
| scoped_ptr<base::Value> document =
|
| - test_util::LoadJSONFile("gdata/document_to_download.json");
|
| + gdata::test_util::LoadJSONFile("gdata/document_to_download.json");
|
| SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
|
|
|
| // The file is obtained with the mock DriveService.
|
| @@ -1951,8 +1951,8 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_EnoughSpace) {
|
| .Times(1);
|
|
|
| file_system_->GetFileByPath(file_in_root, callback,
|
| - GetContentCallback());
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::GetContentCallback());
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
| EXPECT_EQ(REGULAR_FILE, callback_helper_->file_type_);
|
| @@ -1980,7 +1980,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_NoSpaceAtAll) {
|
| // Before Download starts metadata from server will be fetched.
|
| // We will read content url from the result.
|
| scoped_ptr<base::Value> document =
|
| - test_util::LoadJSONFile("gdata/document_to_download.json");
|
| + gdata::test_util::LoadJSONFile("gdata/document_to_download.json");
|
| SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
|
|
|
| // The file is not obtained with the mock DriveService, because of no space.
|
| @@ -1992,8 +1992,8 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_NoSpaceAtAll) {
|
| .Times(0);
|
|
|
| file_system_->GetFileByPath(file_in_root, callback,
|
| - GetContentCallback());
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::GetContentCallback());
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NO_SPACE,
|
| callback_helper_->last_error_);
|
| @@ -2025,7 +2025,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_NoEnoughSpaceButCanFreeUp) {
|
| // Store something in the temporary cache directory.
|
| TestStoreToCache("<resource_id>",
|
| "<md5>",
|
| - test_util::GetTestFilePath("gdata/root_feed.json"),
|
| + gdata::test_util::GetTestFilePath("gdata/root_feed.json"),
|
| DRIVE_FILE_OK,
|
| test_util::TEST_CACHE_STATE_PRESENT,
|
| DriveCache::CACHE_TYPE_TMP);
|
| @@ -2035,7 +2035,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_NoEnoughSpaceButCanFreeUp) {
|
| // Before Download starts metadata from server will be fetched.
|
| // We will read content url from the result.
|
| scoped_ptr<base::Value> document =
|
| - test_util::LoadJSONFile("gdata/document_to_download.json");
|
| + gdata::test_util::LoadJSONFile("gdata/document_to_download.json");
|
| SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
|
|
|
| // The file is obtained with the mock DriveService, because of we freed up the
|
| @@ -2048,8 +2048,8 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_NoEnoughSpaceButCanFreeUp) {
|
| .Times(1);
|
|
|
| file_system_->GetFileByPath(file_in_root, callback,
|
| - GetContentCallback());
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::GetContentCallback());
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
| EXPECT_EQ(REGULAR_FILE, callback_helper_->file_type_);
|
| @@ -2088,7 +2088,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_EnoughSpaceButBecomeFull) {
|
| // Before Download starts metadata from server will be fetched.
|
| // We will read content url from the result.
|
| scoped_ptr<base::Value> document =
|
| - test_util::LoadJSONFile("gdata/document_to_download.json");
|
| + gdata::test_util::LoadJSONFile("gdata/document_to_download.json");
|
| SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
|
|
|
| // The file is obtained with the mock DriveService.
|
| @@ -2100,8 +2100,8 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromGData_EnoughSpaceButBecomeFull) {
|
| .Times(1);
|
|
|
| file_system_->GetFileByPath(file_in_root, callback,
|
| - GetContentCallback());
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::GetContentCallback());
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NO_SPACE,
|
| callback_helper_->last_error_);
|
| @@ -2126,7 +2126,7 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromCache) {
|
| // Store something as cached version of this file.
|
| TestStoreToCache(entry_proto->resource_id(),
|
| entry_proto->file_specific_info().file_md5(),
|
| - test_util::GetTestFilePath("gdata/root_feed.json"),
|
| + gdata::test_util::GetTestFilePath("gdata/root_feed.json"),
|
| DRIVE_FILE_OK,
|
| test_util::TEST_CACHE_STATE_PRESENT,
|
| DriveCache::CACHE_TYPE_TMP);
|
| @@ -2143,8 +2143,8 @@ TEST_F(DriveFileSystemTest, GetFileByPath_FromCache) {
|
| .Times(0);
|
|
|
| file_system_->GetFileByPath(file_in_root, callback,
|
| - GetContentCallback());
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::GetContentCallback());
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(REGULAR_FILE, callback_helper_->file_type_);
|
| EXPECT_EQ(downloaded_file.value(),
|
| @@ -2164,8 +2164,8 @@ TEST_F(DriveFileSystemTest, GetFileByPath_HostedDocument) {
|
| ASSERT_TRUE(src_entry_proto.get());
|
|
|
| file_system_->GetFileByPath(file_in_root, callback,
|
| - GetContentCallback());
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::GetContentCallback());
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(HOSTED_DOCUMENT, callback_helper_->file_type_);
|
| EXPECT_FALSE(callback_helper_->download_path_.empty());
|
| @@ -2194,7 +2194,7 @@ TEST_F(DriveFileSystemTest, GetFileByResourceId) {
|
| // Before Download starts metadata from server will be fetched.
|
| // We will read content url from the result.
|
| scoped_ptr<base::Value> document =
|
| - test_util::LoadJSONFile("gdata/document_to_download.json");
|
| + gdata::test_util::LoadJSONFile("gdata/document_to_download.json");
|
| SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
|
|
|
| // The file is obtained with the mock DriveService, because it's not stored in
|
| @@ -2208,8 +2208,8 @@ TEST_F(DriveFileSystemTest, GetFileByResourceId) {
|
|
|
| file_system_->GetFileByResourceId(entry_proto->resource_id(),
|
| callback,
|
| - GetContentCallback());
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::GetContentCallback());
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(REGULAR_FILE, callback_helper_->file_type_);
|
| EXPECT_EQ(downloaded_file.value(),
|
| @@ -2235,7 +2235,7 @@ TEST_F(DriveFileSystemTest, GetFileByResourceId_FromCache) {
|
| // Store something as cached version of this file.
|
| TestStoreToCache(entry_proto->resource_id(),
|
| entry_proto->file_specific_info().file_md5(),
|
| - test_util::GetTestFilePath("gdata/root_feed.json"),
|
| + gdata::test_util::GetTestFilePath("gdata/root_feed.json"),
|
| DRIVE_FILE_OK,
|
| test_util::TEST_CACHE_STATE_PRESENT,
|
| DriveCache::CACHE_TYPE_TMP);
|
| @@ -2247,8 +2247,8 @@ TEST_F(DriveFileSystemTest, GetFileByResourceId_FromCache) {
|
|
|
| file_system_->GetFileByResourceId(entry_proto->resource_id(),
|
| callback,
|
| - GetContentCallback());
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::GetContentCallback());
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(REGULAR_FILE, callback_helper_->file_type_);
|
| EXPECT_EQ(downloaded_file.value(),
|
| @@ -2283,7 +2283,7 @@ TEST_F(DriveFileSystemTest, UpdateFileByResourceId_PersistentFile) {
|
| TestStoreToCache(kResourceId,
|
| kMd5,
|
| // Anything works.
|
| - test_util::GetTestFilePath("gdata/root_feed.json"),
|
| + gdata::test_util::GetTestFilePath("gdata/root_feed.json"),
|
| DRIVE_FILE_OK,
|
| test_util::TEST_CACHE_STATE_PRESENT |
|
| test_util::TEST_CACHE_STATE_PINNED |
|
| @@ -2333,12 +2333,12 @@ TEST_F(DriveFileSystemTest, UpdateFileByResourceId_PersistentFile) {
|
| ASSERT_TRUE(file_util::PathExists(dirty_cache_file_path));
|
| ASSERT_TRUE(file_util::PathExists(outgoing_symlink_path));
|
|
|
| - // Create a DocumentEntry, which is needed to mock
|
| + // Create a gdata::DocumentEntry, which is needed to mock
|
| // DriveUploaderInterface::UploadExistingFile().
|
| // TODO(satorux): This should be cleaned up. crbug.com/134240.
|
| - DocumentEntry* document_entry = NULL;
|
| + gdata::DocumentEntry* document_entry = NULL;
|
| scoped_ptr<base::Value> value =
|
| - test_util::LoadJSONFile("gdata/root_feed.json");
|
| + gdata::test_util::LoadJSONFile("gdata/root_feed.json");
|
| ASSERT_TRUE(value.get());
|
| base::DictionaryValue* as_dict = NULL;
|
| base::ListValue* entry_list = NULL;
|
| @@ -2351,7 +2351,7 @@ TEST_F(DriveFileSystemTest, UpdateFileByResourceId_PersistentFile) {
|
| entry->GetString("gd$resourceId.$t", &resource_id) &&
|
| resource_id == kResourceId) {
|
| // This will be deleted by UploadExistingFile().
|
| - document_entry = DocumentEntry::CreateFrom(*entry);
|
| + document_entry = gdata::DocumentEntry::CreateFrom(*entry);
|
| }
|
| }
|
| }
|
| @@ -2390,7 +2390,7 @@ TEST_F(DriveFileSystemTest, UpdateFileByResourceId_PersistentFile) {
|
| const int num_files_in_root = CountFiles(*root_directory_entries);
|
|
|
| file_system_->UpdateFileByResourceId(kResourceId, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
|
|
| EXPECT_EQ(DRIVE_FILE_OK, callback_helper_->last_error_);
|
| // Make sure that the number of files did not change (i.e. we updated an
|
| @@ -2417,7 +2417,7 @@ TEST_F(DriveFileSystemTest, UpdateFileByResourceId_NonexistentFile) {
|
| callback_helper_.get());
|
|
|
| file_system_->UpdateFileByResourceId(kResourceId, callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_);
|
| }
|
|
|
| @@ -2499,7 +2499,7 @@ TEST_F(DriveFileSystemTest, GetAvailableSpace) {
|
| EXPECT_CALL(*mock_drive_service_, GetAccountMetadata(_));
|
|
|
| file_system_->GetAvailableSpace(callback);
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| EXPECT_EQ(GG_LONGLONG(6789012345), callback_helper_->quota_bytes_used_);
|
| EXPECT_EQ(GG_LONGLONG(9876543210), callback_helper_->quota_bytes_total_);
|
| }
|
| @@ -2516,7 +2516,7 @@ TEST_F(DriveFileSystemTest, RequestDirectoryRefresh) {
|
| OnDirectoryChanged(Eq(FilePath(kDriveRootDirectory)))).Times(1);
|
|
|
| file_system_->RequestDirectoryRefresh(FilePath(kDriveRootDirectory));
|
| - test_util::RunBlockingPoolTask();
|
| + gdata::test_util::RunBlockingPoolTask();
|
| }
|
|
|
| TEST_F(DriveFileSystemTest, OpenAndCloseFile) {
|
| @@ -2553,7 +2553,7 @@ TEST_F(DriveFileSystemTest, OpenAndCloseFile) {
|
| // Before Download starts metadata from server will be fetched.
|
| // We will read content url from the result.
|
| scoped_ptr<base::Value> document =
|
| - test_util::LoadJSONFile("gdata/document_to_download.json");
|
| + gdata::test_util::LoadJSONFile("gdata/document_to_download.json");
|
| SetExpectationsForGetDocumentEntry(&document, "file:2_file_resource_id");
|
|
|
| // The file is obtained with the mock DriveService.
|
| @@ -2610,4 +2610,4 @@ TEST_F(DriveFileSystemTest, OpenAndCloseFile) {
|
| EXPECT_EQ(DRIVE_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_);
|
| }
|
|
|
| -} // namespace gdata
|
| +} // namespace drive
|
|
|