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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_actions_model_unittest.cc

Issue 2332853002: [Media Router] Enable MR by default now that it is at 100% in stable. (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/ui/toolbar/toolbar_actions_model.h" 5 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 EXPECT_EQ(num_toolbar_items(), toolbar_model()->visible_icon_count()); 895 EXPECT_EQ(num_toolbar_items(), toolbar_model()->visible_icon_count());
896 toolbar_model()->OnActionToolbarPrefChange(); 896 toolbar_model()->OnActionToolbarPrefChange();
897 // Should still be at max size. 897 // Should still be at max size.
898 EXPECT_TRUE(toolbar_model()->all_icons_visible()); 898 EXPECT_TRUE(toolbar_model()->all_icons_visible());
899 EXPECT_EQ(num_toolbar_items(), toolbar_model()->visible_icon_count()); 899 EXPECT_EQ(num_toolbar_items(), toolbar_model()->visible_icon_count());
900 } 900 }
901 901
902 // Test that, in the absence of the extension-action-redesign switch, the 902 // Test that, in the absence of the extension-action-redesign switch, the
903 // model only contains extensions with browser actions and component actions. 903 // model only contains extensions with browser actions and component actions.
904 TEST_F(ToolbarActionsModelUnitTest, TestToolbarExtensionTypesDisabledSwitch) { 904 TEST_F(ToolbarActionsModelUnitTest, TestToolbarExtensionTypesDisabledSwitch) {
905 extensions::FeatureSwitch::ScopedOverride enable_media_router(
906 extensions::FeatureSwitch::media_router(), false);
905 extensions::FeatureSwitch::ScopedOverride enable_redesign( 907 extensions::FeatureSwitch::ScopedOverride enable_redesign(
906 extensions::FeatureSwitch::extension_action_redesign(), false); 908 extensions::FeatureSwitch::extension_action_redesign(), false);
907 Init(); 909 Init();
908 ASSERT_TRUE(AddActionExtensions()); 910 ASSERT_TRUE(AddActionExtensions());
909 911
910 EXPECT_EQ(1u, num_toolbar_items()); 912 EXPECT_EQ(1u, num_toolbar_items());
911 EXPECT_EQ(browser_action()->id(), GetActionIdAtIndex(0u)); 913 EXPECT_EQ(browser_action()->id(), GetActionIdAtIndex(0u));
912 } 914 }
913 915
914 // Test that, with the extension-action-redesign switch, the model contains 916 // Test that, with the extension-action-redesign switch, the model contains
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 extensions::extension_action_test_util::NO_ACTION, 965 extensions::extension_action_test_util::NO_ACTION,
964 extensions::Manifest::INTERNAL); 966 extensions::Manifest::INTERNAL);
965 EXPECT_TRUE(AddExtension(internal_extension_no_action.get())); 967 EXPECT_TRUE(AddExtension(internal_extension_no_action.get()));
966 EXPECT_EQ(4u, num_toolbar_items()); 968 EXPECT_EQ(4u, num_toolbar_items());
967 EXPECT_TRUE(ModelHasActionForId(internal_extension_no_action->id())); 969 EXPECT_TRUE(ModelHasActionForId(internal_extension_no_action->id()));
968 } 970 }
969 971
970 // Test that hiding actions on the toolbar results in their removal from the 972 // Test that hiding actions on the toolbar results in their removal from the
971 // model when the redesign switch is not enabled. 973 // model when the redesign switch is not enabled.
972 TEST_F(ToolbarActionsModelUnitTest, ActionsToolbarActionsVisibilityNoSwitch) { 974 TEST_F(ToolbarActionsModelUnitTest, ActionsToolbarActionsVisibilityNoSwitch) {
975 extensions::FeatureSwitch::ScopedOverride enable_media_router(
976 extensions::FeatureSwitch::media_router(), false);
973 extensions::FeatureSwitch::ScopedOverride enable_redesign( 977 extensions::FeatureSwitch::ScopedOverride enable_redesign(
974 extensions::FeatureSwitch::extension_action_redesign(), false); 978 extensions::FeatureSwitch::extension_action_redesign(), false);
975 Init(); 979 Init();
976 980
977 extensions::ExtensionActionAPI* action_api = 981 extensions::ExtensionActionAPI* action_api =
978 extensions::ExtensionActionAPI::Get(profile()); 982 extensions::ExtensionActionAPI::Get(profile());
979 983
980 ASSERT_TRUE(AddBrowserActionExtensions()); 984 ASSERT_TRUE(AddBrowserActionExtensions());
981 // Sanity check: Order should start as A , B, C. 985 // Sanity check: Order should start as A , B, C.
982 EXPECT_EQ(3u, num_toolbar_items()); 986 EXPECT_EQ(3u, num_toolbar_items());
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 } 1537 }
1534 1538
1535 TEST_F(ToolbarActionsModelUnitTest, 1539 TEST_F(ToolbarActionsModelUnitTest,
1536 MigrationToExtensionWithoutExtensionActionRedesign) { 1540 MigrationToExtensionWithoutExtensionActionRedesign) {
1537 InitForMigrationTest(MigrationStatus::FEATURE_DISABLED_WITH_PREF_TRUE); 1541 InitForMigrationTest(MigrationStatus::FEATURE_DISABLED_WITH_PREF_TRUE);
1538 1542
1539 // Initialization re-enables the extension. 1543 // Initialization re-enables the extension.
1540 EXPECT_EQ(1u, num_toolbar_items()); 1544 EXPECT_EQ(1u, num_toolbar_items());
1541 EXPECT_EQ(browser_action_migrated()->id(), GetActionIdAtIndex(0u)); 1545 EXPECT_EQ(browser_action_migrated()->id(), GetActionIdAtIndex(0u));
1542 } 1546 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_context_menu_model_unittest.cc ('k') | extensions/common/feature_switch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698