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

Side by Side Diff: base/test/test_reg_util_win_unittest.cc

Issue 1092863002: Apply automated fixits for Chrome clang plugin to base_unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix format Created 5 years, 8 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/test/test_reg_util_win.h" 9 #include "base/test/test_reg_util_win.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 14 matching lines...) Expand all
25 // on the system. This fake path will be auto-deleted by other 25 // on the system. This fake path will be auto-deleted by other
26 // RegistryOverrideManagers in case we crash. 26 // RegistryOverrideManagers in case we crash.
27 fake_test_key_root_ = registry_util::GenerateTempKeyPath(); 27 fake_test_key_root_ = registry_util::GenerateTempKeyPath();
28 28
29 // Ensure a clean test environment. 29 // Ensure a clean test environment.
30 base::win::RegKey key(HKEY_CURRENT_USER); 30 base::win::RegKey key(HKEY_CURRENT_USER);
31 key.DeleteKey(fake_test_key_root_.c_str()); 31 key.DeleteKey(fake_test_key_root_.c_str());
32 key.DeleteKey(kTestKeyPath); 32 key.DeleteKey(kTestKeyPath);
33 } 33 }
34 34
35 virtual ~RegistryOverrideManagerTest() { 35 ~RegistryOverrideManagerTest() override {
36 base::win::RegKey key(HKEY_CURRENT_USER); 36 base::win::RegKey key(HKEY_CURRENT_USER);
37 key.DeleteKey(fake_test_key_root_.c_str()); 37 key.DeleteKey(fake_test_key_root_.c_str());
38 } 38 }
39 39
40 void AssertKeyExists(const base::string16& key_path) { 40 void AssertKeyExists(const base::string16& key_path) {
41 base::win::RegKey key; 41 base::win::RegKey key;
42 ASSERT_EQ(ERROR_SUCCESS, 42 ASSERT_EQ(ERROR_SUCCESS,
43 key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ)) 43 key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ))
44 << key_path << " does not exist."; 44 << key_path << " does not exist.";
45 } 45 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 manager_.reset(); 121 manager_.reset();
122 122
123 AssertKeyAbsent(path_garbage); 123 AssertKeyAbsent(path_garbage);
124 AssertKeyAbsent(path_very_stale); 124 AssertKeyAbsent(path_very_stale);
125 AssertKeyAbsent(path_stale); 125 AssertKeyAbsent(path_stale);
126 AssertKeyExists(path_current); 126 AssertKeyExists(path_current);
127 AssertKeyExists(path_future); 127 AssertKeyExists(path_future);
128 } 128 }
129 129
130 } // namespace registry_util 130 } // namespace registry_util
OLDNEW
« no previous file with comments | « base/synchronization/waitable_event_watcher.h ('k') | base/trace_event/trace_event_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698