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/file_util.h" | 7 #include "base/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 22 matching lines...) Expand all Loading... |
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 virtual void SetUp() OVERRIDE { |
41 OperationTestBase::SetUp(); | 41 OperationTestBase::SetUp(); |
42 operation_.reset(new CopyOperation( | 42 operation_.reset(new CopyOperation( |
43 blocking_task_runner(), | 43 blocking_task_runner(), delegate(), scheduler(), metadata(), cache())); |
44 delegate(), | |
45 scheduler(), | |
46 metadata(), | |
47 cache(), | |
48 util::GetIdentityResourceIdCanonicalizer())); | |
49 } | 44 } |
50 | 45 |
51 scoped_ptr<CopyOperation> operation_; | 46 scoped_ptr<CopyOperation> operation_; |
52 }; | 47 }; |
53 | 48 |
54 TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_RegularFile) { | 49 TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_RegularFile) { |
55 const base::FilePath local_src_path = temp_dir().AppendASCII("local.txt"); | 50 const base::FilePath local_src_path = temp_dir().AppendASCII("local.txt"); |
56 const base::FilePath remote_dest_path( | 51 const base::FilePath remote_dest_path( |
57 FILE_PATH_LITERAL("drive/root/remote.txt")); | 52 FILE_PATH_LITERAL("drive/root/remote.txt")); |
58 | 53 |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 pending_callback.Run(FILE_ERROR_OK); | 509 pending_callback.Run(FILE_ERROR_OK); |
515 content::RunAllBlockingPoolTasksUntilIdle(); | 510 content::RunAllBlockingPoolTasksUntilIdle(); |
516 | 511 |
517 EXPECT_EQ(FILE_ERROR_OK, copy_error); | 512 EXPECT_EQ(FILE_ERROR_OK, copy_error); |
518 ResourceEntry entry; | 513 ResourceEntry entry; |
519 EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(dest_path, &entry)); | 514 EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(dest_path, &entry)); |
520 } | 515 } |
521 | 516 |
522 } // namespace file_system | 517 } // namespace file_system |
523 } // namespace drive | 518 } // namespace drive |
OLD | NEW |