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

Unified Diff: chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm

Issue 408973002: mac: Load the system hotkeys after launch. (reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more unit tests. Created 6 years, 5 months 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 | « chrome/browser/ui/cocoa/system_hotkey_map.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm
diff --git a/chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm b/chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm
deleted file mode 100644
index dbcf01704843106ea3ea8b32372efb03ae2ca277..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <gtest/gtest.h>
-
-#import <Carbon/Carbon.h>
-#import <Cocoa/Cocoa.h>
-
-#import "chrome/browser/ui/cocoa/system_hotkey_map.h"
-#include "chrome/test/base/ui_test_utils.h"
-
-namespace {
-
-class SystemHotkeyMapTest : public ::testing::Test {
- public:
- SystemHotkeyMapTest() {}
-};
-
-TEST_F(SystemHotkeyMapTest, Parse) {
- std::string path = ui_test_utils::GetTestUrl(
- base::FilePath(base::FilePath::kCurrentDirectory),
- base::FilePath("mac/mac_system_hotkeys.plist")).path();
- NSString* file_path = [NSString stringWithUTF8String:path.c_str()];
- NSData* data = [NSData dataWithContentsOfFile:file_path];
- ASSERT_TRUE(data);
-
- SystemHotkeyMap map;
- bool result = map.ParseData(data);
- EXPECT_TRUE(result);
-
- // Command + ` is a common key binding. It should exist.
- int key_code = kVK_ANSI_Grave;
- int modifiers = NSCommandKeyMask;
- EXPECT_TRUE(map.IsHotkeyReserved(key_code, modifiers));
-
- // Command + Shift + ` is a common key binding. It should exist.
- modifiers = NSCommandKeyMask | NSShiftKeyMask;
- EXPECT_TRUE(map.IsHotkeyReserved(key_code, modifiers));
-
- // Command + Shift + Ctr + ` is not a common key binding.
- modifiers = NSCommandKeyMask | NSShiftKeyMask | NSControlKeyMask;
- EXPECT_FALSE(map.IsHotkeyReserved(key_code, modifiers));
-
- // Command + L is not a common key binding.
- key_code = kVK_ANSI_L;
- modifiers = NSCommandKeyMask;
- EXPECT_FALSE(map.IsHotkeyReserved(key_code, modifiers));
-}
-
-} // namespace
« no previous file with comments | « chrome/browser/ui/cocoa/system_hotkey_map.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698