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

Unified Diff: chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc

Issue 1007993004: Restructure the wrench menu into an action based order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 5 years, 9 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/toolbar/wrench_menu_model.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/toolbar/wrench_menu_model_unittest.cc
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
index dd0882290585707b7294663383ec0c9878a62127..8801cc6c7bbf1a11a78b5036545830c38f8e1844 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
@@ -132,8 +132,9 @@ TEST_F(WrenchMenuModelTest, Basics) {
model.ActivatedAt(1);
EXPECT_TRUE(model.IsEnabledAt(1));
// Make sure to use the index that is not separator in all configurations.
- model.ActivatedAt(2);
- EXPECT_TRUE(model.IsEnabledAt(2));
+ model.ActivatedAt(itemCount - 1);
+ EXPECT_TRUE(model.IsEnabledAt(itemCount - 1));
+
EXPECT_EQ(model.execute_count_, 2);
EXPECT_EQ(model.enable_count_, 2);
@@ -145,7 +146,8 @@ TEST_F(WrenchMenuModelTest, Basics) {
int bookmarksModelIndex = -1;
for (int i = 0; i < itemCount; ++i) {
if (model.GetTypeAt(i) == ui::MenuModel::TYPE_SUBMENU) {
- bookmarksModelIndex = i;
+ // Tabs is the first submenu item. Bookmarks submenu is under tabs.
+ bookmarksModelIndex = i + 1;
break;
}
}
@@ -155,8 +157,10 @@ TEST_F(WrenchMenuModelTest, Basics) {
// The bookmarks model may be empty until we tell it we're going to show it.
bookmarksModel->MenuWillShow();
EXPECT_GT(bookmarksModel->GetItemCount(), 1);
- bookmarksModel->ActivatedAt(1);
- EXPECT_TRUE(bookmarksModel->IsEnabledAt(1));
+
+ // Bookmark manager item.
+ bookmarksModel->ActivatedAt(4);
+ EXPECT_TRUE(bookmarksModel->IsEnabledAt(4));
EXPECT_EQ(model.execute_count_, 1);
EXPECT_EQ(model.enable_count_, 1);
}
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698