| 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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "chrome/browser/extensions/browser_action_test_util.h" | 6 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 7 #include "chrome/browser/sessions/restore_tab_helper.h" | 7 #include "chrome/browser/sessions/restore_tab_helper.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
| 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // We cannot add this to CommandsApiTest because then PageActions get | 38 // We cannot add this to CommandsApiTest because then PageActions get |
| 39 // treated like BrowserActions and the PageAction test starts failing. | 39 // treated like BrowserActions and the PageAction test starts failing. |
| 40 CommandLine::ForCurrentProcess()->AppendSwitch( | 40 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 41 switches::kEnableScriptBadges); | 41 switches::kEnableScriptBadges); |
| 42 CommandLine::ForCurrentProcess()->AppendSwitch( | 42 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 43 switches::kEnableExperimentalExtensionApis); | 43 switches::kEnableExperimentalExtensionApis); |
| 44 } | 44 } |
| 45 virtual ~ScriptBadgesCommandsApiTest() {} | 45 virtual ~ScriptBadgesCommandsApiTest() {} |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 #if !defined(OS_MACOSX) | |
| 49 // Test the basic functionality of the Keybinding API: | 48 // Test the basic functionality of the Keybinding API: |
| 50 // - That pressing the shortcut keys should perform actions (activate the | 49 // - That pressing the shortcut keys should perform actions (activate the |
| 51 // browser action or send an event). | 50 // browser action or send an event). |
| 52 // - Note: Page action keybindings are tested in PageAction test below. | 51 // - Note: Page action keybindings are tested in PageAction test below. |
| 53 // - The shortcut keys taken by one extension are not overwritten by the last | 52 // - The shortcut keys taken by one extension are not overwritten by the last |
| 54 // installed extension. | 53 // installed extension. |
| 55 IN_PROC_BROWSER_TEST_F(CommandsApiTest, Basic) { | 54 IN_PROC_BROWSER_TEST_F(CommandsApiTest, Basic) { |
| 56 ASSERT_TRUE(test_server()->Start()); | 55 ASSERT_TRUE(test_server()->Start()); |
| 57 ASSERT_TRUE(RunExtensionTest("keybinding/basics")) << message_; | 56 ASSERT_TRUE(RunExtensionTest("keybinding/basics")) << message_; |
| 58 const extensions::Extension* extension = GetSingleLoadedExtension(); | 57 const extensions::Extension* extension = GetSingleLoadedExtension(); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 160 |
| 162 { | 161 { |
| 163 ResultCatcher catcher; | 162 ResultCatcher catcher; |
| 164 // Activate the shortcut (Ctrl+Shift+F). | 163 // Activate the shortcut (Ctrl+Shift+F). |
| 165 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 164 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 166 browser(), ui::VKEY_F, true, true, false, false)); | 165 browser(), ui::VKEY_F, true, true, false, false)); |
| 167 ASSERT_TRUE(catcher.GetNextResult()); | 166 ASSERT_TRUE(catcher.GetNextResult()); |
| 168 } | 167 } |
| 169 } | 168 } |
| 170 | 169 |
| 171 #endif // !OS_MACOSX | |
| OLD | NEW |