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

Unified Diff: client/settings_test.cc

Issue 999953002: Use LockFile/UnlockFile for Settings to port to Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@lock-fileio-2
Patch Set: Tag inside, no info spam Created 5 years, 8 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
« no previous file with comments | « client/settings.cc ('k') | util/file/file_io.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/settings_test.cc
diff --git a/client/settings_test.cc b/client/settings_test.cc
index 7ce8fa23ff956e107a90d50d6c3ffdf5f804152e..203bd215ae3d63c1bbefb076ff698508cd646ce2 100644
--- a/client/settings_test.cc
+++ b/client/settings_test.cc
@@ -15,6 +15,7 @@
#include "client/settings.h"
#include "gtest/gtest.h"
+#include "test/errors.h"
#include "test/scoped_temp_dir.h"
#include "util/file/file_io.h"
@@ -27,7 +28,7 @@ class SettingsTest : public testing::Test {
SettingsTest() : settings_(settings_path()) {}
base::FilePath settings_path() {
- return temp_dir_.path().Append("settings");
+ return temp_dir_.path().Append(FILE_PATH_LITERAL("settings"));
}
Settings* settings() { return &settings_; }
@@ -151,7 +152,13 @@ TEST_F(SettingsTest, UnlinkFile) {
EXPECT_TRUE(settings()->SetUploadsEnabled(true));
EXPECT_TRUE(settings()->SetLastUploadAttemptTime(time(nullptr)));
- EXPECT_EQ(0, unlink(settings_path().value().c_str()));
+#if defined(OS_WIN)
+ EXPECT_EQ(0, _wunlink(settings_path().value().c_str()))
+ << ErrnoMessage("_wunlink");
+#else
+ EXPECT_EQ(0, unlink(settings_path().value().c_str()))
+ << ErrnoMessage("unlink");
+#endif
Settings local_settings(settings_path());
EXPECT_TRUE(local_settings.Initialize());
« no previous file with comments | « client/settings.cc ('k') | util/file/file_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698