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

Side by Side Diff: chrome/browser/cocoa/accelerators_cocoa_unittest.mm

Issue 4710001: Split out command IDs from chrome_dll_resource.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "app/menus/accelerator_cocoa.h" 7 #include "app/menus/accelerator_cocoa.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "chrome/app/chrome_dll_resource.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #import "chrome/browser/cocoa/accelerators_cocoa.h" 10 #import "chrome/browser/cocoa/accelerators_cocoa.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/gtest_mac.h" 12 #include "testing/gtest_mac.h"
13 13
14 TEST(AcceleratorsCocoaTest, GetAccelerator) { 14 TEST(AcceleratorsCocoaTest, GetAccelerator) {
15 AcceleratorsCocoa* keymap = Singleton<AcceleratorsCocoa>::get(); 15 AcceleratorsCocoa* keymap = Singleton<AcceleratorsCocoa>::get();
16 const menus::AcceleratorCocoa* accelerator = 16 const menus::AcceleratorCocoa* accelerator =
17 keymap->GetAcceleratorForCommand(IDC_COPY); 17 keymap->GetAcceleratorForCommand(IDC_COPY);
18 ASSERT_TRUE(accelerator); 18 ASSERT_TRUE(accelerator);
19 EXPECT_NSEQ(@"c", accelerator->characters()); 19 EXPECT_NSEQ(@"c", accelerator->characters());
20 EXPECT_EQ(static_cast<int>(NSCommandKeyMask), accelerator->modifiers()); 20 EXPECT_EQ(static_cast<int>(NSCommandKeyMask), accelerator->modifiers());
21 } 21 }
22 22
23 TEST(AcceleratorsCocoaTest, GetNullAccelerator) { 23 TEST(AcceleratorsCocoaTest, GetNullAccelerator) {
24 AcceleratorsCocoa* keymap = Singleton<AcceleratorsCocoa>::get(); 24 AcceleratorsCocoa* keymap = Singleton<AcceleratorsCocoa>::get();
25 const menus::AcceleratorCocoa* accelerator = 25 const menus::AcceleratorCocoa* accelerator =
26 keymap->GetAcceleratorForCommand(314159265); 26 keymap->GetAcceleratorForCommand(314159265);
27 EXPECT_FALSE(accelerator); 27 EXPECT_FALSE(accelerator);
28 } 28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698