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

Unified Diff: chrome/browser/ui/ash/accelerator_controller_browsertest.cc

Issue 1017323002: make IsRepeated work even when a KeyEvent is created from the same native event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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 | ui/events/event.cc » ('j') | ui/events/event_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/accelerator_controller_browsertest.cc
diff --git a/chrome/browser/ui/ash/accelerator_controller_browsertest.cc b/chrome/browser/ui/ash/accelerator_controller_browsertest.cc
index d0d1f37ddd1d048e2d012e75bf4e3dde2e6a484d..ea25bcdadd95ab8df95e23303c11e21a2ed8411a 100644
--- a/chrome/browser/ui/ash/accelerator_controller_browsertest.cc
+++ b/chrome/browser/ui/ash/accelerator_controller_browsertest.cc
@@ -38,27 +38,13 @@ IN_PROC_BROWSER_TEST_F(AcceleratorControllerBrowserTest,
ash::wm::WindowState* window_state = ash::wm::GetActiveWindowState();
EXPECT_FALSE(window_state->IsMaximized());
- // Construct the key events from XEvents because RenderWidgetHostViewAura
- // drops the ui::EF_IS_REPEAT flag otherwise.
oshima 2015/03/19 00:46:04 EventGenerator creates KeyEvent using native event
- ui::ScopedXI2Event xi2_down1;
- xi2_down1.InitKeyEvent(ui::ET_KEY_PRESSED,
- ui::VKEY_OEM_PLUS,
- ui::EF_ALT_DOWN);
- ui::KeyEvent down1(xi2_down1);
ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
- generator.Dispatch(&down1);
+ generator.PressKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN);
EXPECT_TRUE(window_state->IsMaximized());
- ui::ScopedXI2Event xi2_down2;
- xi2_down2.InitKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_OEM_PLUS,
- ui::EF_ALT_DOWN);
- ui::KeyEvent down2(xi2_down2);
- generator.Dispatch(&down2);
+ generator.PressKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN);
- ui::ScopedXI2Event xi2_up;
- xi2_up.InitKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN);
- ui::KeyEvent up(xi2_up);
- generator.Dispatch(&up);
+ generator.ReleaseKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN);
EXPECT_TRUE(window_state->IsMaximized());
}
#endif
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | ui/events/event_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698