OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/test/test_reg_util_win.h" | 5 #include "base/test/test_reg_util_win.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/ptr_util.h" |
11 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
16 | 17 |
17 namespace registry_util { | 18 namespace registry_util { |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 const base::string16& test_key_root) | 94 const base::string16& test_key_root) |
94 : timestamp_(timestamp), test_key_root_(test_key_root) { | 95 : timestamp_(timestamp), test_key_root_(test_key_root) { |
95 DeleteStaleTestKeys(timestamp_, test_key_root_); | 96 DeleteStaleTestKeys(timestamp_, test_key_root_); |
96 } | 97 } |
97 | 98 |
98 RegistryOverrideManager::~RegistryOverrideManager() {} | 99 RegistryOverrideManager::~RegistryOverrideManager() {} |
99 | 100 |
100 void RegistryOverrideManager::OverrideRegistry(HKEY override) { | 101 void RegistryOverrideManager::OverrideRegistry(HKEY override) { |
101 base::string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_); | 102 base::string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_); |
102 overrides_.push_back( | 103 overrides_.push_back( |
103 make_scoped_ptr(new ScopedRegistryKeyOverride(override, key_path))); | 104 base::WrapUnique(new ScopedRegistryKeyOverride(override, key_path))); |
104 } | 105 } |
105 | 106 |
106 base::string16 GenerateTempKeyPath() { | 107 base::string16 GenerateTempKeyPath() { |
107 return GenerateTempKeyPath(base::string16(kTempTestKeyPath), | 108 return GenerateTempKeyPath(base::string16(kTempTestKeyPath), |
108 base::Time::Now()); | 109 base::Time::Now()); |
109 } | 110 } |
110 | 111 |
111 } // namespace registry_util | 112 } // namespace registry_util |
OLD | NEW |