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

Unified Diff: chrome/browser/extensions/extension_toolbar_model_browsertest.cc

Issue 296983014: Fix issue with browser action toolbar putting all extension icons in overflow once sync happens. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Polish Created 6 years, 7 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
Index: chrome/browser/extensions/extension_toolbar_model_browsertest.cc
diff --git a/chrome/browser/extensions/extension_toolbar_model_browsertest.cc b/chrome/browser/extensions/extension_toolbar_model_browsertest.cc
index e9d5a98fd5e0329f76fb3b8e061bb98a3e085070..d58f9fafcd140f3327d9305c11f5ba1303c8654d 100644
--- a/chrome/browser/extensions/extension_toolbar_model_browsertest.cc
+++ b/chrome/browser/extensions/extension_toolbar_model_browsertest.cc
@@ -584,4 +584,26 @@ IN_PROC_BROWSER_TEST_F(ExtensionToolbarModelTest, HighlightModeAdd) {
EXPECT_EQ(id_c, ExtensionAt(2)->id());
}
+IN_PROC_BROWSER_TEST_F(ExtensionToolbarModelTest, SizeAfterPrefChange) {
+ // Load two extensions with browser action.
+ base::FilePath extension_a_path(test_data_dir_.AppendASCII("api_test")
+ .AppendASCII("browser_action")
+ .AppendASCII("basics"));
+ ASSERT_TRUE(LoadExtension(extension_a_path));
+ base::FilePath extension_b_path(test_data_dir_.AppendASCII("api_test")
+ .AppendASCII("browser_action")
+ .AppendASCII("popup"));
+ ASSERT_TRUE(LoadExtension(extension_b_path));
+ std::string id_a = ExtensionAt(0)->id();
+ std::string id_b = ExtensionAt(1)->id();
+
+ // Should be at max size (-1).
+ EXPECT_EQ(-1, model_->GetVisibleIconCount());
+
+ model_->OnExtensionToolbarPrefChange();
+
+ // Should still be at max size.
+ EXPECT_EQ(-1, model_->GetVisibleIconCount());
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698