value_store_test_suite.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2014 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. #ifndef COMPONENTS_VALUE_STORE_VALUE_STORE_TEST_SUITE_H_
  5. #define COMPONENTS_VALUE_STORE_VALUE_STORE_TEST_SUITE_H_
  6. #include <memory>
  7. #include "base/files/scoped_temp_dir.h"
  8. #include "base/memory/ref_counted.h"
  9. #include "base/test/task_environment.h"
  10. #include "components/value_store/value_store.h"
  11. #include "testing/gtest/include/gtest/gtest.h"
  12. namespace value_store {
  13. // Parameter type for the value-parameterized tests.
  14. typedef ValueStore* (*ValueStoreTestParam)(const base::FilePath& file_path);
  15. // Test fixture for ValueStore tests. Tests are defined in
  16. // value_store_test_suite.cc with configurations for both cached
  17. // and non-cached leveldb storage, and cached no-op storage.
  18. class ValueStoreTestSuite : public testing::TestWithParam<ValueStoreTestParam> {
  19. public:
  20. ValueStoreTestSuite();
  21. ~ValueStoreTestSuite() override;
  22. void SetUp() override;
  23. void TearDown() override;
  24. protected:
  25. std::unique_ptr<ValueStore> storage_;
  26. private:
  27. base::ScopedTempDir temp_dir_;
  28. base::test::TaskEnvironment task_environment_;
  29. };
  30. } // namespace value_store
  31. #endif // COMPONENTS_VALUE_STORE_VALUE_STORE_TEST_SUITE_H_