| 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/install_worker.h" | 5 #include "chrome/installer/setup/install_worker.h" |
| 6 | 6 |
| 7 #include "base/win/registry.h" | 7 #include "base/win/registry.h" |
| 8 #include "base/version.h" | 8 #include "base/version.h" |
| 9 #include "chrome/common/chrome_constants.h" | 9 #include "chrome/common/chrome_constants.h" |
| 10 #include "chrome/installer/setup/setup_util.h" | 10 #include "chrome/installer/setup/setup_util.h" |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 AddDeleteRegValueWorkItem( | 665 AddDeleteRegValueWorkItem( |
| 666 Eq(installer_state->root_key()), | 666 Eq(installer_state->root_key()), |
| 667 StrEq(chrome_dist->GetStateKey()), | 667 StrEq(chrome_dist->GetStateKey()), |
| 668 StrEq(google_update::kRegUsageStatsField))).Times(1); | 668 StrEq(google_update::kRegUsageStatsField))).Times(1); |
| 669 | 669 |
| 670 AddUsageStatsWorkItems(*installation_state.get(), | 670 AddUsageStatsWorkItems(*installation_state.get(), |
| 671 *installer_state.get(), | 671 *installer_state.get(), |
| 672 &work_item_list); | 672 &work_item_list); |
| 673 } | 673 } |
| 674 | 674 |
| 675 TEST_F(InstallWorkerTest, ConvertGUIDToMSIUserDataFormatTest) { |
| 676 base::string16 converted_empty_guid( |
| 677 installer::ConvertGUIDToMSIUserDataFormat(L"")); |
| 678 EXPECT_TRUE(converted_empty_guid.empty()); |
| 679 |
| 680 base::string16 malformed_guid( |
| 681 installer::ConvertGUIDToMSIUserDataFormat(L"Marmite!")); |
| 682 EXPECT_TRUE(malformed_guid.empty()); |
| 683 |
| 684 base::string16 short_guid( |
| 685 installer::ConvertGUIDToMSIUserDataFormat( |
| 686 L"Marmite!-Marm-Mite-Marm-Mite")); |
| 687 EXPECT_TRUE(short_guid.empty()); |
| 688 |
| 689 base::string16 long_guid( |
| 690 installer::ConvertGUIDToMSIUserDataFormat( |
| 691 L"Marmite!-Marm-Mite-Marm-MiteMarmiteMarmiteMarmite")); |
| 692 EXPECT_TRUE(long_guid.empty()); |
| 693 |
| 694 base::string16 off_by_one_guid( |
| 695 installer::ConvertGUIDToMSIUserDataFormat( |
| 696 L"Marmite!!-Marm-Mite-Marm-MiteMarmite")); |
| 697 EXPECT_TRUE(long_guid.empty()); |
| 698 |
| 699 base::string16 correct_guid( |
| 700 installer::ConvertGUIDToMSIUserDataFormat( |
| 701 L"BED0D2F3-7407-3B43-A48F-6C33BC3D5DAD")); |
| 702 EXPECT_EQ(L"3F2D0DEB704734B34AF8C633CBD3D5DA", correct_guid); |
| 703 } |
| 704 |
| 675 // The Quick Enable tests only make sense for the Google Chrome build as it | 705 // The Quick Enable tests only make sense for the Google Chrome build as it |
| 676 // interacts with registry values that are specific to Google Update. | 706 // interacts with registry values that are specific to Google Update. |
| 677 #if defined(GOOGLE_CHROME_BUILD) | 707 #if defined(GOOGLE_CHROME_BUILD) |
| 678 | 708 |
| 679 // Test scenarios under which the quick-enable-cf command should not exist after | 709 // Test scenarios under which the quick-enable-cf command should not exist after |
| 680 // the run. We're permissive in that we allow the DeleteRegKeyWorkItem even if | 710 // the run. We're permissive in that we allow the DeleteRegKeyWorkItem even if |
| 681 // it isn't strictly needed. | 711 // it isn't strictly needed. |
| 682 class QuickEnableAbsentTest : public InstallWorkerTest { | 712 class QuickEnableAbsentTest : public InstallWorkerTest { |
| 683 public: | 713 public: |
| 684 virtual void SetUp() { | 714 virtual void SetUp() { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 prod_type_list[i_type_check]); | 828 prod_type_list[i_type_check]); |
| 799 bool prod_expect = (mach_after & (1 << i_type_check)) != 0; | 829 bool prod_expect = (mach_after & (1 << i_type_check)) != 0; |
| 800 EXPECT_EQ(prod_expect, prod_res); | 830 EXPECT_EQ(prod_expect, prod_res); |
| 801 } | 831 } |
| 802 } | 832 } |
| 803 } | 833 } |
| 804 } | 834 } |
| 805 } | 835 } |
| 806 | 836 |
| 807 #endif // defined(GOOGLE_CHROME_BUILD) | 837 #endif // defined(GOOGLE_CHROME_BUILD) |
| OLD | NEW |