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

Unified Diff: src/platform/update_engine/test_utils.cc

Issue 467051: AU: Use Omaha ID rather than MAC address in delta updater (Closed)
Patch Set: fixes for review Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/update_engine/test_utils.h ('k') | src/platform/update_engine/utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/update_engine/test_utils.cc
diff --git a/src/platform/update_engine/test_utils.cc b/src/platform/update_engine/test_utils.cc
index 6346bf393523ed813b158091bbfbdfab29705570..d916458e30387b07bc55a094b4cdff39f2647ba3 100644
--- a/src/platform/update_engine/test_utils.cc
+++ b/src/platform/update_engine/test_utils.cc
@@ -25,22 +25,12 @@ using std::vector;
namespace chromeos_update_engine {
-bool WriteFile(const char* path, const char* data, int data_len) {
- DirectFileWriter writer;
- TEST_AND_RETURN_FALSE_ERRNO(0 == writer.Open(path,
- O_WRONLY | O_CREAT | O_TRUNC,
- 0666));
- ScopedFileWriterCloser closer(&writer);
- TEST_AND_RETURN_FALSE_ERRNO(data_len == writer.Write(data, data_len));
- return true;
-}
-
bool WriteFileVector(const std::string& path, const std::vector<char>& data) {
- return WriteFile(path.c_str(), &data[0], data.size());
+ return utils::WriteFile(path.c_str(), &data[0], data.size());
}
bool WriteFileString(const std::string& path, const std::string& data) {
- return WriteFile(path.c_str(), data.data(), data.size());
+ return utils::WriteFile(path.c_str(), data.data(), data.size());
}
off_t FileSize(const string& path) {
« no previous file with comments | « src/platform/update_engine/test_utils.h ('k') | src/platform/update_engine/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698