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/sync_file_system/local/canned_syncable_file_system.h" | 5 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 base::PlatformFileError result, | 100 base::PlatformFileError result, |
101 const base::PlatformFileInfo& file_info, | 101 const base::PlatformFileInfo& file_info, |
102 const base::FilePath& platform_path, | 102 const base::FilePath& platform_path, |
103 const scoped_refptr<webkit_blob::ShareableFileReference>& /* file_ref */) { | 103 const scoped_refptr<webkit_blob::ShareableFileReference>& /* file_ref */) { |
104 if (result != base::PLATFORM_FILE_OK) { | 104 if (result != base::PLATFORM_FILE_OK) { |
105 callback.Run(result); | 105 callback.Run(result); |
106 return; | 106 return; |
107 } | 107 } |
108 EXPECT_EQ(expected_data.size(), static_cast<size_t>(file_info.size)); | 108 EXPECT_EQ(expected_data.size(), static_cast<size_t>(file_info.size)); |
109 std::string data; | 109 std::string data; |
110 const bool read_status = file_util::ReadFileToString(platform_path, &data); | 110 const bool read_status = base::ReadFileToString(platform_path, &data); |
111 EXPECT_TRUE(read_status); | 111 EXPECT_TRUE(read_status); |
112 EXPECT_EQ(expected_data, data); | 112 EXPECT_EQ(expected_data, data); |
113 callback.Run(result); | 113 callback.Run(result); |
114 } | 114 } |
115 | 115 |
116 void OnCreateSnapshotFile( | 116 void OnCreateSnapshotFile( |
117 base::PlatformFileInfo* file_info_out, | 117 base::PlatformFileInfo* file_info_out, |
118 base::FilePath* platform_path_out, | 118 base::FilePath* platform_path_out, |
119 const CannedSyncableFileSystem::StatusCallback& callback, | 119 const CannedSyncableFileSystem::StatusCallback& callback, |
120 base::PlatformFileError result, | 120 base::PlatformFileError result, |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 sync_status_ = status; | 670 sync_status_ = status; |
671 base::MessageLoop::current()->Quit(); | 671 base::MessageLoop::current()->Quit(); |
672 } | 672 } |
673 | 673 |
674 void CannedSyncableFileSystem::InitializeSyncStatusObserver() { | 674 void CannedSyncableFileSystem::InitializeSyncStatusObserver() { |
675 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); | 675 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); |
676 backend()->sync_context()->sync_status()->AddObserver(this); | 676 backend()->sync_context()->sync_status()->AddObserver(this); |
677 } | 677 } |
678 | 678 |
679 } // namespace sync_file_system | 679 } // namespace sync_file_system |
OLD | NEW |