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

Unified Diff: rlz/lib/rlz_lib_test.cc

Issue 10828424: mac/rlz: Remove an incorrect check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | rlz/mac/lib/rlz_value_store_mac.mm » ('j') | rlz/mac/lib/rlz_value_store_mac.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/lib/rlz_lib_test.cc
diff --git a/rlz/lib/rlz_lib_test.cc b/rlz/lib/rlz_lib_test.cc
index 118f48cb8cdc1292e12b5e0b4400fef1f6a9f599..4cfb7b9239a457bf49bdeb7936df1e64266f88cb 100644
--- a/rlz/lib/rlz_lib_test.cc
+++ b/rlz/lib/rlz_lib_test.cc
@@ -25,6 +25,12 @@
#if defined(OS_WIN)
#include <Windows.h>
#include "rlz/win/lib/machine_deal.h"
+#elif defined(OS_MACOSX)
+namespace rlz_lib {
+namespace testing {
+std::string RlzPlistFilenameStr();
+}
+}
Nico 2012/08/21 20:43:44 This is a bit gross, but rlz_value_store_mac.h can
Mark Mentovai 2012/08/21 20:59:29 Nico wrote:
Nico 2012/08/21 21:05:03 The included of scoped_nsobject.h needs to be cond
#endif
#if defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET)
@@ -871,4 +877,22 @@ TEST_F(RlzLibTest, ConcurrentStoreAccessWithProcessExitsWhileLockHeld) {
EXPECT_TRUE(rlz_lib::RecordProductEvent(rlz_lib::TOOLBAR_NOTIFIER,
rlz_lib::IE_DEFAULT_SEARCH, rlz_lib::INSTALL));
}
+
+TEST_F(RlzLibTest, LockAcquistionSucceedsButPlistCannotBeCreated) {
+ // See the comment at the top of WriteFails.
+ if (!rlz_lib::SupplementaryBranding::GetBrand().empty())
+ return;
+
+ // Create a directory where the rlz file is supposed to appear. This way,
+ // the lock file can be created successfully, but creation of the rlz file
+ // itself will fail.
+ int mkdir_result = mkdir(rlz_lib::testing::RlzPlistFilenameStr().c_str(),
+ 0500);
Mark Mentovai 2012/08/21 20:59:29 Bump this over to line up with the other argument.
+ ASSERT_EQ(0, mkdir_result);
+
+ rlz_lib::SupplementaryBranding branding("TEST");
+ EXPECT_FALSE(rlz_lib::RecordProductEvent(rlz_lib::TOOLBAR_NOTIFIER,
+ rlz_lib::IE_DEFAULT_SEARCH, rlz_lib::INSTALL));
+}
+
#endif
« no previous file with comments | « no previous file | rlz/mac/lib/rlz_value_store_mac.mm » ('j') | rlz/mac/lib/rlz_value_store_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698