OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/installer/setup/setup_util_unittest.h" | 5 #include "chrome/installer/setup/setup_util_unittest.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 } | 610 } |
611 | 611 |
612 ASSERT_TRUE(RegKey(root_, path_.c_str(), KEY_WRITE).Valid()); | 612 ASSERT_TRUE(RegKey(root_, path_.c_str(), KEY_WRITE).Valid()); |
613 DeleteRegistryKeyPartial(root_, path_.c_str(), to_preserve_); | 613 DeleteRegistryKeyPartial(root_, path_.c_str(), to_preserve_); |
614 ASSERT_TRUE(RegKey(root_, path_.c_str(), KEY_READ).Valid()); | 614 ASSERT_TRUE(RegKey(root_, path_.c_str(), KEY_READ).Valid()); |
615 | 615 |
616 // Ensure that the preserved subkeys are still present. | 616 // Ensure that the preserved subkeys are still present. |
617 { | 617 { |
618 base::win::RegistryKeyIterator it(root_, path_.c_str()); | 618 base::win::RegistryKeyIterator it(root_, path_.c_str()); |
619 ASSERT_EQ(to_preserve_.size(), it.SubkeyCount()); | 619 ASSERT_EQ(to_preserve_.size(), it.SubkeyCount()); |
620 for (; it.Valid(); ++it) { | 620 for (it; it.Valid(); ++it) { |
621 ASSERT_NE(to_preserve_.end(), | 621 ASSERT_NE(to_preserve_.end(), |
622 std::find_if(to_preserve_.begin(), to_preserve_.end(), | 622 std::find_if(to_preserve_.begin(), to_preserve_.end(), |
623 [&it](const base::string16& key_name) { | 623 [&it](const base::string16& key_name) { |
624 return base::ToLowerASCII(it.Name()) == | 624 return base::ToLowerASCII(it.Name()) == |
625 base::ToLowerASCII(key_name); | 625 base::ToLowerASCII(key_name); |
626 })) | 626 })) |
627 << it.Name(); | 627 << it.Name(); |
628 } | 628 } |
629 } | 629 } |
630 | 630 |
631 // Ensure that all values are absent. | 631 // Ensure that all values are absent. |
632 { | 632 { |
633 base::win::RegistryValueIterator it(root_, path_.c_str()); | 633 base::win::RegistryValueIterator it(root_, path_.c_str()); |
634 ASSERT_EQ(0, it.ValueCount()); | 634 ASSERT_EQ(0, it.ValueCount()); |
635 } | 635 } |
636 } | 636 } |
637 | 637 |
638 } // namespace installer | 638 } // namespace installer |
OLD | NEW |