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

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: Address review comments 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
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..7d6adc5659f324706b84df476d0f4890e1da29b9 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
@@ -1,7 +1,6 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
#include "chrome/browser/ui/toolbar/wrench_menu_model.h"
#include "chrome/app/chrome_command_ids.h"
@@ -132,8 +131,13 @@ 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.
+#if defined(OS_MACOSX) || defined(CHROMEOS)
model.ActivatedAt(2);
EXPECT_TRUE(model.IsEnabledAt(2));
+#else
+ model.ActivatedAt(3);
+ EXPECT_TRUE(model.IsEnabledAt(3));
+#endif
EXPECT_EQ(model.execute_count_, 2);
EXPECT_EQ(model.enable_count_, 2);
@@ -145,7 +149,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 +160,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);
}

Powered by Google App Engine
This is Rietveld 408576698