Chromium Code Reviews| Index: base/test/test_reg_util_win.h |
| =================================================================== |
| --- base/test/test_reg_util_win.h (revision 0) |
| +++ base/test/test_reg_util_win.h (revision 0) |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_TEST_TEST_REG_UTIL_H_ |
| +#define BASE_TEST_TEST_REG_UTIL_H_ |
| +#pragma once |
| + |
| +// File utility functions used only by tests. |
| + |
| +#include "base/win/registry.h" |
| + |
| +namespace reg_util { |
|
Paweł Hajdan Jr.
2011/08/18 22:42:47
nit: I don't like abbreviations. Why not registry_
Roger Tawa OOO till Jul 10th
2011/08/22 19:24:42
Done.
|
| + |
| +// Allows a test to easily override a known location in the registry so that |
| +// it can start from a known good state, or make sure to not leave any |
| +// side effects once the test completes. |
| +class TempRegKeyOverride { |
|
Paweł Hajdan Jr.
2011/08/18 22:42:47
nit: Why not ScopedRegistryKeyOverride?
Roger Tawa OOO till Jul 10th
2011/08/22 19:24:42
Done.
|
| + public: |
| + static const wchar_t kTempTestKeyPath[]; |
| + |
| + TempRegKeyOverride(HKEY override, const wchar_t* temp_name); |
|
Paweł Hajdan Jr.
2011/08/18 22:42:47
nit: Why not const std::wstring& ?
Roger Tawa OOO till Jul 10th
2011/08/22 19:24:42
Done.
|
| + ~TempRegKeyOverride(); |
| + |
| + static void DeleteAllTempKeys(); |
| + |
| + protected: |
| + HKEY override_; |
| + base::win::RegKey temp_key_; |
| + std::wstring temp_name_; |
| +}; |
|
Paweł Hajdan Jr.
2011/08/18 22:42:47
nit: DISALLOW_COPY_AND_ASSIGN
Roger Tawa OOO till Jul 10th
2011/08/22 19:24:42
Done.
|
| + |
| +} // namespace reg_util |
| + |
| +#endif // BASE_TEST_TEST_REG_UTIL_H_ |
| Property changes on: base\test\test_reg_util_win.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |