diff options
Diffstat (limited to 'chrome/common/extensions/api/commands/commands_manifest_unittest.cc')
-rw-r--r-- | chrome/common/extensions/api/commands/commands_manifest_unittest.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/common/extensions/api/commands/commands_manifest_unittest.cc b/chrome/common/extensions/api/commands/commands_manifest_unittest.cc index f6eb432..c642ebc 100644 --- a/chrome/common/extensions/api/commands/commands_manifest_unittest.cc +++ b/chrome/common/extensions/api/commands/commands_manifest_unittest.cc @@ -8,6 +8,7 @@ #include "base/string_util.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/api/commands/commands_handler.h" +#include "chrome/common/extensions/api/extension_action/browser_action_handler.h" #include "testing/gtest/include/gtest/gtest.h" namespace errors = extension_manifest_errors; @@ -84,4 +85,16 @@ TEST_F(CommandsManifestTest, CommandManifestRejectJustShift) { errors::kInvalidKeyBinding); } +TEST_F(CommandsManifestTest, BrowserActionSynthesizesCommand) { + (new BrowserActionHandler)->Register(); + scoped_refptr<Extension> extension = + LoadAndExpectSuccess("browser_action_synthesizes_command.json"); + // An extension with a browser action but no extension command specified + // should get a command assigned to it. + const extensions::Command* command = + CommandsInfo::GetBrowserActionCommand(extension); + ASSERT_TRUE(command != NULL); + ASSERT_EQ(ui::VKEY_UNKNOWN, command->accelerator().key_code()); +} + } // namespace extensions |