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

Unified Diff: chrome/browser/extensions/extension_keybinding_apitest.cc

Issue 10201016: Conflict detection for Extension Keybinding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Addressed comments Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_keybinding_apitest.cc
===================================================================
--- chrome/browser/extensions/extension_keybinding_apitest.cc (revision 134889)
+++ chrome/browser/extensions/extension_keybinding_apitest.cc (working copy)
@@ -31,15 +31,27 @@
};
#if !defined(OS_MACOSX)
+// Test the basic functionality of the Keybinding API:
+// - That pressing the shortcut keys should perform actions (activate the
+// browser action or send an event).
+// - Note: Page action keybindings are tested in PageAction test below.
+// - The shortcut keys taken by one extension are not overwritten by the last
+// installed extension.
IN_PROC_BROWSER_TEST_F(KeybindingApiTest, Basic) {
ASSERT_TRUE(test_server()->Start());
ASSERT_TRUE(RunExtensionTest("keybinding/basics")) << message_;
const Extension* extension = GetSingleLoadedExtension();
ASSERT_TRUE(extension) << message_;
- // Test that there is a browser action in the toolbar.
- ASSERT_EQ(1, GetBrowserActionsBar().NumberOfBrowserActions());
+ // Load this extension, which uses the same keybindings but sets the page
+ // to different colors. This is so we can see that it doesn't interfere. We
+ // don't test this extension in any other way (it should otherwise be
+ // immaterial to this test).
+ ASSERT_TRUE(RunExtensionTest("keybinding/conflicting")) << message_;
+ // Test that there are two browser actions in the toolbar.
+ ASSERT_EQ(2, GetBrowserActionsBar().NumberOfBrowserActions());
+
ui_test_utils::NavigateToURL(browser(),
test_server()->GetURL("files/extensions/test_file.txt"));
« no previous file with comments | « chrome/browser/extensions/extension_command_service_factory.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698