| 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/browser_action_test_util.h" | 7 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 8 #include "chrome/browser/extensions/extension_action.h" | 8 #include "chrome/browser/extensions/extension_action.h" |
| 9 #include "chrome/browser/extensions/extension_action_manager.h" | 9 #include "chrome/browser/extensions/extension_action_manager.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 bool result = false; | 145 bool result = false; |
| 146 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 146 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
| 147 tab, | 147 tab, |
| 148 "setInterval(function(){" | 148 "setInterval(function(){" |
| 149 " if(document.body.bgColor == 'red'){" | 149 " if(document.body.bgColor == 'red'){" |
| 150 " window.domAutomationController.send(true)}}, 100)", | 150 " window.domAutomationController.send(true)}}, 100)", |
| 151 &result)); | 151 &result)); |
| 152 ASSERT_TRUE(result); | 152 ASSERT_TRUE(result); |
| 153 } | 153 } |
| 154 | 154 |
| 155 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) | |
| 156 // TODO(erg): linux_aura bringup: http://crbug.com/163931 | |
| 157 #define MAYBE_SynthesizedCommand DISABLED_SynthesizedCommand | |
| 158 #else | |
| 159 #define MAYBE_SynthesizedCommand SynthesizedCommand | |
| 160 #endif | |
| 161 | |
| 162 // This test validates that the getAll query API function returns registered | 155 // This test validates that the getAll query API function returns registered |
| 163 // commands as well as synthesized ones and that inactive commands (like the | 156 // commands as well as synthesized ones and that inactive commands (like the |
| 164 // synthesized ones are in nature) have no shortcuts. | 157 // synthesized ones are in nature) have no shortcuts. |
| 165 IN_PROC_BROWSER_TEST_F(CommandsApiTest, MAYBE_SynthesizedCommand) { | 158 IN_PROC_BROWSER_TEST_F(CommandsApiTest, SynthesizedCommand) { |
| 166 ASSERT_TRUE(test_server()->Start()); | 159 ASSERT_TRUE(test_server()->Start()); |
| 167 ASSERT_TRUE(RunExtensionTest("keybinding/synthesized")) << message_; | 160 ASSERT_TRUE(RunExtensionTest("keybinding/synthesized")) << message_; |
| 168 } | 161 } |
| 169 | 162 |
| 170 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) | |
| 171 // TODO(erg): linux_aura bringup: http://crbug.com/163931 | |
| 172 #define MAYBE_DontOverwriteSystemShortcuts DISABLED_DontOverwriteSystemShortcuts | |
| 173 #else | |
| 174 #define MAYBE_DontOverwriteSystemShortcuts DontOverwriteSystemShortcuts | |
| 175 #endif | |
| 176 | |
| 177 // This test validates that an extension cannot request a shortcut that is | 163 // This test validates that an extension cannot request a shortcut that is |
| 178 // already in use by Chrome. | 164 // already in use by Chrome. |
| 179 IN_PROC_BROWSER_TEST_F(CommandsApiTest, MAYBE_DontOverwriteSystemShortcuts) { | 165 IN_PROC_BROWSER_TEST_F(CommandsApiTest, DontOverwriteSystemShortcuts) { |
| 180 ASSERT_TRUE(test_server()->Start()); | 166 ASSERT_TRUE(test_server()->Start()); |
| 181 | 167 |
| 182 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 168 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 183 | 169 |
| 184 ASSERT_TRUE(RunExtensionTest("keybinding/dont_overwrite_system")) << message_; | 170 ASSERT_TRUE(RunExtensionTest("keybinding/dont_overwrite_system")) << message_; |
| 185 | 171 |
| 186 ui_test_utils::NavigateToURL(browser(), | 172 ui_test_utils::NavigateToURL(browser(), |
| 187 test_server()->GetURL("files/extensions/test_file.txt")); | 173 test_server()->GetURL("files/extensions/test_file.txt")); |
| 188 | 174 |
| 189 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 175 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // Activate the Media Stop key. | 291 // Activate the Media Stop key. |
| 306 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 292 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 307 browser(), ui::VKEY_MEDIA_STOP, false, false, false, false)); | 293 browser(), ui::VKEY_MEDIA_STOP, false, false, false, false)); |
| 308 | 294 |
| 309 // We should get two success result. | 295 // We should get two success result. |
| 310 ASSERT_TRUE(catcher.GetNextResult()); | 296 ASSERT_TRUE(catcher.GetNextResult()); |
| 311 ASSERT_TRUE(catcher.GetNextResult()); | 297 ASSERT_TRUE(catcher.GetNextResult()); |
| 312 } | 298 } |
| 313 | 299 |
| 314 } // namespace extensions | 300 } // namespace extensions |
| OLD | NEW |