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

Side by Side Diff: base/win/registry_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
« no previous file with comments | « base/win/registry.cc ('k') | base/win/shortcut_unittest.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 #include "base/win/registry.h" 5 #include "base/win/registry.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 13 matching lines...) Expand all
24 protected: 24 protected:
25 #if defined(_WIN64) 25 #if defined(_WIN64)
26 static const REGSAM kNativeViewMask = KEY_WOW64_64KEY; 26 static const REGSAM kNativeViewMask = KEY_WOW64_64KEY;
27 static const REGSAM kRedirectedViewMask = KEY_WOW64_32KEY; 27 static const REGSAM kRedirectedViewMask = KEY_WOW64_32KEY;
28 #else 28 #else
29 static const REGSAM kNativeViewMask = KEY_WOW64_32KEY; 29 static const REGSAM kNativeViewMask = KEY_WOW64_32KEY;
30 static const REGSAM kRedirectedViewMask = KEY_WOW64_64KEY; 30 static const REGSAM kRedirectedViewMask = KEY_WOW64_64KEY;
31 #endif // _WIN64 31 #endif // _WIN64
32 32
33 RegistryTest() {} 33 RegistryTest() {}
34 virtual void SetUp() override { 34 void SetUp() override {
35 // Create a temporary key. 35 // Create a temporary key.
36 RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS); 36 RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
37 key.DeleteKey(kRootKey); 37 key.DeleteKey(kRootKey);
38 ASSERT_NE(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_READ)); 38 ASSERT_NE(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_READ));
39 ASSERT_EQ(ERROR_SUCCESS, key.Create(HKEY_CURRENT_USER, kRootKey, KEY_READ)); 39 ASSERT_EQ(ERROR_SUCCESS, key.Create(HKEY_CURRENT_USER, kRootKey, KEY_READ));
40 foo_software_key_ = L"Software\\"; 40 foo_software_key_ = L"Software\\";
41 foo_software_key_ += kRootKey; 41 foo_software_key_ += kRootKey;
42 foo_software_key_ += L"\\Foo"; 42 foo_software_key_ += L"\\Foo";
43 } 43 }
44 44
45 virtual void TearDown() override { 45 void TearDown() override {
46 // Clean up the temporary key. 46 // Clean up the temporary key.
47 RegKey key(HKEY_CURRENT_USER, L"", KEY_SET_VALUE); 47 RegKey key(HKEY_CURRENT_USER, L"", KEY_SET_VALUE);
48 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey)); 48 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey));
49 ASSERT_NE(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_READ)); 49 ASSERT_NE(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_READ));
50 } 50 }
51 51
52 static bool IsRedirectorPresent() { 52 static bool IsRedirectorPresent() {
53 #if defined(_WIN64) 53 #if defined(_WIN64)
54 return true; 54 return true;
55 #else 55 #else
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 ASSERT_TRUE(key.StartWatching(Bind(&TestChangeDelegate::OnKeyChanged, 411 ASSERT_TRUE(key.StartWatching(Bind(&TestChangeDelegate::OnKeyChanged,
412 Unretained(&delegate)))); 412 Unretained(&delegate))));
413 base::RunLoop().RunUntilIdle(); 413 base::RunLoop().RunUntilIdle();
414 EXPECT_FALSE(delegate.WasCalled()); 414 EXPECT_FALSE(delegate.WasCalled());
415 } 415 }
416 416
417 } // namespace 417 } // namespace
418 418
419 } // namespace win 419 } // namespace win
420 } // namespace base 420 } // namespace base
OLDNEW
« no previous file with comments | « base/win/registry.cc ('k') | base/win/shortcut_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698