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

Unified Diff: components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc
diff --git a/components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc b/components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc
index 13142f784da25c8c3c4a1a9377cc1c4a6586af99..6e828bf7ad1856446d5724c43e52781b5e66c2a3 100644
--- a/components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc
+++ b/components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc
@@ -42,7 +42,7 @@ bool WriteStringToFile(const base::FilePath path, const std::string& data) {
}
int size = data.size();
- if (file_util::WriteFile(path, data.c_str(), size) != size) {
+ if (base::WriteFile(path, data.c_str(), size) != size) {
DLOG(WARNING) << "Failed to write " << path.value();
return false;
}
@@ -168,9 +168,8 @@ TEST_F(UserCloudPolicyStoreTest, LoadWithInvalidFile) {
ASSERT_TRUE(base::CreateDirectory(policy_file().DirName()));
std::string bogus_data = "bogus_data";
int size = bogus_data.size();
- ASSERT_EQ(size, file_util::WriteFile(policy_file(),
- bogus_data.c_str(),
- bogus_data.size()));
+ ASSERT_EQ(size, base::WriteFile(policy_file(),
+ bogus_data.c_str(), bogus_data.size()));
ExpectError(store_.get(), CloudPolicyStore::STATUS_LOAD_ERROR);
store_->Load();
@@ -201,9 +200,8 @@ TEST_F(UserCloudPolicyStoreTest, LoadImmediatelyWithInvalidFile) {
ASSERT_TRUE(base::CreateDirectory(policy_file().DirName()));
std::string bogus_data = "bogus_data";
int size = bogus_data.size();
- ASSERT_EQ(size, file_util::WriteFile(policy_file(),
- bogus_data.c_str(),
- bogus_data.size()));
+ ASSERT_EQ(size, base::WriteFile(policy_file(),
+ bogus_data.c_str(), bogus_data.size()));
ExpectError(store_.get(), CloudPolicyStore::STATUS_LOAD_ERROR);
store_->LoadImmediately(); // Should load without running the message loop.
@@ -226,7 +224,7 @@ TEST_F(UserCloudPolicyStoreTest, Migration) {
ASSERT_TRUE(unsigned_builder.policy().SerializeToString(&data));
ASSERT_TRUE(base::CreateDirectory(policy_file().DirName()));
int size = data.size();
- ASSERT_EQ(size, file_util::WriteFile(policy_file(), data.c_str(), size));
+ ASSERT_EQ(size, base::WriteFile(policy_file(), data.c_str(), size));
// Now make sure the data can get loaded.
Sequence s;

Powered by Google App Engine
This is Rietveld 408576698