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

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: Corrected bookmark 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..c7b2b0d0cf0a7f33bb2ca0bde959f5fbaf195d48 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
@@ -1,6 +1,7 @@
// 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 <stdio.h>
Peter Kasting 2015/03/30 19:37:02 Why add this?
edwardjung 2015/03/31 11:44:06 Removed, debug.
#include "chrome/browser/ui/toolbar/wrench_menu_model.h"
@@ -132,8 +133,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.
Peter Kasting 2015/03/30 19:37:02 Is there an index that is a non-separator in all p
edwardjung 2015/03/31 11:44:05 Let me find something that works for all. i tried
+#if defined(OS_MACOSX) or defined(CHROMEOS)
Peter Kasting 2015/03/30 19:37:02 "or" needs to be ||, this won't work as you have i
edwardjung 2015/03/31 11:44:05 Done.
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 +151,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;
+ // Bookmarks is now under the tabs submenu item.
Peter Kasting 2015/03/30 19:37:02 What does "now" mean? This seems to be implicitly
edwardjung 2015/03/31 11:44:05 Done.
+ bookmarksModelIndex = i + 1;
break;
}
}
@@ -155,8 +162,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