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

Unified Diff: chrome/browser/extensions/extension_keybinding_apitest.cc

Issue 388313002: mac: Allow WebContents key handling to supplant extension overrides of the bookmark shortcut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from yoz and shess. 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 | « no previous file | chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_keybinding_apitest.cc
diff --git a/chrome/browser/extensions/extension_keybinding_apitest.cc b/chrome/browser/extensions/extension_keybinding_apitest.cc
index 14a755f4542097615643386f9257282081c9ab0b..2eab3bc8786ea501e1a66b7600892d464ac0c8cf 100644
--- a/chrome/browser/extensions/extension_keybinding_apitest.cc
+++ b/chrome/browser/extensions/extension_keybinding_apitest.cc
@@ -282,17 +282,10 @@ IN_PROC_BROWSER_TEST_F(CommandsApiTest, OverwriteBookmarkShortcut) {
ASSERT_TRUE(result);
}
-// Behavior to be implemented on Mac. See http://crbug.com/389340.
-#if defined(OS_MACOSX)
-#define MAYBE_OverwriteBookmarkShortcutDoesNotOverrideWebKeybinding DISABLED_OverwriteBookmarkShortcutDoesNotOverrideWebKeybinding
-#else
-#define MAYBE_OverwriteBookmarkShortcutDoesNotOverrideWebKeybinding OverwriteBookmarkShortcutDoesNotOverrideWebKeybinding
-#endif
// This test validates that an extension override of the Chrome bookmark
// shortcut does not supersede the same keybinding by web pages.
-IN_PROC_BROWSER_TEST_F(
- CommandsApiTest,
- MAYBE_OverwriteBookmarkShortcutDoesNotOverrideWebKeybinding) {
+IN_PROC_BROWSER_TEST_F(CommandsApiTest,
+ OverwriteBookmarkShortcutDoesNotOverrideWebKeybinding) {
ASSERT_TRUE(test_server()->Start());
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
@@ -332,18 +325,11 @@ IN_PROC_BROWSER_TEST_F(
ASSERT_TRUE(result);
}
-// Behavior to be implemented on Mac. See http://crbug.com/389340.
-#if defined(OS_MACOSX)
-#define MAYBE_OverwriteBookmarkShortcutByUserOverridesWebKeybinding DISABLED_OverwriteBookmarkShortcutByUserOverridesWebKeybinding
-#else
-#define MAYBE_OverwriteBookmarkShortcutByUserOverridesWebKeybinding OverwriteBookmarkShortcutByUserOverridesWebKeybinding
-#endif
// This test validates that user-set override of the Chrome bookmark shortcut in
// an extension that does not request it does supersede the same keybinding by
// web pages.
-IN_PROC_BROWSER_TEST_F(
- CommandsApiTest,
- MAYBE_OverwriteBookmarkShortcutByUserOverridesWebKeybinding) {
+IN_PROC_BROWSER_TEST_F(CommandsApiTest,
+ OverwriteBookmarkShortcutByUserOverridesWebKeybinding) {
ASSERT_TRUE(test_server()->Start());
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
@@ -360,8 +346,13 @@ IN_PROC_BROWSER_TEST_F(
const Extension* extension = GetSingleLoadedExtension();
// Simulate the user setting the keybinding to Ctrl+D.
+#if defined(OS_MACOSX)
+ const char* hotkey = "Command+D";
+#else
+ const char* hotkey = "Ctrl+D";
+#endif // defined(OS_MACOSX)
command_service->UpdateKeybindingPrefs(
- extension->id(), manifest_values::kBrowserActionCommandEvent, "Ctrl+D");
+ extension->id(), manifest_values::kBrowserActionCommandEvent, hotkey);
ui_test_utils::NavigateToURL(browser(),
test_server()->GetURL(
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698