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

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

Issue 48953004: Enable global command test on Linux Aura. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable on linux_chrome_os 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698