OLD | NEW |
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/app_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/app_menu_model.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
10 #include "chrome/browser/prefs/browser_prefs.h" | 10 #include "chrome/browser/prefs/browser_prefs.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 EXPECT_TRUE(model.IsEnabledAt(index1)); | 196 EXPECT_TRUE(model.IsEnabledAt(index1)); |
197 EXPECT_EQ(0, error1->execute_count()); | 197 EXPECT_EQ(0, error1->execute_count()); |
198 model.ActivatedAt(index1); | 198 model.ActivatedAt(index1); |
199 EXPECT_EQ(1, error1->execute_count()); | 199 EXPECT_EQ(1, error1->execute_count()); |
200 | 200 |
201 EXPECT_TRUE(model.IsEnabledAt(index2)); | 201 EXPECT_TRUE(model.IsEnabledAt(index2)); |
202 EXPECT_EQ(0, error2->execute_count()); | 202 EXPECT_EQ(0, error2->execute_count()); |
203 model.ActivatedAt(index2); | 203 model.ActivatedAt(index2); |
204 EXPECT_EQ(1, error1->execute_count()); | 204 EXPECT_EQ(1, error1->execute_count()); |
205 } | 205 } |
206 | |
207 class EncodingMenuModelTest : public BrowserWithTestWindowTest, | |
208 public MenuModelTest { | |
209 }; | |
210 | |
211 TEST_F(EncodingMenuModelTest, IsCommandIdCheckedWithNoTabs) { | |
212 EncodingMenuModel model(browser()); | |
213 ASSERT_EQ(NULL, browser()->tab_strip_model()->GetActiveWebContents()); | |
214 EXPECT_FALSE(model.IsCommandIdChecked(IDC_ENCODING_WINDOWS1252)); | |
215 } | |
OLD | NEW |