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

Side by Side Diff: chrome/browser/ui/gtk/accelerators_gtk_unittest.cc

Issue 8695005: Move accelerator related files to ui/base/accelerators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/gtk/accelerators_gtk.h ('k') | chrome/browser/ui/gtk/browser_toolbar_gtk.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <gdk/gdkkeysyms.h> 5 #include <gdk/gdkkeysyms.h>
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/ui/gtk/accelerators_gtk.h" 9 #include "chrome/browser/ui/gtk/accelerators_gtk.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/base/models/accelerator_gtk.h" 11 #include "ui/base/accelerators/accelerator_gtk.h"
12 12
13 TEST(AcceleratorsGtkTest, GetAccelerator) { 13 TEST(AcceleratorsGtkTest, GetAccelerator) {
14 AcceleratorsGtk* keymap = AcceleratorsGtk::GetInstance(); 14 AcceleratorsGtk* keymap = AcceleratorsGtk::GetInstance();
15 const ui::AcceleratorGtk* accelerator = 15 const ui::AcceleratorGtk* accelerator =
16 keymap->GetPrimaryAcceleratorForCommand(IDC_COPY); 16 keymap->GetPrimaryAcceleratorForCommand(IDC_COPY);
17 ASSERT_TRUE(accelerator); 17 ASSERT_TRUE(accelerator);
18 EXPECT_EQ(static_cast<guint>(GDK_c), accelerator->GetGdkKeyCode()); 18 EXPECT_EQ(static_cast<guint>(GDK_c), accelerator->GetGdkKeyCode());
19 EXPECT_EQ(GDK_CONTROL_MASK, accelerator->modifiers()); 19 EXPECT_EQ(GDK_CONTROL_MASK, accelerator->modifiers());
20 } 20 }
21 21
22 TEST(AcceleratorsGtkTest, GetNullAccelerator) { 22 TEST(AcceleratorsGtkTest, GetNullAccelerator) {
23 AcceleratorsGtk* keymap = AcceleratorsGtk::GetInstance(); 23 AcceleratorsGtk* keymap = AcceleratorsGtk::GetInstance();
24 const ui::AcceleratorGtk* accelerator = 24 const ui::AcceleratorGtk* accelerator =
25 keymap->GetPrimaryAcceleratorForCommand(IDC_MinimumLabelValue - 1); 25 keymap->GetPrimaryAcceleratorForCommand(IDC_MinimumLabelValue - 1);
26 EXPECT_FALSE(accelerator); 26 EXPECT_FALSE(accelerator);
27 } 27 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/accelerators_gtk.h ('k') | chrome/browser/ui/gtk/browser_toolbar_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698