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

Unified Diff: rlz/test/rlz_test_helpers.cc

Issue 11365107: [cros] RlzValueStore implementation for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert to Chrome-only Created 8 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 | « rlz/test/rlz_test_helpers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/test/rlz_test_helpers.cc
diff --git a/rlz/test/rlz_test_helpers.cc b/rlz/test/rlz_test_helpers.cc
index 1a1870a058abaa6671601e06ead4a84508fa79a8..4fe12d4e2f12e677d0bd8e42014c7ff7df5f1b9f 100644
--- a/rlz/test/rlz_test_helpers.cc
+++ b/rlz/test/rlz_test_helpers.cc
@@ -13,10 +13,13 @@
#include <shlwapi.h>
#include "base/win/registry.h"
#include "rlz/win/lib/rlz_lib.h"
-#elif defined(OS_MACOSX)
+#elif defined(OS_MACOSX) || defined(OS_CHROMEOS)
#include "base/file_path.h"
#include "rlz/lib/rlz_value_store.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "rlz/chromeos/lib/rlz_value_store_chromeos.h"
+#endif
#if defined(OS_WIN)
namespace {
@@ -60,22 +63,40 @@ void UndoOverrideRegistryHives() {
#endif // defined(OS_WIN)
+#if defined(OS_CHROMEOS)
+RlzLibTestNoMachineState::RlzLibTestNoMachineState()
+ : pref_store_io_thread_("test_rlz_pref_store_io_thread") {
+}
+#endif // defined(OS_CHROMEOS)
+
void RlzLibTestNoMachineState::SetUp() {
#if defined(OS_WIN)
OverrideRegistryHives();
#elif defined(OS_MACOSX)
base::mac::ScopedNSAutoreleasePool pool;
+#endif // defined(OS_WIN)
+#if defined(OS_MACOSX) || defined(OS_CHROMEOS)
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
rlz_lib::testing::SetRlzStoreDirectory(temp_dir_.path());
-#endif // defined(OS_WIN)
+#endif // defined(OS_MACOSX) || defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS)
+ base::Thread::Options options;
+ options.message_loop_type = MessageLoop::TYPE_IO;
+ ASSERT_TRUE(pref_store_io_thread_.StartWithOptions(options));
+ rlz_lib::SetIOTaskRunner(pref_store_io_thread_.message_loop_proxy());
+ rlz_lib::RlzValueStoreChromeOS::ResetForTesting();
+#endif // defined(OS_CHROMEOS)
}
void RlzLibTestNoMachineState::TearDown() {
#if defined(OS_WIN)
UndoOverrideRegistryHives();
-#elif defined(OS_MACOSX)
+#elif defined(OS_MACOSX) || defined(OS_CHROMEOS)
rlz_lib::testing::SetRlzStoreDirectory(FilePath());
#endif // defined(OS_WIN)
+#if defined(OS_CHROMEOS)
+ pref_store_io_thread_.Stop();
+#endif // defined(OS_CHROMEOS)
}
void RlzLibTestBase::SetUp() {
« no previous file with comments | « rlz/test/rlz_test_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698