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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend_v1/fake_drive_service_helper.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
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/drive_backend_v1/fake_drive_service_he lper.h" 5 #include "chrome/browser/sync_file_system/drive_backend_v1/fake_drive_service_he lper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 CreateResultReceiver(&error, &list)); 272 CreateResultReceiver(&error, &list));
273 base::RunLoop().RunUntilIdle(); 273 base::RunLoop().RunUntilIdle();
274 if (error != google_apis::HTTP_SUCCESS) 274 if (error != google_apis::HTTP_SUCCESS)
275 return error; 275 return error;
276 } 276 }
277 } 277 }
278 278
279 void FakeDriveServiceHelper::Initialize() { 279 void FakeDriveServiceHelper::Initialize() {
280 ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); 280 ASSERT_TRUE(base_dir_.CreateUniqueTempDir());
281 temp_dir_ = base_dir_.path().Append(FPL("tmp")); 281 temp_dir_ = base_dir_.path().Append(FPL("tmp"));
282 ASSERT_TRUE(file_util::CreateDirectory(temp_dir_)); 282 ASSERT_TRUE(base::CreateDirectory(temp_dir_));
283 } 283 }
284 284
285 base::FilePath FakeDriveServiceHelper::WriteToTempFile( 285 base::FilePath FakeDriveServiceHelper::WriteToTempFile(
286 const std::string& content) { 286 const std::string& content) {
287 base::FilePath temp_file; 287 base::FilePath temp_file;
288 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file)); 288 EXPECT_TRUE(base::CreateTemporaryFileInDir(temp_dir_, &temp_file));
289 EXPECT_EQ(static_cast<int>(content.size()), 289 EXPECT_EQ(static_cast<int>(content.size()),
290 file_util::WriteFile(temp_file, content.data(), content.size())); 290 file_util::WriteFile(temp_file, content.data(), content.size()));
291 return temp_file; 291 return temp_file;
292 } 292 }
293 293
294 } // namespace drive_backend 294 } // namespace drive_backend
295 } // namespace sync_file_system 295 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698