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

Unified Diff: chrome/common/multi_process_lock_unittest.cc

Issue 8341052: share all the needed linux code with OpenBSD in chrome and content (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: wrap long lines Created 9 years, 1 month 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 | « chrome/common/multi_process_lock_mac.cc ('k') | chrome/common/multi_process_lock_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/multi_process_lock_unittest.cc
diff --git a/chrome/common/multi_process_lock_unittest.cc b/chrome/common/multi_process_lock_unittest.cc
index e1408eedf5402bcb07ec4b91135d2a3b50d11252..30c4d7b0ab9ade41f7eb130fee33f1d4502c1598 100644
--- a/chrome/common/multi_process_lock_unittest.cc
+++ b/chrome/common/multi_process_lock_unittest.cc
@@ -77,13 +77,27 @@ TEST_F(MultiProcessLockTest, BasicCreationTest) {
}
TEST_F(MultiProcessLockTest, LongNameTest) {
- // Linux has a max path name of 108 characters.
- // http://lxr.linux.no/linux+v2.6.36/include/linux/un.h
- // This is enforced on all platforms.
+ // Every platform has has it's own max path name size,
+ // so different checks are needed for them.
+ // POSIX: sizeof(address.sun_path) - 2
+ // Mac OS X: BOOTSTRAP_MAX_NAME_LEN
+ // Windows: MAX_PATH
LOG(INFO) << "Following error log due to long name is expected";
+#if defined(OS_MACOSX)
+ std::string name("This is a name that is longer than one hundred and "
+ "twenty-eight characters to make sure that we fail appropriately on "
+ "Mac OS X when we have a path that is too long for Mac OS X to handle");
+#elif defined(OS_POSIX)
std::string name("This is a name that is longer than one hundred and eight "
- "characters to make sure that we fail appropriately on linux when we "
- "have a path that is to long for linux to handle");
+ "characters to make sure that we fail appropriately on POSIX systems "
+ "when we have a path that is too long for the system to handle");
+#elif defined(OS_WIN)
+ std::string name("This is a name that is longer than two hundred and sixty "
+ "characters to make sure that we fail appropriately on Windows when we "
+ "have a path that is too long for Windows to handle "
+ "This limitation comes from the MAX_PATH definition which is obviously "
+ "defined to be a maximum of two hundred and sixty characters ");
+#endif
scoped_ptr<MultiProcessLock> test_lock(MultiProcessLock::Create(name));
EXPECT_FALSE(test_lock->TryLock());
}
« no previous file with comments | « chrome/common/multi_process_lock_mac.cc ('k') | chrome/common/multi_process_lock_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698