| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/common/window_state.h" | 8 #include "ash/wm/common/window_state.h" |
| 9 #include "ash/wm/window_state_aura.h" | 9 #include "ash/wm/window_state_aura.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
| 13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
| 14 #include "ui/events/test/event_generator.h" | 14 #include "ui/events/test/event_generator.h" |
| 15 | 15 |
| 16 #if defined(USE_X11) | 16 #if defined(USE_X11) |
| 17 #include "ui/events/test/events_test_utils_x11.h" | 17 #include "ui/events/test/events_test_utils_x11.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 #if defined(OS_CHROMEOS) && defined(USE_X11) | 20 #if defined(USE_X11) |
| 21 typedef InProcessBrowserTest AcceleratorControllerBrowserTest; | 21 typedef InProcessBrowserTest AcceleratorControllerBrowserTest; |
| 22 | 22 |
| 23 // Test that pressing and holding Alt+ toggles the maximized state exactly once. | 23 // Test that pressing and holding Alt+ toggles the maximized state exactly once. |
| 24 // This test is a browser test to test that the EF_IS_REPEAT flag is correctly | 24 // This test is a browser test to test that the EF_IS_REPEAT flag is correctly |
| 25 // passed down to AcceleratorController (via a conversion to WebInputEvent). | 25 // passed down to AcceleratorController (via a conversion to WebInputEvent). |
| 26 // See crbug.com/434743 | 26 // See crbug.com/434743 |
| 27 IN_PROC_BROWSER_TEST_F(AcceleratorControllerBrowserTest, | 27 IN_PROC_BROWSER_TEST_F(AcceleratorControllerBrowserTest, |
| 28 RepeatedToggleMaximizeViaAccelerator) { | 28 RepeatedToggleMaximizeViaAccelerator) { |
| 29 ASSERT_TRUE(ash::Shell::HasInstance()) << "No Instance"; | 29 ASSERT_TRUE(ash::Shell::HasInstance()) << "No Instance"; |
| 30 AddTabAtIndex(0, | 30 AddTabAtIndex(0, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 43 ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow()); | 43 ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow()); |
| 44 generator.PressKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN); | 44 generator.PressKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN); |
| 45 EXPECT_TRUE(window_state->IsMaximized()); | 45 EXPECT_TRUE(window_state->IsMaximized()); |
| 46 | 46 |
| 47 generator.PressKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN); | 47 generator.PressKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN); |
| 48 | 48 |
| 49 generator.ReleaseKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN); | 49 generator.ReleaseKey(ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN); |
| 50 EXPECT_TRUE(window_state->IsMaximized()); | 50 EXPECT_TRUE(window_state->IsMaximized()); |
| 51 } | 51 } |
| 52 #endif | 52 #endif |
| OLD | NEW |