OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h" | 5 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/task_runner_util.h" | 8 #include "base/task_runner_util.h" |
9 #include "chrome/browser/chromeos/drive/file_cache.h" | 9 #include "chrome/browser/chromeos/drive/file_cache.h" |
10 #include "chrome/browser/chromeos/drive/file_change.h" | 10 #include "chrome/browser/chromeos/drive/file_change.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 const FileOperationCallback& callback) { | 30 const FileOperationCallback& callback) { |
31 *out_local_id = local_id; | 31 *out_local_id = local_id; |
32 *out_callback = callback; | 32 *out_callback = callback; |
33 return true; | 33 return true; |
34 } | 34 } |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 class CopyOperationTest : public OperationTestBase { | 38 class CopyOperationTest : public OperationTestBase { |
39 protected: | 39 protected: |
40 virtual void SetUp() override { | 40 void SetUp() override { |
41 OperationTestBase::SetUp(); | 41 OperationTestBase::SetUp(); |
42 operation_.reset(new CopyOperation( | 42 operation_.reset(new CopyOperation( |
43 blocking_task_runner(), delegate(), scheduler(), metadata(), cache())); | 43 blocking_task_runner(), delegate(), scheduler(), metadata(), cache())); |
44 } | 44 } |
45 | 45 |
46 scoped_ptr<CopyOperation> operation_; | 46 scoped_ptr<CopyOperation> operation_; |
47 }; | 47 }; |
48 | 48 |
49 TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_RegularFile) { | 49 TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_RegularFile) { |
50 const base::FilePath local_src_path = temp_dir().AppendASCII("local.txt"); | 50 const base::FilePath local_src_path = temp_dir().AppendASCII("local.txt"); |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 pending_callback.Run(FILE_ERROR_OK); | 509 pending_callback.Run(FILE_ERROR_OK); |
510 content::RunAllBlockingPoolTasksUntilIdle(); | 510 content::RunAllBlockingPoolTasksUntilIdle(); |
511 | 511 |
512 EXPECT_EQ(FILE_ERROR_OK, copy_error); | 512 EXPECT_EQ(FILE_ERROR_OK, copy_error); |
513 ResourceEntry entry; | 513 ResourceEntry entry; |
514 EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(dest_path, &entry)); | 514 EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(dest_path, &entry)); |
515 } | 515 } |
516 | 516 |
517 } // namespace file_system | 517 } // namespace file_system |
518 } // namespace drive | 518 } // namespace drive |
OLD | NEW |