| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import <Cocoa/Cocoa.h> |
| 6 |
| 7 #include "app/menus/accelerator_cocoa.h" |
| 8 #include "base/singleton.h" |
| 9 #include "chrome/app/chrome_dll_resource.h" |
| 10 #import "chrome/browser/cocoa/accelerators_cocoa.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 |
| 13 TEST(AcceleratorsCocoaTest, GetAccelerator) { |
| 14 AcceleratorsCocoa* keymap = Singleton<AcceleratorsCocoa>::get(); |
| 15 const menus::AcceleratorCocoa* accelerator = |
| 16 keymap->GetAcceleratorForCommand(IDC_COPY); |
| 17 ASSERT_TRUE(accelerator); |
| 18 EXPECT_TRUE([@"c" isEqualToString:accelerator->characters()]); |
| 19 EXPECT_EQ(NSCommandKeyMask, accelerator->modifiers()); |
| 20 } |
| 21 |
| 22 TEST(AcceleratorsCocoaTest, GetNullAccelerator) { |
| 23 AcceleratorsCocoa* keymap = Singleton<AcceleratorsCocoa>::get(); |
| 24 const menus::AcceleratorCocoa* accelerator = |
| 25 keymap->GetAcceleratorForCommand(314159265); |
| 26 EXPECT_FALSE(accelerator); |
| 27 } |
| OLD | NEW |