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

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: Update unit test. 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..8a59e0667cf0ce120f142e76c07852862bad4907 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.
-
Peter Kasting 2015/04/01 21:06:29 Nit: Don't remove this blank line
edwardjung 2015/04/02 13:13:28 Done.
#include "chrome/browser/ui/toolbar/wrench_menu_model.h"
#include "chrome/app/chrome_command_ids.h"
@@ -132,8 +131,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 +145,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 +156,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