| Index: chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
|
| diff --git a/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc b/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
|
| index caa1990f1e05deaff53200440305f0131a9fd7b3..4c6b8fd14e7f379a79eff0ca23d4c76dab5e7c17 100644
|
| --- a/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
|
| +++ b/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
|
| @@ -4,8 +4,10 @@
|
|
|
| #include "chrome/browser/chromeos/drive/sync/remove_performer.h"
|
|
|
| +#include "base/task_runner_util.h"
|
| #include "chrome/browser/chromeos/drive/file_system/operation_test_base.h"
|
| #include "chrome/browser/chromeos/drive/file_system_interface.h"
|
| +#include "chrome/browser/chromeos/drive/file_system_util.h"
|
| #include "chrome/browser/drive/fake_drive_service.h"
|
| #include "google_apis/drive/gdata_wapi_parser.h"
|
| #include "google_apis/drive/test_util.h"
|
| @@ -114,5 +116,35 @@ TEST_F(RemovePerformerTest, RemoveShared) {
|
| EXPECT_FALSE(gdata_entry->GetLinkByType(google_apis::Link::LINK_PARENT));
|
| }
|
|
|
| +TEST_F(RemovePerformerTest, RemoveLocallyCreatedFile) {
|
| + RemovePerformer performer(blocking_task_runner(), observer(), scheduler(),
|
| + metadata());
|
| +
|
| + // Add an entry without resource ID.
|
| + ResourceEntry entry;
|
| + entry.set_title("New File.txt");
|
| + entry.set_parent_local_id(util::kDriveTrashDirLocalId);
|
| +
|
| + FileError error = FILE_ERROR_FAILED;
|
| + std::string local_id;
|
| + base::PostTaskAndReplyWithResult(
|
| + blocking_task_runner(),
|
| + FROM_HERE,
|
| + base::Bind(&ResourceMetadata::AddEntry,
|
| + base::Unretained(metadata()),
|
| + entry,
|
| + &local_id),
|
| + google_apis::test_util::CreateCopyResultCallback(&error));
|
| + test_util::RunBlockingPoolTask();
|
| + EXPECT_EQ(FILE_ERROR_OK, error);
|
| +
|
| + // Remove the entry.
|
| + performer.Remove(local_id, ClientContext(USER_INITIATED),
|
| + google_apis::test_util::CreateCopyResultCallback(&error));
|
| + test_util::RunBlockingPoolTask();
|
| + EXPECT_EQ(FILE_ERROR_OK, error);
|
| + EXPECT_EQ(FILE_ERROR_NOT_FOUND, GetLocalResourceEntryById(local_id, &entry));
|
| +}
|
| +
|
| } // namespace internal
|
| } // namespace drive
|
|
|