| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 result = false; | 234 result = false; |
| 235 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 235 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
| 236 tab, | 236 tab, |
| 237 "setInterval(function() {" | 237 "setInterval(function() {" |
| 238 " if (document.body.bgColor == 'blue') {" | 238 " if (document.body.bgColor == 'blue') {" |
| 239 " window.domAutomationController.send(true)}}, 100)", | 239 " window.domAutomationController.send(true)}}, 100)", |
| 240 &result)); | 240 &result)); |
| 241 ASSERT_TRUE(result); | 241 ASSERT_TRUE(result); |
| 242 } | 242 } |
| 243 | 243 |
| 244 #if defined(OS_WIN) | |
| 245 // TODO(wittman): Enable the test once the bookmarks aren't a part of Settings | |
| 246 // Overrides API. | |
| 247 #define MAYBE_OverwriteBookmarkShortcut OverwriteBookmarkShortcut | |
| 248 #else | |
| 249 #define MAYBE_OverwriteBookmarkShortcut DISABLED_OverwriteBookmarkShortcut | |
| 250 #endif | |
| 251 | |
| 252 // This test validates that an extension can override the Chrome bookmark | 244 // This test validates that an extension can override the Chrome bookmark |
| 253 // shortcut if it has requested to do so. | 245 // shortcut if it has requested to do so. |
| 254 IN_PROC_BROWSER_TEST_F(CommandsApiTest, MAYBE_OverwriteBookmarkShortcut) { | 246 IN_PROC_BROWSER_TEST_F(CommandsApiTest, OverwriteBookmarkShortcut) { |
| 255 ASSERT_TRUE(test_server()->Start()); | 247 ASSERT_TRUE(test_server()->Start()); |
| 256 | 248 |
| 257 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 249 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 258 | 250 |
| 259 // This functionality requires a feature flag. | 251 // This functionality requires a feature flag. |
| 260 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 252 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 261 "--enable-override-bookmarks-ui", | 253 "--enable-override-bookmarks-ui", |
| 262 "1"); | 254 "1"); |
| 263 | 255 |
| 264 ASSERT_TRUE(RunExtensionTest("keybinding/overwrite_bookmark_shortcut")) | 256 ASSERT_TRUE(RunExtensionTest("keybinding/overwrite_bookmark_shortcut")) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // Activate the Media Stop key. | 305 // Activate the Media Stop key. |
| 314 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 306 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 315 browser(), ui::VKEY_MEDIA_STOP, false, false, false, false)); | 307 browser(), ui::VKEY_MEDIA_STOP, false, false, false, false)); |
| 316 | 308 |
| 317 // We should get two success result. | 309 // We should get two success result. |
| 318 ASSERT_TRUE(catcher.GetNextResult()); | 310 ASSERT_TRUE(catcher.GetNextResult()); |
| 319 ASSERT_TRUE(catcher.GetNextResult()); | 311 ASSERT_TRUE(catcher.GetNextResult()); |
| 320 } | 312 } |
| 321 | 313 |
| 322 } // namespace extensions | 314 } // namespace extensions |
| OLD | NEW |