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

Side by Side Diff: chrome/browser/extensions/extension_keybinding_apitest.cc

Issue 553243002: Track the active ExtensionKeybindingRegistry and make it available to EventRewriter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Comment. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 browser(), ui::VKEY_F, true, true, false, false)); 724 browser(), ui::VKEY_F, true, true, false, false));
725 ASSERT_TRUE(catcher.GetNextResult()); 725 ASSERT_TRUE(catcher.GetNextResult());
726 726
727 // The extension should now have removed its |onCommand| event listener. 727 // The extension should now have removed its |onCommand| event listener.
728 // Finally, the page should again receive the key. 728 // Finally, the page should again receive the key.
729 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 729 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
730 browser(), ui::VKEY_F, true, true, false, false)); 730 browser(), ui::VKEY_F, true, true, false, false));
731 ASSERT_TRUE(catcher.GetNextResult()); 731 ASSERT_TRUE(catcher.GetNextResult());
732 } 732 }
733 733
734 // Test is only applicable on Chrome OS.
735 #if defined(OS_CHROMEOS)
736 IN_PROC_BROWSER_TEST_F(CommandsApiTest, ChromeOSConversions) {
737 // Setup the environment.
738 ASSERT_TRUE(test_server()->Start());
739 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
740 ASSERT_TRUE(RunExtensionTest("keybinding/chromeos_conversions")) << message_;
741 ui_test_utils::NavigateToURL(
742 browser(), test_server()->GetURL("files/extensions/test_file.txt"));
743
744 ResultCatcher catcher;
745
746 // Send all expected keys.
Finnur 2014/09/12 11:25:44 Please document what keys those are (Search+Shift+
David Tseng 2014/09/12 23:18:33 That seems unnecessary since the keys are listed b
Finnur 2014/09/15 10:48:42 I do find it more readable. I can never remember w
David Tseng 2014/09/15 17:25:12 Done.
747 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
748 browser(), ui::VKEY_LEFT, false, true, false, true));
749 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
750 browser(), ui::VKEY_UP, false, true, false, true));
751 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
752 browser(), ui::VKEY_RIGHT, false, true, false, true));
753 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
754 browser(), ui::VKEY_DOWN, false, true, false, true));
755
756 ASSERT_TRUE(catcher.GetNextResult());
757 }
758 #endif // OS_CHROMEOS
759
734 } // namespace extensions 760 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698