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

Unified Diff: chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc

Issue 539543002: Fix two bugs in the extension actions toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/toolbar/browser_actions_container.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc b/chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc
index 0b2abb8bf6109517468d9802e8242e843ae3bd20..6704a7b39c44877cd866a962eb3742aa4df31379 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc
@@ -229,6 +229,30 @@ IN_PROC_BROWSER_TEST_F(BrowserActionsContainerTest, Visibility) {
ASSERT_TRUE(container->chevron());
EXPECT_TRUE(container->chevron()->visible());
EXPECT_FALSE(container->GetPreferredSize().IsEmpty());
+
+ // Reset visibility count to 2. State should be A, B, [C], and the chevron
+ // should be visible.
+ browser_actions_bar()->SetIconVisibilityCount(2);
+ EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions());
+ EXPECT_EQ(idA, browser_actions_bar()->GetExtensionId(0));
+ EXPECT_EQ(idB, browser_actions_bar()->GetExtensionId(1));
+ EXPECT_TRUE(container->chevron()->visible());
+
+ // Disable C (the overflowed extension). State should now be A, B, and the
+ // chevron should be hidden.
+ DisableExtension(idC);
+ EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions());
+ EXPECT_EQ(idA, browser_actions_bar()->GetExtensionId(0));
+ EXPECT_EQ(idB, browser_actions_bar()->GetExtensionId(1));
+ EXPECT_FALSE(container->chevron()->visible());
+
+ // Re-enable C. We should still only have 2 visible icons, and the chevron
+ // should be visible.
+ EnableExtension(idC);
+ EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions());
+ EXPECT_EQ(idA, browser_actions_bar()->GetExtensionId(0));
+ EXPECT_EQ(idB, browser_actions_bar()->GetExtensionId(1));
+ EXPECT_TRUE(container->chevron()->visible());
}
IN_PROC_BROWSER_TEST_F(BrowserActionsContainerTest, ForceHide) {
« no previous file with comments | « chrome/browser/ui/views/toolbar/browser_actions_container.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698