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

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

Issue 64273008: [Windows] Finish global and non-global media keys support on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gclient sync. Created 7 years, 1 month 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_commands_global_registry_apitest.cc
diff --git a/chrome/browser/extensions/extension_commands_global_registry_apitest.cc b/chrome/browser/extensions/extension_commands_global_registry_apitest.cc
index b9b5f6d7c77b83a684ffc192f8a59295f93ba3b4..5d45810f781266fd1a151c9a91411508aac0027f 100644
--- a/chrome/browser/extensions/extension_commands_global_registry_apitest.cc
+++ b/chrome/browser/extensions/extension_commands_global_registry_apitest.cc
@@ -9,6 +9,7 @@
#include "chrome/test/base/interactive_test_utils.h"
#include "content/public/test/browser_test_utils.h"
#include "ui/base/base_window.h"
+#include "ui/base/test/ui_controls.h"
#if defined(OS_LINUX)
#include <X11/Xlib.h>
@@ -128,4 +129,37 @@ IN_PROC_BROWSER_TEST_F(GlobalCommandsApiTest, MAYBE_GlobalCommand) {
ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
}
+#if defined(OS_WIN)
+// The feature is only fully implemented on Windows, other platforms coming.
+#define MAYBE_GlobalDuplicatedMediaKey GlobalDuplicatedMediaKey
+#else
+#define MAYBE_GlobalDuplicatedMediaKey DISABLED_GlobalDuplicatedMediaKey
+#endif
+
+IN_PROC_BROWSER_TEST_F(GlobalCommandsApiTest, MAYBE_GlobalDuplicatedMediaKey) {
+ FeatureSwitch::ScopedOverride enable_global_commands(
+ FeatureSwitch::global_commands(), true);
+
+ ResultCatcher catcher;
+ ASSERT_TRUE(RunExtensionTest("keybinding/global_media_keys_0")) << message_;
+ ASSERT_TRUE(catcher.GetNextResult());
+ ASSERT_TRUE(RunExtensionTest("keybinding/global_media_keys_1")) << message_;
+ ASSERT_TRUE(catcher.GetNextResult());
+
+ Browser* incognito_browser = CreateIncognitoBrowser(); // Ditto.
+ WindowController* controller =
+ incognito_browser->extension_window_controller();
+
+ ui_controls::SendKeyPress(controller->window()->GetNativeWindow(),
+ ui::VKEY_MEDIA_NEXT_TRACK,
+ false,
+ false,
+ false,
+ false);
+
+ // We should get two success result.
+ ASSERT_TRUE(catcher.GetNextResult());
+ ASSERT_TRUE(catcher.GetNextResult());
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698