Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 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 #ifndef BASE_TEST_TEST_REG_UTIL_H_ | |
| 6 #define BASE_TEST_TEST_REG_UTIL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 // File utility functions used only by tests. | |
| 10 | |
| 11 #include "base/win/registry.h" | |
| 12 | |
| 13 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.
| |
| 14 | |
| 15 // Allows a test to easily override a known location in the registry so that | |
| 16 // it can start from a known good state, or make sure to not leave any | |
| 17 // side effects once the test completes. | |
| 18 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.
| |
| 19 public: | |
| 20 static const wchar_t kTempTestKeyPath[]; | |
| 21 | |
| 22 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.
| |
| 23 ~TempRegKeyOverride(); | |
| 24 | |
| 25 static void DeleteAllTempKeys(); | |
| 26 | |
| 27 protected: | |
| 28 HKEY override_; | |
| 29 base::win::RegKey temp_key_; | |
| 30 std::wstring temp_name_; | |
| 31 }; | |
|
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.
| |
| 32 | |
| 33 } // namespace reg_util | |
| 34 | |
| 35 #endif // BASE_TEST_TEST_REG_UTIL_H_ | |
| OLD | NEW |