| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_WRITE)); | 233 ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_WRITE)); |
| 234 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(L"Foo")); | 234 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(L"Foo")); |
| 235 ASSERT_NE(ERROR_SUCCESS, key.DeleteKey(L"Foo")); | 235 ASSERT_NE(ERROR_SUCCESS, key.DeleteKey(L"Foo")); |
| 236 ASSERT_NE(ERROR_SUCCESS, | 236 ASSERT_NE(ERROR_SUCCESS, |
| 237 key.Open(HKEY_CURRENT_USER, foo_key.c_str(), KEY_READ)); | 237 key.Open(HKEY_CURRENT_USER, foo_key.c_str(), KEY_READ)); |
| 238 } | 238 } |
| 239 | 239 |
| 240 // This test requires running as an Administrator as it tests redirected | 240 // This test requires running as an Administrator as it tests redirected |
| 241 // registry writes to HKLM\Software | 241 // registry writes to HKLM\Software |
| 242 // http://msdn.microsoft.com/en-us/library/windows/desktop/aa384253.aspx | 242 // http://msdn.microsoft.com/en-us/library/windows/desktop/aa384253.aspx |
| 243 TEST_F(RegistryTest, Wow64RedirectedFromNative) { | 243 // TODO(wfh): flaky test on Vista. See http://crbug.com/377917 |
| 244 TEST_F(RegistryTest, DISABLED_Wow64RedirectedFromNative) { |
| 244 if (!IsRedirectorPresent()) | 245 if (!IsRedirectorPresent()) |
| 245 return; | 246 return; |
| 246 | 247 |
| 247 RegKey key; | 248 RegKey key; |
| 248 | 249 |
| 249 // Test redirected key access from non-redirected. | 250 // Test redirected key access from non-redirected. |
| 250 ASSERT_EQ(ERROR_SUCCESS, | 251 ASSERT_EQ(ERROR_SUCCESS, |
| 251 key.Create(HKEY_LOCAL_MACHINE, | 252 key.Create(HKEY_LOCAL_MACHINE, |
| 252 foo_software_key_.c_str(), | 253 foo_software_key_.c_str(), |
| 253 KEY_WRITE | kRedirectedViewMask)); | 254 KEY_WRITE | kRedirectedViewMask)); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 269 ASSERT_NE(ERROR_SUCCESS, key.DeleteKey(kRootKey)); | 270 ASSERT_NE(ERROR_SUCCESS, key.DeleteKey(kRootKey)); |
| 270 | 271 |
| 271 // Open the redirected view and delete the key created above. | 272 // Open the redirected view and delete the key created above. |
| 272 ASSERT_EQ(ERROR_SUCCESS, | 273 ASSERT_EQ(ERROR_SUCCESS, |
| 273 key.Open(HKEY_LOCAL_MACHINE, | 274 key.Open(HKEY_LOCAL_MACHINE, |
| 274 L"Software", | 275 L"Software", |
| 275 KEY_SET_VALUE | kRedirectedViewMask)); | 276 KEY_SET_VALUE | kRedirectedViewMask)); |
| 276 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey)); | 277 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey)); |
| 277 } | 278 } |
| 278 | 279 |
| 279 TEST_F(RegistryTest, Wow64NativeFromRedirected) { | 280 // TODO(wfh): flaky test on Vista. See http://crbug.com/377917 |
| 281 TEST_F(RegistryTest, DISABLED_Wow64NativeFromRedirected) { |
| 280 if (!IsRedirectorPresent()) | 282 if (!IsRedirectorPresent()) |
| 281 return; | 283 return; |
| 282 RegKey key; | 284 RegKey key; |
| 283 | 285 |
| 284 // Test non-redirected key access from redirected. | 286 // Test non-redirected key access from redirected. |
| 285 ASSERT_EQ(ERROR_SUCCESS, | 287 ASSERT_EQ(ERROR_SUCCESS, |
| 286 key.Create(HKEY_LOCAL_MACHINE, | 288 key.Create(HKEY_LOCAL_MACHINE, |
| 287 foo_software_key_.c_str(), | 289 foo_software_key_.c_str(), |
| 288 KEY_WRITE | kNativeViewMask)); | 290 KEY_WRITE | kNativeViewMask)); |
| 289 ASSERT_EQ(ERROR_SUCCESS, | 291 ASSERT_EQ(ERROR_SUCCESS, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 key.Open(HKEY_CURRENT_USER, foo_key.c_str(), KEY_READ)); | 328 key.Open(HKEY_CURRENT_USER, foo_key.c_str(), KEY_READ)); |
| 327 | 329 |
| 328 ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_WRITE)); | 330 ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_WRITE)); |
| 329 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(L"foo")); | 331 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(L"foo")); |
| 330 } | 332 } |
| 331 | 333 |
| 332 } // namespace | 334 } // namespace |
| 333 | 335 |
| 334 } // namespace win | 336 } // namespace win |
| 335 } // namespace base | 337 } // namespace base |
| OLD | NEW |