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

Unified Diff: chrome/browser/ui/views/frame/browser_view_unittest.cc

Issue 2535543002: MacViews: Fix BrowserViewTest.RepeatedAccelerators. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view_unittest.cc
diff --git a/chrome/browser/ui/views/frame/browser_view_unittest.cc b/chrome/browser/ui/views/frame/browser_view_unittest.cc
index 66f8594123d1ba10e3e80b06b408d567c8e091e3..470136e06391032985d0ca41774ad9f5ce8c20ac 100644
--- a/chrome/browser/ui/views/frame/browser_view_unittest.cc
+++ b/chrome/browser/ui/views/frame/browser_view_unittest.cc
@@ -21,6 +21,12 @@
namespace {
+#if defined(OS_MACOSX)
+const ui::EventFlags kPlatformModifier = ui::EF_COMMAND_DOWN;
+#else
+const ui::EventFlags kPlatformModifier = ui::EF_CONTROL_DOWN;
+#endif // OS_MACOSX
+
// Tab strip bounds depend on the window frame sizes.
gfx::Point ExpectedTabStripOrigin(BrowserView* browser_view) {
gfx::Rect tabstrip_bounds(
@@ -166,12 +172,12 @@ TEST_F(BrowserViewTest, BrowserViewLayout) {
// by IsCommandRepeatable() in chrome/browser/ui/views/accelerator_table.h.
TEST_F(BrowserViewTest, RepeatedAccelerators) {
// A non-repeated Ctrl-L accelerator should be processed.
- const ui::Accelerator kLocationAccel(ui::VKEY_L, ui::EF_CONTROL_DOWN);
+ const ui::Accelerator kLocationAccel(ui::VKEY_L, kPlatformModifier);
EXPECT_TRUE(browser_view()->AcceleratorPressed(kLocationAccel));
// If the accelerator is repeated, it should be ignored.
const ui::Accelerator kLocationRepeatAccel(
- ui::VKEY_L, ui::EF_CONTROL_DOWN | ui::EF_IS_REPEAT);
+ ui::VKEY_L, kPlatformModifier | ui::EF_IS_REPEAT);
EXPECT_FALSE(browser_view()->AcceleratorPressed(kLocationRepeatAccel));
// A repeated Ctrl-Tab accelerator should be processed.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698