Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Side by Side Diff: chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698