OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/extensions/active_tab_permission_granter.h" | 6 #include "chrome/browser/extensions/active_tab_permission_granter.h" |
7 #include "chrome/browser/extensions/api/commands/command_service.h" | 7 #include "chrome/browser/extensions/api/commands/command_service.h" |
8 #include "chrome/browser/extensions/browser_action_test_util.h" | 8 #include "chrome/browser/extensions/browser_action_test_util.h" |
9 #include "chrome/browser/extensions/extension_action.h" | 9 #include "chrome/browser/extensions/extension_action.h" |
10 #include "chrome/browser/extensions/extension_action_manager.h" | 10 #include "chrome/browser/extensions/extension_action_manager.h" |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 "1"); | 370 "1"); |
371 | 371 |
372 ASSERT_TRUE(RunExtensionTest("keybinding/basics")) | 372 ASSERT_TRUE(RunExtensionTest("keybinding/basics")) |
373 << message_; | 373 << message_; |
374 | 374 |
375 CommandService* command_service = CommandService::Get(browser()->profile()); | 375 CommandService* command_service = CommandService::Get(browser()->profile()); |
376 | 376 |
377 const Extension* extension = GetSingleLoadedExtension(); | 377 const Extension* extension = GetSingleLoadedExtension(); |
378 // Simulate the user setting the keybinding to Ctrl+D. | 378 // Simulate the user setting the keybinding to Ctrl+D. |
379 #if defined(OS_MACOSX) | 379 #if defined(OS_MACOSX) |
380 const char* hotkey = "Command+D"; | 380 const char hotkey[] = "Command+D"; |
381 #else | 381 #else |
382 const char* hotkey = "Ctrl+D"; | 382 const char hotkey[] = "Ctrl+D"; |
383 #endif // defined(OS_MACOSX) | 383 #endif // defined(OS_MACOSX) |
384 command_service->UpdateKeybindingPrefs( | 384 command_service->UpdateKeybindingPrefs( |
385 extension->id(), manifest_values::kBrowserActionCommandEvent, hotkey); | 385 extension->id(), manifest_values::kBrowserActionCommandEvent, hotkey); |
386 | 386 |
387 ui_test_utils::NavigateToURL(browser(), | 387 ui_test_utils::NavigateToURL(browser(), |
388 test_server()->GetURL( | 388 test_server()->GetURL( |
389 "files/extensions/test_file_with_ctrl-d_keybinding.html")); | 389 "files/extensions/test_file_with_ctrl-d_keybinding.html")); |
390 | 390 |
391 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 391 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
392 ASSERT_TRUE(tab); | 392 ASSERT_TRUE(tab); |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 #define MAYBE_ChromeOSConversions DISABLED_ChromeOSConversions | 830 #define MAYBE_ChromeOSConversions DISABLED_ChromeOSConversions |
831 #else | 831 #else |
832 #define MAYBE_ChromeOSConversions ChromeOSConversions | 832 #define MAYBE_ChromeOSConversions ChromeOSConversions |
833 #endif | 833 #endif |
834 IN_PROC_BROWSER_TEST_F(CommandsApiTest, MAYBE_ChromeOSConversions) { | 834 IN_PROC_BROWSER_TEST_F(CommandsApiTest, MAYBE_ChromeOSConversions) { |
835 RunChromeOSConversionTest("keybinding/chromeos_conversions"); | 835 RunChromeOSConversionTest("keybinding/chromeos_conversions"); |
836 } | 836 } |
837 #endif // OS_CHROMEOS | 837 #endif // OS_CHROMEOS |
838 | 838 |
839 } // namespace extensions | 839 } // namespace extensions |
OLD | NEW |