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

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

Issue 374643002: Mac: Enable delegated renderer by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/content/browser/cocoa/system_hotkey_map_unittest.mm b/chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm
similarity index 58%
rename from content/browser/cocoa/system_hotkey_map_unittest.mm
rename to chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm
index b37549fdaddc8bc6b6c754c48fad8a7edeb12990..dbcf01704843106ea3ea8b32372efb03ae2ca277 100644
--- a/content/browser/cocoa/system_hotkey_map_unittest.mm
+++ b/chrome/browser/ui/cocoa/system_hotkey_map_unittest.mm
@@ -7,12 +7,10 @@
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
-#include "base/files/file_path.h"
-#include "base/path_service.h"
-#import "content/browser/cocoa/system_hotkey_map.h"
-#include "content/public/common/content_paths.h"
+#import "chrome/browser/ui/cocoa/system_hotkey_map.h"
+#include "chrome/test/base/ui_test_utils.h"
-namespace content {
+namespace {
class SystemHotkeyMapTest : public ::testing::Test {
public:
@@ -20,22 +18,15 @@ class SystemHotkeyMapTest : public ::testing::Test {
};
TEST_F(SystemHotkeyMapTest, Parse) {
- base::FilePath test_data_dir;
- ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &test_data_dir));
-
- base::FilePath test_path =
- test_data_dir.AppendASCII("mac/mac_system_hotkeys.plist");
- std::string test_path_string = test_path.AsUTF8Unsafe();
- NSString* file_path =
- [NSString stringWithUTF8String:test_path_string.c_str()];
+ 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);
- NSDictionary* dictionary = SystemHotkeyMap::DictionaryFromData(data);
- ASSERT_TRUE(dictionary);
-
SystemHotkeyMap map;
- bool result = map.ParseDictionary(dictionary);
+ bool result = map.ParseData(data);
EXPECT_TRUE(result);
// Command + ` is a common key binding. It should exist.
@@ -57,12 +48,4 @@ TEST_F(SystemHotkeyMapTest, Parse) {
EXPECT_FALSE(map.IsHotkeyReserved(key_code, modifiers));
}
-TEST_F(SystemHotkeyMapTest, ParseNil) {
- NSDictionary* dictionary = nil;
-
- SystemHotkeyMap map;
- bool result = map.ParseDictionary(dictionary);
- EXPECT_FALSE(result);
-}
-
-} // namespace content
+} // 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