Revert "update_engine: Update libchrome APIS to r456626."
This reverts commit 663ff4b30b9f629a130ef6d357d462b897d4071e.
Reason for revert: Broke the mac_sdk
Exempt-From-Owner-Approval: Fixing mac_sdk
Change-Id: I8184ec58e74d62dca0deafb39340d4bd36bf40e0
diff --git a/common/hwid_override_unittest.cc b/common/hwid_override_unittest.cc
index da6f367..26ef30a 100644
--- a/common/hwid_override_unittest.cc
+++ b/common/hwid_override_unittest.cc
@@ -32,7 +32,7 @@
void SetUp() override {
ASSERT_TRUE(tempdir_.CreateUniqueTempDir());
- ASSERT_TRUE(base::CreateDirectory(tempdir_.GetPath().Append("etc")));
+ ASSERT_TRUE(base::CreateDirectory(tempdir_.path().Append("etc")));
}
protected:
@@ -46,22 +46,22 @@
std::string expected_hwid("expected");
std::string keyval(HwidOverride::kHwidOverrideKey);
keyval += ("=" + expected_hwid);
- ASSERT_EQ(base::WriteFile(tempdir_.GetPath().Append("etc/lsb-release"),
+ ASSERT_EQ(base::WriteFile(tempdir_.path().Append("etc/lsb-release"),
keyval.c_str(), keyval.length()),
static_cast<int>(keyval.length()));
- EXPECT_EQ(expected_hwid, HwidOverride::Read(tempdir_.GetPath()));
+ EXPECT_EQ(expected_hwid, HwidOverride::Read(tempdir_.path()));
}
TEST_F(HwidOverrideTest, ReadNothing) {
std::string keyval("SOMETHING_ELSE=UNINTERESTING");
- ASSERT_EQ(base::WriteFile(tempdir_.GetPath().Append("etc/lsb-release"),
+ ASSERT_EQ(base::WriteFile(tempdir_.path().Append("etc/lsb-release"),
keyval.c_str(), keyval.length()),
static_cast<int>(keyval.length()));
- EXPECT_EQ(std::string(), HwidOverride::Read(tempdir_.GetPath()));
+ EXPECT_EQ(std::string(), HwidOverride::Read(tempdir_.path()));
}
TEST_F(HwidOverrideTest, ReadFailure) {
- EXPECT_EQ(std::string(), HwidOverride::Read(tempdir_.GetPath()));
+ EXPECT_EQ(std::string(), HwidOverride::Read(tempdir_.path()));
}
} // namespace chromeos_update_engine
diff --git a/common/prefs_unittest.cc b/common/prefs_unittest.cc
index aa2eb04..73ceb00 100644
--- a/common/prefs_unittest.cc
+++ b/common/prefs_unittest.cc
@@ -44,7 +44,7 @@
protected:
void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- prefs_dir_ = temp_dir_.GetPath();
+ prefs_dir_ = temp_dir_.path();
ASSERT_TRUE(prefs_.Init(prefs_dir_));
}
diff --git a/common/subprocess_unittest.cc b/common/subprocess_unittest.cc
index 10710e8..cbc9a85 100644
--- a/common/subprocess_unittest.cc
+++ b/common/subprocess_unittest.cc
@@ -225,7 +225,7 @@
TEST_F(SubprocessTest, CancelTest) {
base::ScopedTempDir tempdir;
ASSERT_TRUE(tempdir.CreateUniqueTempDir());
- string fifo_path = tempdir.GetPath().Append("fifo").value();
+ string fifo_path = tempdir.path().Append("fifo").value();
EXPECT_EQ(0, mkfifo(fifo_path.c_str(), 0666));
// Start a process, make sure it is running and try to cancel it. We write
diff --git a/common/test_utils.cc b/common/test_utils.cc
index 3447cdc..fb22c80 100644
--- a/common/test_utils.cc
+++ b/common/test_utils.cc
@@ -248,7 +248,7 @@
string* mnt_path,
unsigned long flags) { // NOLINT - long
EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
- *mnt_path = temp_dir_.GetPath().value();
+ *mnt_path = temp_dir_.path().value();
string loop_dev;
loop_binder_.reset(
diff --git a/common/utils_unittest.cc b/common/utils_unittest.cc
index 62f9f6c..6e9a911 100644
--- a/common/utils_unittest.cc
+++ b/common/utils_unittest.cc
@@ -100,11 +100,11 @@
TEST(UtilsTest, IsSymlinkTest) {
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- string temp_file = temp_dir.GetPath().Append("temp-file").value();
+ string temp_file = temp_dir.path().Append("temp-file").value();
EXPECT_TRUE(utils::WriteFile(temp_file.c_str(), "", 0));
- string temp_symlink = temp_dir.GetPath().Append("temp-symlink").value();
+ string temp_symlink = temp_dir.path().Append("temp-symlink").value();
EXPECT_EQ(0, symlink(temp_file.c_str(), temp_symlink.c_str()));
- EXPECT_FALSE(utils::IsSymlink(temp_dir.GetPath().value().c_str()));
+ EXPECT_FALSE(utils::IsSymlink(temp_dir.path().value().c_str()));
EXPECT_FALSE(utils::IsSymlink(temp_file.c_str()));
EXPECT_TRUE(utils::IsSymlink(temp_symlink.c_str()));
EXPECT_FALSE(utils::IsSymlink("/non/existent/path"));
@@ -303,9 +303,8 @@
base::Time::Exploded exploded = (base::Time::Exploded) {
.year = 2001, .month = 9, .day_of_week = 0, .day_of_month = 9,
.hour = 1, .minute = 46, .second = 40, .millisecond = 42};
- base::Time time;
- EXPECT_TRUE(base::Time::FromUTCExploded(exploded, &time));
- EXPECT_EQ(time, utils::TimeFromStructTimespec(&ts));
+ EXPECT_EQ(base::Time::FromUTCExploded(exploded),
+ utils::TimeFromStructTimespec(&ts));
}
TEST(UtilsTest, DecodeAndStoreBase64String) {
@@ -479,23 +478,23 @@
test_utils::ScopedLoopbackDeviceBinder loop_binder(
tmp_image, true, &loop_dev);
- EXPECT_FALSE(utils::IsMountpoint(mnt_dir.GetPath().value()));
+ EXPECT_FALSE(utils::IsMountpoint(mnt_dir.path().value()));
// This is the actual test part. While we hold a file descriptor open for the
// mounted filesystem, umount should still succeed.
EXPECT_TRUE(utils::MountFilesystem(
- loop_dev, mnt_dir.GetPath().value(), MS_RDONLY, "ext4", ""));
+ loop_dev, mnt_dir.path().value(), MS_RDONLY, "ext4", ""));
// Verify the directory is a mount point now.
- EXPECT_TRUE(utils::IsMountpoint(mnt_dir.GetPath().value()));
+ EXPECT_TRUE(utils::IsMountpoint(mnt_dir.path().value()));
- string target_file = mnt_dir.GetPath().Append("empty-file").value();
+ string target_file = mnt_dir.path().Append("empty-file").value();
int fd = HANDLE_EINTR(open(target_file.c_str(), O_RDONLY));
EXPECT_GE(fd, 0);
- EXPECT_TRUE(utils::UnmountFilesystem(mnt_dir.GetPath().value()));
+ EXPECT_TRUE(utils::UnmountFilesystem(mnt_dir.path().value()));
// The filesystem should be already unmounted at this point.
- EXPECT_FALSE(utils::IsMountpoint(mnt_dir.GetPath().value()));
+ EXPECT_FALSE(utils::IsMountpoint(mnt_dir.path().value()));
IGNORE_EINTR(close(fd));
// The filesystem was already unmounted so this call should fail.
- EXPECT_FALSE(utils::UnmountFilesystem(mnt_dir.GetPath().value()));
+ EXPECT_FALSE(utils::UnmountFilesystem(mnt_dir.path().value()));
}
TEST(UtilsTest, IsMountpointTest) {
@@ -504,7 +503,7 @@
base::ScopedTempDir mnt_dir;
EXPECT_TRUE(mnt_dir.CreateUniqueTempDir());
- EXPECT_FALSE(utils::IsMountpoint(mnt_dir.GetPath().value()));
+ EXPECT_FALSE(utils::IsMountpoint(mnt_dir.path().value()));
base::FilePath file;
EXPECT_TRUE(base::CreateTemporaryFile(&file));
diff --git a/payload_consumer/delta_performer_unittest.cc b/payload_consumer/delta_performer_unittest.cc
index 6238313..1e06e1a 100644
--- a/payload_consumer/delta_performer_unittest.cc
+++ b/payload_consumer/delta_performer_unittest.cc
@@ -752,8 +752,8 @@
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- string non_existing_file = temp_dir.GetPath().Append("non-existing").value();
- string existing_file = temp_dir.GetPath().Append("existing").value();
+ string non_existing_file = temp_dir.path().Append("non-existing").value();
+ string existing_file = temp_dir.path().Append("existing").value();
EXPECT_EQ(0, System(base::StringPrintf("touch %s", existing_file.c_str())));
// Non-official build, non-existing public-key, key in response -> true
diff --git a/test_http_server.cc b/test_http_server.cc
index 6b2413f..2955e79 100644
--- a/test_http_server.cc
+++ b/test_http_server.cc
@@ -98,9 +98,9 @@
request->raw_headers = headers;
// Break header into lines.
- vector<string> lines = base::SplitStringUsingSubstr(
- headers.substr(0, headers.length() - strlen(EOL EOL)), EOL,
- base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ vector<string> lines;
+ base::SplitStringUsingSubstr(
+ headers.substr(0, headers.length() - strlen(EOL EOL)), EOL, &lines);
// Decode URL line.
vector<string> terms = base::SplitString(lines[0], base::kWhitespaceASCII,