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

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

Issue 2133013002: AcceleratorProvider: Make GetAcceleratorForCommandId const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix overrides on Mac and Chrome OS. Created 4 years, 5 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
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/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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 DISALLOW_COPY_AND_ASSIGN(MenuError); 52 DISALLOW_COPY_AND_ASSIGN(MenuError);
53 }; 53 };
54 54
55 } // namespace 55 } // namespace
56 56
57 class AppMenuModelTest : public BrowserWithTestWindowTest, 57 class AppMenuModelTest : public BrowserWithTestWindowTest,
58 public ui::AcceleratorProvider { 58 public ui::AcceleratorProvider {
59 public: 59 public:
60 // Don't handle accelerators. 60 // Don't handle accelerators.
61 bool GetAcceleratorForCommandId(int command_id, 61 bool GetAcceleratorForCommandId(int command_id,
62 ui::Accelerator* accelerator) override { 62 ui::Accelerator* accelerator) const override {
63 return false; 63 return false;
64 } 64 }
65 65
66 protected: 66 protected:
67 void SetUp() override { 67 void SetUp() override {
68 prefs_.reset(new TestingPrefServiceSimple()); 68 prefs_.reset(new TestingPrefServiceSimple());
69 chrome::RegisterLocalState(prefs_->registry()); 69 chrome::RegisterLocalState(prefs_->registry());
70 70
71 TestingBrowserProcess::GetGlobal()->SetLocalState(prefs_.get()); 71 TestingBrowserProcess::GetGlobal()->SetLocalState(prefs_.get());
72 testing_io_thread_state_.reset(new chrome::TestingIOThreadState()); 72 testing_io_thread_state_.reset(new chrome::TestingIOThreadState());
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 class EncodingMenuModelTest : public BrowserWithTestWindowTest, 207 class EncodingMenuModelTest : public BrowserWithTestWindowTest,
208 public MenuModelTest { 208 public MenuModelTest {
209 }; 209 };
210 210
211 TEST_F(EncodingMenuModelTest, IsCommandIdCheckedWithNoTabs) { 211 TEST_F(EncodingMenuModelTest, IsCommandIdCheckedWithNoTabs) {
212 EncodingMenuModel model(browser()); 212 EncodingMenuModel model(browser());
213 ASSERT_EQ(NULL, browser()->tab_strip_model()->GetActiveWebContents()); 213 ASSERT_EQ(NULL, browser()->tab_strip_model()->GetActiveWebContents());
214 EXPECT_FALSE(model.IsCommandIdChecked(IDC_ENCODING_WINDOWS1252)); 214 EXPECT_FALSE(model.IsCommandIdChecked(IDC_ENCODING_WINDOWS1252));
215 } 215 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/app_menu_model.cc ('k') | chrome/browser/ui/toolbar/media_router_contextual_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698