| 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 85f3ac40c64f53abf0f95069858ffd97351b8a56..b9b5f6d7c77b83a684ffc192f8a59295f93ba3b4 100644
|
| --- a/chrome/browser/extensions/extension_commands_global_registry_apitest.cc
|
| +++ b/chrome/browser/extensions/extension_commands_global_registry_apitest.cc
|
| @@ -10,7 +10,7 @@
|
| #include "content/public/test/browser_test_utils.h"
|
| #include "ui/base/base_window.h"
|
|
|
| -#if defined(TOOLKIT_GTK)
|
| +#if defined(OS_LINUX)
|
| #include <X11/Xlib.h>
|
| #include <X11/extensions/XTest.h>
|
| #include <X11/keysym.h>
|
| @@ -23,7 +23,7 @@ namespace extensions {
|
|
|
| typedef ExtensionApiTest GlobalCommandsApiTest;
|
|
|
| -#if defined(TOOLKIT_GTK)
|
| +#if defined(OS_LINUX)
|
| // Send a simulated key press and release event, where |control|, |shift| or
|
| // |alt| indicates whether the key is struck with corresponding modifier.
|
| void SendNativeKeyEventToXDisplay(ui::KeyboardCode key,
|
| @@ -64,11 +64,11 @@ void SendNativeKeyEventToXDisplay(ui::KeyboardCode key,
|
|
|
| XFlush(display);
|
| }
|
| -#endif // TOOLKIT_GTK
|
| +#endif // OS_LINUX
|
|
|
| -#if defined(OS_WIN) || defined(TOOLKIT_GTK)
|
| -// The feature is only fully implemented on Windows and Linux GTK+, other
|
| -// platforms coming.
|
| +#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
|
| +// The feature is only fully implemented on Windows and Linux, other platforms
|
| +// coming.
|
| #define MAYBE_GlobalCommand GlobalCommand
|
| #else
|
| #define MAYBE_GlobalCommand DISABLED_GlobalCommand
|
| @@ -87,7 +87,7 @@ IN_PROC_BROWSER_TEST_F(GlobalCommandsApiTest, MAYBE_GlobalCommand) {
|
| ASSERT_TRUE(RunExtensionTest("keybinding/global")) << message_;
|
| ASSERT_TRUE(catcher.GetNextResult());
|
|
|
| -#if !defined(TOOLKIT_GTK)
|
| +#if !defined(OS_LINUX)
|
| // Our infrastructure for sending keys expects a browser to send them to, but
|
| // to properly test global shortcuts you need to send them to another target.
|
| // So, create an incognito browser to use as a target to send the shortcuts
|
| @@ -109,7 +109,10 @@ IN_PROC_BROWSER_TEST_F(GlobalCommandsApiTest, MAYBE_GlobalCommand) {
|
| ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
|
| incognito_browser, ui::VKEY_9, true, true, false, false));
|
| #else
|
| - // On Linux GTK+, our infrastructure for sending keys just synthesize keyboard
|
| + // Create an incognito browser to capture the focus.
|
| + CreateIncognitoBrowser();
|
| +
|
| + // On Linux, our infrastructure for sending keys just synthesize keyboard
|
| // event and send them directly to the specified window, without notifying the
|
| // X root window. It didn't work while testing global shortcut because the
|
| // stuff of global shortcut on Linux need to be notified when KeyPress event
|
|
|