diff options
author | zhchbin@gmail.com <zhchbin@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 07:20:01 +0000 |
---|---|---|
committer | zhchbin@gmail.com <zhchbin@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 07:20:01 +0000 |
commit | 1c8df89b0b6dfaaf6bc70291566853e5911e42ff (patch) | |
tree | df870b613a111fae618b9cf4aa760db53572a682 /chrome/test/data/extensions | |
parent | 446ea632b9674429c83aacb480071a8d5cee20c5 (diff) | |
download | chromium_src-1c8df89b0b6dfaaf6bc70291566853e5911e42ff.zip chromium_src-1c8df89b0b6dfaaf6bc70291566853e5911e42ff.tar.gz chromium_src-1c8df89b0b6dfaaf6bc70291566853e5911e42ff.tar.bz2 |
[Windows] Finish global and non-global media keys support on Windows.
This patch make sure that Media keys go to all apps/extensions that register for
them.
BUG=131612, 302437
TEST=interactive_ui_tests --gtest_filter=CommandsApiTest.AllowDuplicatedMediaKeys
TEST=interactive_ui_tests --gtest_filter=GlobalCommandsApiTest.GlobalDuplicatedMediaKey
Review URL: https://codereview.chromium.org/64273008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236707 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/extensions')
8 files changed, 150 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/api_test/keybinding/global_media_keys_0/background.js b/chrome/test/data/extensions/api_test/keybinding/global_media_keys_0/background.js new file mode 100644 index 0000000..f46df20 --- /dev/null +++ b/chrome/test/data/extensions/api_test/keybinding/global_media_keys_0/background.js @@ -0,0 +1,16 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Called when the user activates the command. +chrome.commands.onCommand.addListener(function(command) { + if (command == "MediaNextTrack-global") { + chrome.test.notifyPass(); + return; + } + + // Everything else is a failure case. + chrome.test.notifyFail("Unexpected command received: " + command); +}); + +chrome.test.notifyPass(); diff --git a/chrome/test/data/extensions/api_test/keybinding/global_media_keys_0/manifest.json b/chrome/test/data/extensions/api_test/keybinding/global_media_keys_0/manifest.json new file mode 100644 index 0000000..f37d9ee --- /dev/null +++ b/chrome/test/data/extensions/api_test/keybinding/global_media_keys_0/manifest.json @@ -0,0 +1,24 @@ +{ + "name": "An extension to test global media keys command", + "version": "1.0", + "manifest_version": 2, + "background": { + "scripts": ["background.js"] + }, + "commands": { + "MediaNextTrack-global": { + "suggested_key": { + "default": "MediaNextTrack" + }, + "description": "Test passes if called.", + "global": true + }, + "MediaStop-global": { + "suggested_key": { + "default": "MediaStop" + }, + "description": "Test failed if called (We didn't active this key).", + "global": true + } + } +} diff --git a/chrome/test/data/extensions/api_test/keybinding/global_media_keys_1/background.js b/chrome/test/data/extensions/api_test/keybinding/global_media_keys_1/background.js new file mode 100644 index 0000000..f46df20 --- /dev/null +++ b/chrome/test/data/extensions/api_test/keybinding/global_media_keys_1/background.js @@ -0,0 +1,16 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Called when the user activates the command. +chrome.commands.onCommand.addListener(function(command) { + if (command == "MediaNextTrack-global") { + chrome.test.notifyPass(); + return; + } + + // Everything else is a failure case. + chrome.test.notifyFail("Unexpected command received: " + command); +}); + +chrome.test.notifyPass(); diff --git a/chrome/test/data/extensions/api_test/keybinding/global_media_keys_1/manifest.json b/chrome/test/data/extensions/api_test/keybinding/global_media_keys_1/manifest.json new file mode 100644 index 0000000..f37d9ee --- /dev/null +++ b/chrome/test/data/extensions/api_test/keybinding/global_media_keys_1/manifest.json @@ -0,0 +1,24 @@ +{ + "name": "An extension to test global media keys command", + "version": "1.0", + "manifest_version": 2, + "background": { + "scripts": ["background.js"] + }, + "commands": { + "MediaNextTrack-global": { + "suggested_key": { + "default": "MediaNextTrack" + }, + "description": "Test passes if called.", + "global": true + }, + "MediaStop-global": { + "suggested_key": { + "default": "MediaStop" + }, + "description": "Test failed if called (We didn't active this key).", + "global": true + } + } +} diff --git a/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_0/background.js b/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_0/background.js new file mode 100644 index 0000000..df6eab3 --- /dev/null +++ b/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_0/background.js @@ -0,0 +1,16 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Called when the user activates the command. +chrome.commands.onCommand.addListener(function(command) { + if (command == "MediaStop-non-global") { + chrome.test.notifyPass(); + return; + } + + // Everything else is a failure case. + chrome.test.notifyFail("Unexpected command received: " + command); +}); + +chrome.test.notifyPass(); diff --git a/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_0/manifest.json b/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_0/manifest.json new file mode 100644 index 0000000..8e33b71 --- /dev/null +++ b/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_0/manifest.json @@ -0,0 +1,22 @@ +{ + "name": "An extension to test non-global media keys command", + "version": "1.0", + "manifest_version": 2, + "background": { + "scripts": ["background.js"] + }, + "commands": { + "MediaStop-non-global": { + "suggested_key": { + "default": "MediaStop" + }, + "description": "Test passes if called." + }, + "MediaNextTrack-non-global": { + "suggested_key": { + "default": "MediaNextTrack" + }, + "description": "Test failed if called (We didn't active this key)." + } + } +} diff --git a/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_1/background.js b/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_1/background.js new file mode 100644 index 0000000..df6eab3 --- /dev/null +++ b/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_1/background.js @@ -0,0 +1,16 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Called when the user activates the command. +chrome.commands.onCommand.addListener(function(command) { + if (command == "MediaStop-non-global") { + chrome.test.notifyPass(); + return; + } + + // Everything else is a failure case. + chrome.test.notifyFail("Unexpected command received: " + command); +}); + +chrome.test.notifyPass(); diff --git a/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_1/manifest.json b/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_1/manifest.json new file mode 100644 index 0000000..8607a25 --- /dev/null +++ b/chrome/test/data/extensions/api_test/keybinding/non_global_media_keys_1/manifest.json @@ -0,0 +1,16 @@ +{ + "name": "An extension to test non-global media keys command", + "version": "1.0", + "manifest_version": 2, + "background": { + "scripts": ["background.js"] + }, + "commands": { + "MediaStop-non-global": { + "suggested_key": { + "default": "MediaStop" + }, + "description": "Test passes if called." + } + } +} |