diff options
author | ivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-29 14:00:12 +0000 |
---|---|---|
committer | ivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-29 14:00:12 +0000 |
commit | 95b42e2745a2380a16112a059bd0e842d81f0c0a (patch) | |
tree | 8715285e587b94807bcc70cf135d99bdbec662fb /rlz/test | |
parent | 1b14a45ac508a066cc3c060dd37327c3a13a6fda (diff) | |
download | chromium_src-95b42e2745a2380a16112a059bd0e842d81f0c0a.zip chromium_src-95b42e2745a2380a16112a059bd0e842d81f0c0a.tar.gz chromium_src-95b42e2745a2380a16112a059bd0e842d81f0c0a.tar.bz2 |
[cros] RlzValueStore made protected by a cross-process lock and not persisted over browser lifetime (like on Mac).
*) Moved RecursiveCrossProcessLock out of .mm file to a common _posix file.
*) Added static method to ImportantFileWriter that does blocking write on the current thread.
*) Dedicated RLZ thread gone, replaced back with shutdown-blocking worker pool.
BUG=157348,62328
Review URL: https://chromiumcodereview.appspot.com/11308196
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'rlz/test')
-rw-r--r-- | rlz/test/rlz_test_helpers.cc | 28 | ||||
-rw-r--r-- | rlz/test/rlz_test_helpers.h | 15 |
2 files changed, 6 insertions, 37 deletions
diff --git a/rlz/test/rlz_test_helpers.cc b/rlz/test/rlz_test_helpers.cc index 4fe12d4..32719e0 100644 --- a/rlz/test/rlz_test_helpers.cc +++ b/rlz/test/rlz_test_helpers.cc @@ -13,13 +13,10 @@ #include <shlwapi.h> #include "base/win/registry.h" #include "rlz/win/lib/rlz_lib.h" -#elif defined(OS_MACOSX) || defined(OS_CHROMEOS) +#elif defined(OS_POSIX) #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 { @@ -62,41 +59,24 @@ void UndoOverrideRegistryHives() { } // namespace #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) +#if defined(OS_POSIX) ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); rlz_lib::testing::SetRlzStoreDirectory(temp_dir_.path()); -#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) +#endif // defined(OS_POSIX) } void RlzLibTestNoMachineState::TearDown() { #if defined(OS_WIN) UndoOverrideRegistryHives(); -#elif defined(OS_MACOSX) || defined(OS_CHROMEOS) +#elif defined(OS_POSIX) 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() { diff --git a/rlz/test/rlz_test_helpers.h b/rlz/test/rlz_test_helpers.h index 8b0565d..a78764f 100644 --- a/rlz/test/rlz_test_helpers.h +++ b/rlz/test/rlz_test_helpers.h @@ -10,30 +10,19 @@ #include "base/compiler_specific.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_MACOSX) || defined(OS_CHROMEOS) +#if defined(OS_POSIX) #include "base/files/scoped_temp_dir.h" #endif -#if defined(OS_CHROMEOS) -#include "base/message_loop.h" -#include "base/threading/thread.h" -#endif class RlzLibTestNoMachineState : public ::testing::Test { protected: -#if defined(OS_CHROMEOS) - RlzLibTestNoMachineState(); -#endif virtual void SetUp() OVERRIDE; virtual void TearDown() OVERRIDE; -#if defined(OS_MACOSX) || defined(OS_CHROMEOS) +#if defined(OS_POSIX) base::ScopedTempDir temp_dir_; #endif -#if defined(OS_CHROMEOS) - base::Thread pref_store_io_thread_; - MessageLoop message_loop_; -#endif }; class RlzLibTestBase : public RlzLibTestNoMachineState { |