| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/window_controller.h" | 7 #include "chrome/browser/extensions/window_controller.h" |
| 8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/test/base/interactive_test_utils.h" | 10 #include "chrome/test/base/interactive_test_utils.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 CGEventPost(event_tap_location, command_up); | 112 CGEventPost(event_tap_location, command_up); |
| 113 | 113 |
| 114 CFRelease(event_source); | 114 CFRelease(event_source); |
| 115 } | 115 } |
| 116 #endif | 116 #endif |
| 117 | 117 |
| 118 // Test the basics of global commands and make sure they work when Chrome | 118 // Test the basics of global commands and make sure they work when Chrome |
| 119 // doesn't have focus. Also test that non-global commands are not treated as | 119 // doesn't have focus. Also test that non-global commands are not treated as |
| 120 // global and that keys beyond Ctrl+Shift+[0..9] cannot be auto-assigned by an | 120 // global and that keys beyond Ctrl+Shift+[0..9] cannot be auto-assigned by an |
| 121 // extension. | 121 // extension. |
| 122 // |
| 123 // Doesn't work in GN CrOS ozone builds yet, http://crbug.com/619784 |
| 124 #if defined(OS_CHROMEOS) && defined(USE_OZONE) |
| 125 #define MAYBE_GlobalCommand DISABLED_GlobalCommand |
| 126 #else |
| 127 #define MAYBE_GlobalCommand GlobalCommand |
| 128 #endif |
| 122 IN_PROC_BROWSER_TEST_F(GlobalCommandsApiTest, GlobalCommand) { | 129 IN_PROC_BROWSER_TEST_F(GlobalCommandsApiTest, GlobalCommand) { |
| 123 // Load the extension in the non-incognito browser. | 130 // Load the extension in the non-incognito browser. |
| 124 ResultCatcher catcher; | 131 ResultCatcher catcher; |
| 125 ASSERT_TRUE(RunExtensionTest("keybinding/global")) << message_; | 132 ASSERT_TRUE(RunExtensionTest("keybinding/global")) << message_; |
| 126 ASSERT_TRUE(catcher.GetNextResult()); | 133 ASSERT_TRUE(catcher.GetNextResult()); |
| 127 | 134 |
| 128 #if defined(OS_WIN) || defined(OS_CHROMEOS) | 135 #if defined(OS_WIN) || defined(OS_CHROMEOS) |
| 129 // Our infrastructure for sending keys expects a browser to send them to, but | 136 // Our infrastructure for sending keys expects a browser to send them to, but |
| 130 // to properly test global shortcuts you need to send them to another target. | 137 // to properly test global shortcuts you need to send them to another target. |
| 131 // So, create an incognito browser to use as a target to send the shortcuts | 138 // So, create an incognito browser to use as a target to send the shortcuts |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 false, | 207 false, |
| 201 false, | 208 false, |
| 202 false); | 209 false); |
| 203 | 210 |
| 204 // We should get two success results. | 211 // We should get two success results. |
| 205 ASSERT_TRUE(catcher.GetNextResult()); | 212 ASSERT_TRUE(catcher.GetNextResult()); |
| 206 ASSERT_TRUE(catcher.GetNextResult()); | 213 ASSERT_TRUE(catcher.GetNextResult()); |
| 207 } | 214 } |
| 208 | 215 |
| 209 } // namespace extensions | 216 } // namespace extensions |
| OLD | NEW |