Elim cr-checkbox
[chromium-blink-merge.git] / rlz / test / rlz_test_helpers.h
blob7d24e62b4e2dfbf808293c59f990641f4b23c658
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // Helper functions used by the tests.
7 #ifndef RLZ_TEST_RLZ_TEST_HELPERS_H
8 #define RLZ_TEST_RLZ_TEST_HELPERS_H
10 #include "base/compiler_specific.h"
11 #include "testing/gtest/include/gtest/gtest.h"
13 #if defined(OS_POSIX)
14 #include "base/files/scoped_temp_dir.h"
15 #endif
17 #if defined(OS_WIN)
18 #include "base/test/test_reg_util_win.h"
19 #endif
21 // A test helper class that constructs and destructs platform dependent machine
22 // state. It's used by src/components/rlz/rlz_tracker_unittest.cc and
23 // src/rlz/lib/rlz_lib_test.cc
24 class RlzLibTestNoMachineStateHelper {
25 public:
26 void SetUp();
27 void TearDown();
29 #if defined(OS_POSIX)
30 base::ScopedTempDir temp_dir_;
31 #endif
33 #if defined(OS_WIN)
34 registry_util::RegistryOverrideManager override_manager_;
35 #endif
38 class RlzLibTestNoMachineState : public ::testing::Test {
39 protected:
40 void SetUp() override;
41 void TearDown() override;
43 RlzLibTestNoMachineStateHelper m_rlz_test_helper_;
46 class RlzLibTestBase : public RlzLibTestNoMachineState {
47 protected:
48 void SetUp() override;
50 RlzLibTestNoMachineStateHelper m_rlz_test_helper_;
53 #endif // RLZ_TEST_RLZ_TEST_HELPERS_H