| 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/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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 ASSERT_NE(ERROR_SUCCESS, key.DeleteKey(kRootKey)); | 270 ASSERT_NE(ERROR_SUCCESS, key.DeleteKey(kRootKey)); |
| 271 | 271 |
| 272 // Open the redirected view and delete the key created above. | 272 // Open the redirected view and delete the key created above. |
| 273 ASSERT_EQ(ERROR_SUCCESS, | 273 ASSERT_EQ(ERROR_SUCCESS, |
| 274 key.Open(HKEY_LOCAL_MACHINE, | 274 key.Open(HKEY_LOCAL_MACHINE, |
| 275 L"Software", | 275 L"Software", |
| 276 KEY_SET_VALUE | kRedirectedViewMask)); | 276 KEY_SET_VALUE | kRedirectedViewMask)); |
| 277 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey)); | 277 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey)); |
| 278 } | 278 } |
| 279 | 279 |
| 280 // Test for the issue found in http://crbug.com/384587 where OpenKey would call |
| 281 // Close() and reset wow64_access_ flag to 0 and cause a NOTREACHED to hit on a |
| 282 // subsequent OpenKey call. |
| 283 TEST_F(RegistryTest, SameWowFlags) { |
| 284 RegKey key; |
| 285 |
| 286 ASSERT_EQ(ERROR_SUCCESS, |
| 287 key.Open(HKEY_LOCAL_MACHINE, |
| 288 L"Software", |
| 289 KEY_READ | KEY_WOW64_64KEY)); |
| 290 ASSERT_EQ(ERROR_SUCCESS, |
| 291 key.OpenKey(L"Microsoft", |
| 292 KEY_READ | KEY_WOW64_64KEY)); |
| 293 ASSERT_EQ(ERROR_SUCCESS, |
| 294 key.OpenKey(L"Windows", |
| 295 KEY_READ | KEY_WOW64_64KEY)); |
| 296 } |
| 297 |
| 280 // TODO(wfh): flaky test on Vista. See http://crbug.com/377917 | 298 // TODO(wfh): flaky test on Vista. See http://crbug.com/377917 |
| 281 TEST_F(RegistryTest, DISABLED_Wow64NativeFromRedirected) { | 299 TEST_F(RegistryTest, DISABLED_Wow64NativeFromRedirected) { |
| 282 if (!IsRedirectorPresent()) | 300 if (!IsRedirectorPresent()) |
| 283 return; | 301 return; |
| 284 RegKey key; | 302 RegKey key; |
| 285 | 303 |
| 286 // Test non-redirected key access from redirected. | 304 // Test non-redirected key access from redirected. |
| 287 ASSERT_EQ(ERROR_SUCCESS, | 305 ASSERT_EQ(ERROR_SUCCESS, |
| 288 key.Create(HKEY_LOCAL_MACHINE, | 306 key.Create(HKEY_LOCAL_MACHINE, |
| 289 foo_software_key_.c_str(), | 307 foo_software_key_.c_str(), |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 key.Open(HKEY_CURRENT_USER, foo_key.c_str(), KEY_READ)); | 346 key.Open(HKEY_CURRENT_USER, foo_key.c_str(), KEY_READ)); |
| 329 | 347 |
| 330 ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_WRITE)); | 348 ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_WRITE)); |
| 331 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(L"foo")); | 349 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(L"foo")); |
| 332 } | 350 } |
| 333 | 351 |
| 334 } // namespace | 352 } // namespace |
| 335 | 353 |
| 336 } // namespace win | 354 } // namespace win |
| 337 } // namespace base | 355 } // namespace base |
| OLD | NEW |