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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cstring> | 9 #include <cstring> |
10 #include <vector> | 10 #include <vector> |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 KEY_SET_VALUE | kRedirectedViewMask)); | 327 KEY_SET_VALUE | kRedirectedViewMask)); |
328 ASSERT_NE(ERROR_SUCCESS, key.DeleteKey(kRootKey)); | 328 ASSERT_NE(ERROR_SUCCESS, key.DeleteKey(kRootKey)); |
329 | 329 |
330 ASSERT_EQ(ERROR_SUCCESS, | 330 ASSERT_EQ(ERROR_SUCCESS, |
331 key.Open(HKEY_LOCAL_MACHINE, | 331 key.Open(HKEY_LOCAL_MACHINE, |
332 L"Software", | 332 L"Software", |
333 KEY_SET_VALUE | kNativeViewMask)); | 333 KEY_SET_VALUE | kNativeViewMask)); |
334 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey)); | 334 ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey)); |
335 } | 335 } |
336 | 336 |
337 // Test is flaky. crbug.com/721245 | 337 TEST_F(RegistryTest, OpenSubKey) { |
338 TEST_F(RegistryTest, DISABLED_OpenSubKey) { | |
339 RegKey key; | 338 RegKey key; |
340 ASSERT_EQ(ERROR_SUCCESS, | 339 ASSERT_EQ(ERROR_SUCCESS, |
341 key.Open(HKEY_CURRENT_USER, | 340 key.Open(HKEY_CURRENT_USER, |
342 kRootKey, | 341 kRootKey, |
343 KEY_READ | KEY_CREATE_SUB_KEY)); | 342 KEY_READ | KEY_CREATE_SUB_KEY)); |
344 | 343 |
345 ASSERT_NE(ERROR_SUCCESS, key.OpenKey(L"foo", KEY_READ)); | 344 ASSERT_NE(ERROR_SUCCESS, key.OpenKey(L"foo", KEY_READ)); |
346 ASSERT_EQ(ERROR_SUCCESS, key.CreateKey(L"foo", KEY_READ)); | 345 ASSERT_EQ(ERROR_SUCCESS, key.CreateKey(L"foo", KEY_READ)); |
347 ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_READ)); | 346 ASSERT_EQ(ERROR_SUCCESS, key.Open(HKEY_CURRENT_USER, kRootKey, KEY_READ)); |
348 ASSERT_EQ(ERROR_SUCCESS, key.OpenKey(L"foo", KEY_READ)); | 347 ASSERT_EQ(ERROR_SUCCESS, key.OpenKey(L"foo", KEY_READ)); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 ASSERT_TRUE(key.StartWatching(Bind(&TestChangeDelegate::OnKeyChanged, | 414 ASSERT_TRUE(key.StartWatching(Bind(&TestChangeDelegate::OnKeyChanged, |
416 Unretained(&delegate)))); | 415 Unretained(&delegate)))); |
417 base::RunLoop().RunUntilIdle(); | 416 base::RunLoop().RunUntilIdle(); |
418 EXPECT_FALSE(delegate.WasCalled()); | 417 EXPECT_FALSE(delegate.WasCalled()); |
419 } | 418 } |
420 | 419 |
421 } // namespace | 420 } // namespace |
422 | 421 |
423 } // namespace win | 422 } // namespace win |
424 } // namespace base | 423 } // namespace base |
OLD | NEW |