Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: base/test/test_reg_util_win.h

Issue 1527603002: Remove ScopedVector from test_reg_util_win (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: presubmit DONE Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | base/test/test_reg_util_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_TEST_TEST_REG_UTIL_WIN_H_ 5 #ifndef BASE_TEST_TEST_REG_UTIL_WIN_H_
6 #define BASE_TEST_TEST_REG_UTIL_WIN_H_ 6 #define BASE_TEST_TEST_REG_UTIL_WIN_H_
7 7
8 // Registry utility functions used only by tests. 8 // Registry utility functions used only by tests.
9 #include <vector>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
13 #include "base/time/time.h" 14 #include "base/time/time.h"
14 #include "base/win/registry.h" 15 #include "base/win/registry.h"
15 16
16 namespace registry_util { 17 namespace registry_util {
17 18
18 // Allows a test to easily override registry hives so that it can start from a 19 // Allows a test to easily override registry hives so that it can start from a
19 // known good state, or make sure to not leave any side effects once the test 20 // known good state, or make sure to not leave any side effects once the test
20 // completes. This supports parallel tests. All the overrides are scoped to the 21 // completes. This supports parallel tests. All the overrides are scoped to the
21 // lifetime of the override manager. Destroy the manager to undo the overrides. 22 // lifetime of the override manager. Destroy the manager to undo the overrides.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 }; 57 };
57 58
58 // Used for testing only. 59 // Used for testing only.
59 RegistryOverrideManager(const base::Time& timestamp, 60 RegistryOverrideManager(const base::Time& timestamp,
60 const base::string16& test_key_root); 61 const base::string16& test_key_root);
61 62
62 base::Time timestamp_; 63 base::Time timestamp_;
63 base::string16 guid_; 64 base::string16 guid_;
64 65
65 base::string16 test_key_root_; 66 base::string16 test_key_root_;
66 ScopedVector<ScopedRegistryKeyOverride> overrides_; 67 std::vector<scoped_ptr<ScopedRegistryKeyOverride>> overrides_;
67 68
68 DISALLOW_COPY_AND_ASSIGN(RegistryOverrideManager); 69 DISALLOW_COPY_AND_ASSIGN(RegistryOverrideManager);
69 }; 70 };
70 71
71 // Generates a temporary key path that will be eventually deleted 72 // Generates a temporary key path that will be eventually deleted
72 // automatically if the process crashes. 73 // automatically if the process crashes.
73 base::string16 GenerateTempKeyPath(); 74 base::string16 GenerateTempKeyPath();
74 75
75 } // namespace registry_util 76 } // namespace registry_util
76 77
77 #endif // BASE_TEST_TEST_REG_UTIL_WIN_H_ 78 #endif // BASE_TEST_TEST_REG_UTIL_WIN_H_
OLDNEW
« no previous file with comments | « AUTHORS ('k') | base/test/test_reg_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698