| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/app/chrome_command_ids.h" |
| 8 #import "chrome/browser/ui/cocoa/accelerators_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/accelerators_cocoa.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "testing/gtest_mac.h" | 11 #include "testing/gtest_mac.h" |
| 11 #include "ui/base/accelerators/platform_accelerator_cocoa.h" | 12 #include "ui/base/accelerators/platform_accelerator_cocoa.h" |
| 12 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" | 13 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" |
| 13 | 14 |
| 14 typedef InProcessBrowserTest AcceleratorsCocoaBrowserTest; | 15 typedef InProcessBrowserTest AcceleratorsCocoaBrowserTest; |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 it->second.platform_accelerator()); | 121 it->second.platform_accelerator()); |
| 121 | 122 |
| 122 // Check that there exists a corresponding NSMenuItem. | 123 // Check that there exists a corresponding NSMenuItem. |
| 123 NSMenuItem* item = | 124 NSMenuItem* item = |
| 124 MenuContainsAccelerator([NSApp mainMenu], | 125 MenuContainsAccelerator([NSApp mainMenu], |
| 125 platform_accelerator->characters(), | 126 platform_accelerator->characters(), |
| 126 platform_accelerator->modifier_mask()); | 127 platform_accelerator->modifier_mask()); |
| 127 EXPECT_TRUE(item); | 128 EXPECT_TRUE(item); |
| 128 | 129 |
| 129 // If the menu uses a commandDispatch:, the tag must match the command id! | 130 // If the menu uses a commandDispatch:, the tag must match the command id! |
| 130 if (item.action == @selector(commandDispatch:)) | 131 // Added an exception for IDC_TOGGLE_FULLSCREEN_TOOLBAR, which conflicts |
| 132 // with IDC_PRESENTATION_MODE. |
| 133 if (item.action == @selector(commandDispatch:) |
| 134 && item.tag != IDC_TOGGLE_FULLSCREEN_TOOLBAR) |
| 131 EXPECT_EQ(item.tag, it->first); | 135 EXPECT_EQ(item.tag, it->first); |
| 132 } | 136 } |
| 133 } | 137 } |
| OLD | NEW |