| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/memory/weak_ptr.h" | 5 #include "base/memory/weak_ptr.h" |
| 6 #include "chrome/browser/platform_util.h" | 6 #include "chrome/browser/platform_util.h" |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 ui::KeyEvent* native_ui_key_event = &key; | 299 ui::KeyEvent* native_ui_key_event = &key; |
| 300 #elif defined(OS_WIN) | 300 #elif defined(OS_WIN) |
| 301 MSG native_ui_key_event = native_key_event; | 301 MSG native_ui_key_event = native_key_event; |
| 302 #endif | 302 #endif |
| 303 | 303 |
| 304 host->ForwardKeyboardEvent( | 304 host->ForwardKeyboardEvent( |
| 305 content::NativeWebKeyboardEvent(native_ui_key_event)); | 305 content::NativeWebKeyboardEvent(native_ui_key_event)); |
| 306 } | 306 } |
| 307 | 307 |
| 308 // Tests that backspace is not processed before it's sent to the web contents. | 308 // Tests that backspace is not processed before it's sent to the web contents. |
| 309 // Flaky on win aura. crbug.com/170331 | 309 // Flaky on Win Aura and Linux ChromiumOS. See http://crbug.com/170331 |
| 310 #if defined(OS_WIN) && defined(USE_AURA) | 310 #if defined(USE_AURA) |
| 311 #define MAYBE_BackspaceSentToWebContent DISABLED_BackspaceSentToWebContent | 311 #define MAYBE_BackspaceSentToWebContent DISABLED_BackspaceSentToWebContent |
| 312 #else | 312 #else |
| 313 #define MAYBE_BackspaceSentToWebContent BackspaceSentToWebContent | 313 #define MAYBE_BackspaceSentToWebContent BackspaceSentToWebContent |
| 314 #endif | 314 #endif |
| 315 IN_PROC_BROWSER_TEST_F(ConstrainedWindowViewTest, | 315 IN_PROC_BROWSER_TEST_F(ConstrainedWindowViewTest, |
| 316 MAYBE_BackspaceSentToWebContent) { | 316 MAYBE_BackspaceSentToWebContent) { |
| 317 content::WebContents* web_contents = | 317 content::WebContents* web_contents = |
| 318 browser()->tab_strip_model()->GetActiveWebContents(); | 318 browser()->tab_strip_model()->GetActiveWebContents(); |
| 319 ASSERT_TRUE(web_contents != NULL); | 319 ASSERT_TRUE(web_contents != NULL); |
| 320 | 320 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // Escape is not processed as accelerator before it's sent to web contents. | 375 // Escape is not processed as accelerator before it's sent to web contents. |
| 376 EXPECT_FALSE(observer.widget_closed()); | 376 EXPECT_FALSE(observer.widget_closed()); |
| 377 | 377 |
| 378 content::RunAllPendingInMessageLoop(); | 378 content::RunAllPendingInMessageLoop(); |
| 379 | 379 |
| 380 // Escape is processed as accelerator after it's sent to web contents. | 380 // Escape is processed as accelerator after it's sent to web contents. |
| 381 EXPECT_TRUE(observer.widget_closed()); | 381 EXPECT_TRUE(observer.widget_closed()); |
| 382 } | 382 } |
| 383 | 383 |
| 384 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11)) | 384 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11)) |
| OLD | NEW |