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

Side by Side Diff: chrome/browser/chromeos/drive/file_system/truncate_operation_unittest.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | 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/chromeos/drive/file_system/truncate_operation.h" 5 #include "chrome/browser/chromeos/drive/file_system/truncate_operation.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "chrome/browser/chromeos/drive/drive.pb.h" 9 #include "chrome/browser/chromeos/drive/drive.pb.h"
10 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" 10 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 base::FilePath local_path; 107 base::FilePath local_path;
108 error = FILE_ERROR_FAILED; 108 error = FILE_ERROR_FAILED;
109 cache()->GetFileOnUIThread( 109 cache()->GetFileOnUIThread(
110 GetLocalId(file_in_root), 110 GetLocalId(file_in_root),
111 google_apis::test_util::CreateCopyResultCallback(&error, &local_path)); 111 google_apis::test_util::CreateCopyResultCallback(&error, &local_path));
112 test_util::RunBlockingPoolTask(); 112 test_util::RunBlockingPoolTask();
113 ASSERT_EQ(FILE_ERROR_OK, error); 113 ASSERT_EQ(FILE_ERROR_OK, error);
114 114
115 // The local file should be truncated. 115 // The local file should be truncated.
116 std::string content; 116 std::string content;
117 ASSERT_TRUE(file_util::ReadFileToString(local_path, &content)); 117 ASSERT_TRUE(base::ReadFileToString(local_path, &content));
118 118
119 EXPECT_EQ(file_size + 10, static_cast<int64>(content.size())); 119 EXPECT_EQ(file_size + 10, static_cast<int64>(content.size()));
120 // All trailing 10 bytes should be '\0'. 120 // All trailing 10 bytes should be '\0'.
121 EXPECT_EQ(std::string(10, '\0'), content.substr(file_size)); 121 EXPECT_EQ(std::string(10, '\0'), content.substr(file_size));
122 } 122 }
123 123
124 } // namespace file_system 124 } // namespace file_system
125 } // namespace drive 125 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/file_cache_unittest.cc ('k') | chrome/browser/chromeos/drive/file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698