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

Side by Side Diff: chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc

Issue 1182493009: Wrench menu reorg phase 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge error Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" 5 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/defaults.h" 8 #include "chrome/browser/defaults.h"
9 #include "chrome/browser/prefs/browser_prefs.h" 9 #include "chrome/browser/prefs/browser_prefs.h"
10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 EXPECT_EQ(model.enable_count_, 2); 147 EXPECT_EQ(model.enable_count_, 2);
148 148
149 model.execute_count_ = 0; 149 model.execute_count_ = 0;
150 model.enable_count_ = 0; 150 model.enable_count_ = 0;
151 151
152 // Choose something from the bookmark submenu and make sure it makes it back 152 // Choose something from the bookmark submenu and make sure it makes it back
153 // to the delegate as well. 153 // to the delegate as well.
154 int bookmarksModelIndex = -1; 154 int bookmarksModelIndex = -1;
155 for (int i = 0; i < itemCount; ++i) { 155 for (int i = 0; i < itemCount; ++i) {
156 if (model.GetTypeAt(i) == ui::MenuModel::TYPE_SUBMENU) { 156 if (model.GetTypeAt(i) == ui::MenuModel::TYPE_SUBMENU) {
157 // Tabs is the first submenu item. Bookmarks submenu is under tabs. 157 // The bookmarks submenu comes after the Tabs and Downloads items.
158 bookmarksModelIndex = i + 1; 158 bookmarksModelIndex = i + 2;
159 break; 159 break;
160 } 160 }
161 } 161 }
162 EXPECT_GT(bookmarksModelIndex, -1); 162 EXPECT_GT(bookmarksModelIndex, -1);
163 ui::MenuModel* bookmarksModel = model.GetSubmenuModelAt(bookmarksModelIndex); 163 ui::MenuModel* bookmarksModel = model.GetSubmenuModelAt(bookmarksModelIndex);
164 EXPECT_TRUE(bookmarksModel); 164 EXPECT_TRUE(bookmarksModel);
165 // The bookmarks model may be empty until we tell it we're going to show it. 165 // The bookmarks model may be empty until we tell it we're going to show it.
166 bookmarksModel->MenuWillShow(); 166 bookmarksModel->MenuWillShow();
167 EXPECT_GT(bookmarksModel->GetItemCount(), 1); 167 EXPECT_GT(bookmarksModel->GetItemCount(), 1);
168 168
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 class EncodingMenuModelTest : public BrowserWithTestWindowTest, 208 class EncodingMenuModelTest : public BrowserWithTestWindowTest,
209 public MenuModelTest { 209 public MenuModelTest {
210 }; 210 };
211 211
212 TEST_F(EncodingMenuModelTest, IsCommandIdCheckedWithNoTabs) { 212 TEST_F(EncodingMenuModelTest, IsCommandIdCheckedWithNoTabs) {
213 EncodingMenuModel model(browser()); 213 EncodingMenuModel model(browser());
214 ASSERT_EQ(NULL, browser()->tab_strip_model()->GetActiveWebContents()); 214 ASSERT_EQ(NULL, browser()->tab_strip_model()->GetActiveWebContents());
215 EXPECT_FALSE(model.IsCommandIdChecked(IDC_ENCODING_WINDOWS1252)); 215 EXPECT_FALSE(model.IsCommandIdChecked(IDC_ENCODING_WINDOWS1252));
216 } 216 }
OLDNEW
« 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