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

Unified Diff: chrome/common/extensions/command_unittest.cc

Issue 23445013: Parse media keys for named command in the manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit fix. Created 7 years, 4 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/common/extensions/command_unittest.cc
diff --git a/chrome/common/extensions/command_unittest.cc b/chrome/common/extensions/command_unittest.cc
index 56b968669326ee27d93c115d8a0e76bbcb192fe1..cd985e6d3e79cbbaa03345ad140600dee609dc78 100644
--- a/chrome/common/extensions/command_unittest.cc
+++ b/chrome/common/extensions/command_unittest.cc
@@ -43,6 +43,14 @@ TEST(CommandTest, ExtensionCommandParsing) {
const ui::Accelerator ctrl_end = ui::Accelerator(ui::VKEY_END, ctrl);
const ui::Accelerator ctrl_pgup = ui::Accelerator(ui::VKEY_PRIOR, ctrl);
const ui::Accelerator ctrl_pgdwn = ui::Accelerator(ui::VKEY_NEXT, ctrl);
+ const ui::Accelerator next_track =
+ ui::Accelerator(ui::VKEY_MEDIA_NEXT_TRACK, ui::EF_NONE);
+ const ui::Accelerator prev_track =
+ ui::Accelerator(ui::VKEY_MEDIA_PREV_TRACK, ui::EF_NONE);
+ const ui::Accelerator play_pause =
+ ui::Accelerator(ui::VKEY_MEDIA_PLAY_PAUSE, ui::EF_NONE);
+ const ui::Accelerator stop =
+ ui::Accelerator(ui::VKEY_MEDIA_STOP, ui::EF_NONE);
const struct {
bool expected_result;
@@ -100,6 +108,14 @@ TEST(CommandTest, ExtensionCommandParsing) {
{ true, ctrl_end, "_execute_browser_action", "Ctrl+End", "" },
{ true, ctrl_pgup, "_execute_browser_action", "Ctrl+PageUp", "" },
{ true, ctrl_pgdwn, "_execute_browser_action", "Ctrl+PageDown", "" },
+ // Media keys.
+ { true, next_track, "command", "MediaNextTrack", "description" },
+ { true, play_pause, "command", "MediaPlayPause", "description" },
+ { true, prev_track, "command", "MediaPrevTrack", "description" },
+ { true, stop, "command", "MediaStop", "description" },
+ { false, none, "_execute_browser_action", "MediaNextTrack", "" },
+ { false, none, "_execute_page_action", "MediaPrevTrack", "" },
+ { false, none, "command", "Ctrl+Shift+MediaPrevTrack", "description" },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) {

Powered by Google App Engine
This is Rietveld 408576698