Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1012)

Side by Side Diff: chrome/browser/extensions/extension_message_bubble_controller_unittest.cc

Issue 421193002: Fix ExtensionServiceTest.ClearExtensionData flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use base::DoNothing for empty callbacks Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h"
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 // Only extension 2 should have become disabled. 713 // Only extension 2 should have become disabled.
714 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId1) != NULL); 714 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId1) != NULL);
715 EXPECT_TRUE(registry->disabled_extensions().GetByID(kId2) != NULL); 715 EXPECT_TRUE(registry->disabled_extensions().GetByID(kId2) != NULL);
716 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId3) != NULL); 716 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId3) != NULL);
717 // No extension should have been acknowledged (it got disabled). 717 // No extension should have been acknowledged (it got disabled).
718 EXPECT_FALSE(prefs->HasSettingsApiBubbleBeenAcknowledged(kId1)); 718 EXPECT_FALSE(prefs->HasSettingsApiBubbleBeenAcknowledged(kId1));
719 EXPECT_FALSE(prefs->HasSettingsApiBubbleBeenAcknowledged(kId2)); 719 EXPECT_FALSE(prefs->HasSettingsApiBubbleBeenAcknowledged(kId2));
720 EXPECT_FALSE(prefs->HasSettingsApiBubbleBeenAcknowledged(kId3)); 720 EXPECT_FALSE(prefs->HasSettingsApiBubbleBeenAcknowledged(kId3));
721 721
722 // Clean up after ourselves. 722 // Clean up after ourselves.
723 service_->UninstallExtension( 723 service_->UninstallExtension(kId1,
724 kId1, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 724 extensions::UNINSTALL_REASON_FOR_TESTING,
725 service_->UninstallExtension( 725 base::Bind(&base::DoNothing),
726 kId2, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 726 NULL);
727 service_->UninstallExtension( 727 service_->UninstallExtension(kId2,
728 kId3, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 728 extensions::UNINSTALL_REASON_FOR_TESTING,
729 base::Bind(&base::DoNothing),
730 NULL);
731 service_->UninstallExtension(kId3,
732 extensions::UNINSTALL_REASON_FOR_TESTING,
733 base::Bind(&base::DoNothing),
734 NULL);
729 } 735 }
730 } 736 }
731 737
732 // The feature this is meant to test is only implemented on Windows. 738 // The feature this is meant to test is only implemented on Windows.
733 #if defined(OS_WIN) 739 #if defined(OS_WIN)
734 #define MAYBE_NtpOverriddenControllerTest NtpOverriddenControllerTest 740 #define MAYBE_NtpOverriddenControllerTest NtpOverriddenControllerTest
735 #else 741 #else
736 #define MAYBE_NtpOverriddenControllerTest DISABLED_NtpOverriddenControllerTest 742 #define MAYBE_NtpOverriddenControllerTest DISABLED_NtpOverriddenControllerTest
737 #endif 743 #endif
738 744
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 // Only extension 2 should have become disabled. 821 // Only extension 2 should have become disabled.
816 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId1) != NULL); 822 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId1) != NULL);
817 EXPECT_TRUE(registry->disabled_extensions().GetByID(kId2) != NULL); 823 EXPECT_TRUE(registry->disabled_extensions().GetByID(kId2) != NULL);
818 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId3) != NULL); 824 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId3) != NULL);
819 // No extension should have been acknowledged (it got disabled). 825 // No extension should have been acknowledged (it got disabled).
820 EXPECT_FALSE(prefs->HasNtpOverriddenBubbleBeenAcknowledged(kId1)); 826 EXPECT_FALSE(prefs->HasNtpOverriddenBubbleBeenAcknowledged(kId1));
821 EXPECT_FALSE(prefs->HasNtpOverriddenBubbleBeenAcknowledged(kId2)); 827 EXPECT_FALSE(prefs->HasNtpOverriddenBubbleBeenAcknowledged(kId2));
822 EXPECT_FALSE(prefs->HasNtpOverriddenBubbleBeenAcknowledged(kId3)); 828 EXPECT_FALSE(prefs->HasNtpOverriddenBubbleBeenAcknowledged(kId3));
823 829
824 // Clean up after ourselves. 830 // Clean up after ourselves.
825 service_->UninstallExtension( 831 service_->UninstallExtension(kId1,
826 kId1, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 832 extensions::UNINSTALL_REASON_FOR_TESTING,
827 service_->UninstallExtension( 833 base::Bind(&base::DoNothing),
828 kId2, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 834 NULL);
829 service_->UninstallExtension( 835 service_->UninstallExtension(kId2,
830 kId3, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 836 extensions::UNINSTALL_REASON_FOR_TESTING,
837 base::Bind(&base::DoNothing),
838 NULL);
839 service_->UninstallExtension(kId3,
840 extensions::UNINSTALL_REASON_FOR_TESTING,
841 base::Bind(&base::DoNothing),
842 NULL);
831 } 843 }
832 844
833 void SetInstallTime(const std::string& extension_id, 845 void SetInstallTime(const std::string& extension_id,
834 const base::Time& time, 846 const base::Time& time,
835 ExtensionPrefs* prefs) { 847 ExtensionPrefs* prefs) {
836 std::string time_str = base::Int64ToString(time.ToInternalValue()); 848 std::string time_str = base::Int64ToString(time.ToInternalValue());
837 prefs->UpdateExtensionPref(extension_id, 849 prefs->UpdateExtensionPref(extension_id,
838 "install_time", 850 "install_time",
839 new base::StringValue(time_str)); 851 new base::StringValue(time_str));
840 } 852 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 // Only extension 2 should have become disabled. 951 // Only extension 2 should have become disabled.
940 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId1) != NULL); 952 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId1) != NULL);
941 EXPECT_TRUE(registry->disabled_extensions().GetByID(kId2) != NULL); 953 EXPECT_TRUE(registry->disabled_extensions().GetByID(kId2) != NULL);
942 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId3) != NULL); 954 EXPECT_TRUE(registry->enabled_extensions().GetByID(kId3) != NULL);
943 // No extension should have been acknowledged (it got disabled). 955 // No extension should have been acknowledged (it got disabled).
944 EXPECT_FALSE(prefs->HasProxyOverriddenBubbleBeenAcknowledged(kId1)); 956 EXPECT_FALSE(prefs->HasProxyOverriddenBubbleBeenAcknowledged(kId1));
945 EXPECT_FALSE(prefs->HasProxyOverriddenBubbleBeenAcknowledged(kId2)); 957 EXPECT_FALSE(prefs->HasProxyOverriddenBubbleBeenAcknowledged(kId2));
946 EXPECT_FALSE(prefs->HasProxyOverriddenBubbleBeenAcknowledged(kId3)); 958 EXPECT_FALSE(prefs->HasProxyOverriddenBubbleBeenAcknowledged(kId3));
947 959
948 // Clean up after ourselves. 960 // Clean up after ourselves.
949 service_->UninstallExtension( 961 service_->UninstallExtension(kId1,
950 kId1, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 962 extensions::UNINSTALL_REASON_FOR_TESTING,
951 service_->UninstallExtension( 963 base::Bind(&base::DoNothing),
952 kId2, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 964 NULL);
953 service_->UninstallExtension( 965 service_->UninstallExtension(kId2,
954 kId3, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); 966 extensions::UNINSTALL_REASON_FOR_TESTING,
967 base::Bind(&base::DoNothing),
968 NULL);
969 service_->UninstallExtension(kId3,
970 extensions::UNINSTALL_REASON_FOR_TESTING,
971 base::Bind(&base::DoNothing),
972 NULL);
955 } 973 }
956 974
957 } // namespace extensions 975 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_gcm_app_handler_unittest.cc ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698