| 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/local_file_sync_context.h" | 5 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 PrepareForSync(file_system_context, url, | 153 PrepareForSync(file_system_context, url, |
| 154 LocalFileSyncContext::SYNC_EXCLUSIVE, | 154 LocalFileSyncContext::SYNC_EXCLUSIVE, |
| 155 &metadata, &changes, nullptr)); | 155 &metadata, &changes, nullptr)); |
| 156 EXPECT_EQ(expected_file_type, metadata.file_type); | 156 EXPECT_EQ(expected_file_type, metadata.file_type); |
| 157 | 157 |
| 158 status_ = SYNC_STATUS_UNKNOWN; | 158 status_ = SYNC_STATUS_UNKNOWN; |
| 159 sync_context_->ApplyRemoteChange( | 159 sync_context_->ApplyRemoteChange( |
| 160 file_system_context, change, local_path, url, | 160 file_system_context, change, local_path, url, |
| 161 base::Bind(&LocalFileSyncContextTest::DidApplyRemoteChange, | 161 base::Bind(&LocalFileSyncContextTest::DidApplyRemoteChange, |
| 162 base::Unretained(this), | 162 base::Unretained(this), |
| 163 make_scoped_refptr(file_system_context), url)); | 163 base::RetainedRef(file_system_context), url)); |
| 164 base::MessageLoop::current()->Run(); | 164 base::MessageLoop::current()->Run(); |
| 165 return status_; | 165 return status_; |
| 166 } | 166 } |
| 167 | 167 |
| 168 void DidApplyRemoteChange(FileSystemContext* file_system_context, | 168 void DidApplyRemoteChange(FileSystemContext* file_system_context, |
| 169 const FileSystemURL& url, | 169 const FileSystemURL& url, |
| 170 SyncStatusCode status) { | 170 SyncStatusCode status) { |
| 171 status_ = status; | 171 status_ = status; |
| 172 sync_context_->FinalizeExclusiveSync( | 172 sync_context_->FinalizeExclusiveSync( |
| 173 file_system_context, url, | 173 file_system_context, url, |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 | 953 |
| 954 // Make sure kDir and kFile are created by ApplyRemoteChange. | 954 // Make sure kDir and kFile are created by ApplyRemoteChange. |
| 955 EXPECT_EQ(base::File::FILE_OK, file_system.FileExists(kFile)); | 955 EXPECT_EQ(base::File::FILE_OK, file_system.FileExists(kFile)); |
| 956 EXPECT_EQ(base::File::FILE_OK, file_system.DirectoryExists(kDir)); | 956 EXPECT_EQ(base::File::FILE_OK, file_system.DirectoryExists(kDir)); |
| 957 | 957 |
| 958 sync_context_->ShutdownOnUIThread(); | 958 sync_context_->ShutdownOnUIThread(); |
| 959 file_system.TearDown(); | 959 file_system.TearDown(); |
| 960 } | 960 } |
| 961 | 961 |
| 962 } // namespace sync_file_system | 962 } // namespace sync_file_system |
| OLD | NEW |