Chromium Code Reviews| Index: chrome/browser/chromeos/file_system_provider/operations/move_entry_unittest.cc |
| diff --git a/chrome/browser/chromeos/file_system_provider/operations/copy_entry_unittest.cc b/chrome/browser/chromeos/file_system_provider/operations/move_entry_unittest.cc |
| similarity index 82% |
| copy from chrome/browser/chromeos/file_system_provider/operations/copy_entry_unittest.cc |
| copy to chrome/browser/chromeos/file_system_provider/operations/move_entry_unittest.cc |
| index 1144a74d8034071b3db7b5f7ef946b49e347c344..c809c23c9ed1051227176b2665b50340df67d169 100644 |
| --- a/chrome/browser/chromeos/file_system_provider/operations/copy_entry_unittest.cc |
| +++ b/chrome/browser/chromeos/file_system_provider/operations/move_entry_unittest.cc |
| @@ -2,8 +2,6 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/chromeos/file_system_provider/operations/copy_entry.h" |
| - |
| #include <string> |
| #include <vector> |
| @@ -11,6 +9,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/scoped_vector.h" |
| +#include "chrome/browser/chromeos/file_system_provider/operations/move_entry.h" |
|
kinaba
2014/07/15 07:12:54
You can move this line to the top of the #includes
mtomasz
2014/07/16 07:36:12
Done.
|
| #include "chrome/browser/chromeos/file_system_provider/operations/test_util.h" |
| #include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h" |
| #include "chrome/common/extensions/api/file_system_provider.h" |
| @@ -32,10 +31,10 @@ const base::FilePath::CharType kTargetPath[] = "/kitty/and/puppy/happy"; |
| } // namespace |
| -class FileSystemProviderOperationsCopyEntryTest : public testing::Test { |
| +class FileSystemProviderOperationsMoveEntryTest : public testing::Test { |
| protected: |
| - FileSystemProviderOperationsCopyEntryTest() {} |
| - virtual ~FileSystemProviderOperationsCopyEntryTest() {} |
| + FileSystemProviderOperationsMoveEntryTest() {} |
| + virtual ~FileSystemProviderOperationsMoveEntryTest() {} |
| virtual void SetUp() OVERRIDE { |
| file_system_info_ = |
| @@ -49,25 +48,25 @@ class FileSystemProviderOperationsCopyEntryTest : public testing::Test { |
| ProvidedFileSystemInfo file_system_info_; |
| }; |
| -TEST_F(FileSystemProviderOperationsCopyEntryTest, Execute) { |
| +TEST_F(FileSystemProviderOperationsMoveEntryTest, Execute) { |
| util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); |
| util::StatusCallbackLog callback_log; |
| - CopyEntry copy_entry(NULL, |
| + MoveEntry move_entry(NULL, |
| file_system_info_, |
| base::FilePath::FromUTF8Unsafe(kSourcePath), |
| base::FilePath::FromUTF8Unsafe(kTargetPath), |
| base::Bind(&util::LogStatusCallback, &callback_log)); |
| - copy_entry.SetDispatchEventImplForTesting( |
| + move_entry.SetDispatchEventImplForTesting( |
| base::Bind(&util::LoggingDispatchEventImpl::OnDispatchEventImpl, |
| base::Unretained(&dispatcher))); |
| - EXPECT_TRUE(copy_entry.Execute(kRequestId)); |
| + EXPECT_TRUE(move_entry.Execute(kRequestId)); |
| ASSERT_EQ(1u, dispatcher.events().size()); |
| extensions::Event* event = dispatcher.events()[0]; |
| EXPECT_EQ( |
| - extensions::api::file_system_provider::OnCopyEntryRequested::kEventName, |
| + extensions::api::file_system_provider::OnMoveEntryRequested::kEventName, |
| event->event_name); |
| base::ListValue* event_args = event->event_args.get(); |
| ASSERT_EQ(1u, event_args->GetSize()); |
| @@ -92,60 +91,60 @@ TEST_F(FileSystemProviderOperationsCopyEntryTest, Execute) { |
| EXPECT_EQ(kTargetPath, event_target_path); |
| } |
| -TEST_F(FileSystemProviderOperationsCopyEntryTest, Execute_NoListener) { |
| +TEST_F(FileSystemProviderOperationsMoveEntryTest, Execute_NoListener) { |
| util::LoggingDispatchEventImpl dispatcher(false /* dispatch_reply */); |
| util::StatusCallbackLog callback_log; |
| - CopyEntry copy_entry(NULL, |
| + MoveEntry move_entry(NULL, |
| file_system_info_, |
| base::FilePath::FromUTF8Unsafe(kSourcePath), |
| base::FilePath::FromUTF8Unsafe(kTargetPath), |
| base::Bind(&util::LogStatusCallback, &callback_log)); |
| - copy_entry.SetDispatchEventImplForTesting( |
| + move_entry.SetDispatchEventImplForTesting( |
| base::Bind(&util::LoggingDispatchEventImpl::OnDispatchEventImpl, |
| base::Unretained(&dispatcher))); |
| - EXPECT_FALSE(copy_entry.Execute(kRequestId)); |
| + EXPECT_FALSE(move_entry.Execute(kRequestId)); |
| } |
| -TEST_F(FileSystemProviderOperationsCopyEntryTest, OnSuccess) { |
| +TEST_F(FileSystemProviderOperationsMoveEntryTest, OnSuccess) { |
| util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); |
| util::StatusCallbackLog callback_log; |
| - CopyEntry copy_entry(NULL, |
| + MoveEntry move_entry(NULL, |
| file_system_info_, |
| base::FilePath::FromUTF8Unsafe(kSourcePath), |
| base::FilePath::FromUTF8Unsafe(kTargetPath), |
| base::Bind(&util::LogStatusCallback, &callback_log)); |
| - copy_entry.SetDispatchEventImplForTesting( |
| + move_entry.SetDispatchEventImplForTesting( |
| base::Bind(&util::LoggingDispatchEventImpl::OnDispatchEventImpl, |
| base::Unretained(&dispatcher))); |
| - EXPECT_TRUE(copy_entry.Execute(kRequestId)); |
| + EXPECT_TRUE(move_entry.Execute(kRequestId)); |
| - copy_entry.OnSuccess(kRequestId, |
| + move_entry.OnSuccess(kRequestId, |
| scoped_ptr<RequestValue>(new RequestValue()), |
| false /* has_more */); |
| ASSERT_EQ(1u, callback_log.size()); |
| EXPECT_EQ(base::File::FILE_OK, callback_log[0]); |
| } |
| -TEST_F(FileSystemProviderOperationsCopyEntryTest, OnError) { |
| +TEST_F(FileSystemProviderOperationsMoveEntryTest, OnError) { |
| util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); |
| util::StatusCallbackLog callback_log; |
| - CopyEntry copy_entry(NULL, |
| + MoveEntry move_entry(NULL, |
| file_system_info_, |
| base::FilePath::FromUTF8Unsafe(kSourcePath), |
| base::FilePath::FromUTF8Unsafe(kTargetPath), |
| base::Bind(&util::LogStatusCallback, &callback_log)); |
| - copy_entry.SetDispatchEventImplForTesting( |
| + move_entry.SetDispatchEventImplForTesting( |
| base::Bind(&util::LoggingDispatchEventImpl::OnDispatchEventImpl, |
| base::Unretained(&dispatcher))); |
| - EXPECT_TRUE(copy_entry.Execute(kRequestId)); |
| + EXPECT_TRUE(move_entry.Execute(kRequestId)); |
| - copy_entry.OnError(kRequestId, |
| + move_entry.OnError(kRequestId, |
| scoped_ptr<RequestValue>(new RequestValue()), |
| base::File::FILE_ERROR_TOO_MANY_OPENED); |
| ASSERT_EQ(1u, callback_log.size()); |