| 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 "ash/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_table.h" | 7 #include "ash/accelerators/accelerator_table.h" |
| 8 #include "ash/accessibility_delegate.h" | 8 #include "ash/accessibility_delegate.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 // TODO(oshima): Fix this test to use EventGenerator. | 762 // TODO(oshima): Fix this test to use EventGenerator. |
| 763 #if defined(OS_WIN) | 763 #if defined(OS_WIN) |
| 764 // crbug.com/317592 | 764 // crbug.com/317592 |
| 765 #define MAYBE_ProcessOnce DISABLED_ProcessOnce | 765 #define MAYBE_ProcessOnce DISABLED_ProcessOnce |
| 766 #else | 766 #else |
| 767 #define MAYBE_ProcessOnce ProcessOnce | 767 #define MAYBE_ProcessOnce ProcessOnce |
| 768 #endif | 768 #endif |
| 769 | 769 |
| 770 #if defined(OS_WIN) || defined(USE_X11) | 770 #if defined(OS_WIN) || defined(USE_X11) |
| 771 TEST_F(AcceleratorControllerTest, MAYBE_ProcessOnce) { | 771 TEST_F(AcceleratorControllerTest, MAYBE_ProcessOnce) { |
| 772 // The IME event filter interferes with the basic key event propagation we |
| 773 // attempt to do here, so we disable it. |
| 774 DisableIME(); |
| 772 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_NONE); | 775 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_NONE); |
| 773 TestTarget target; | 776 TestTarget target; |
| 774 GetController()->Register(accelerator_a, &target); | 777 GetController()->Register(accelerator_a, &target); |
| 775 | 778 |
| 776 // The accelerator is processed only once. | 779 // The accelerator is processed only once. |
| 777 ui::EventProcessor* dispatcher = | 780 ui::EventProcessor* dispatcher = |
| 778 Shell::GetPrimaryRootWindow()->GetHost()->event_processor(); | 781 Shell::GetPrimaryRootWindow()->GetHost()->event_processor(); |
| 779 #if defined(OS_WIN) | 782 #if defined(OS_WIN) |
| 780 MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 }; | 783 MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 }; |
| 781 ui::KeyEvent key_event1(msg1); | 784 ui::KeyEvent key_event1(msg1); |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 wm::ActivateWindow(window.get()); | 1405 wm::ActivateWindow(window.get()); |
| 1403 GetController()->PerformActionIfEnabled(WINDOW_MINIMIZE); | 1406 GetController()->PerformActionIfEnabled(WINDOW_MINIMIZE); |
| 1404 delegate->TriggerAccessibilityAlert(ui::A11Y_ALERT_NONE); | 1407 delegate->TriggerAccessibilityAlert(ui::A11Y_ALERT_NONE); |
| 1405 GetController()->PerformActionIfEnabled(kActionsNeedingWindow[i]); | 1408 GetController()->PerformActionIfEnabled(kActionsNeedingWindow[i]); |
| 1406 EXPECT_NE(delegate->GetLastAccessibilityAlert(), | 1409 EXPECT_NE(delegate->GetLastAccessibilityAlert(), |
| 1407 ui::A11Y_ALERT_WINDOW_NEEDED); | 1410 ui::A11Y_ALERT_WINDOW_NEEDED); |
| 1408 } | 1411 } |
| 1409 } | 1412 } |
| 1410 | 1413 |
| 1411 } // namespace ash | 1414 } // namespace ash |
| OLD | NEW |