| 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/common/accelerators/accelerator_controller.h" | 5 #include "ash/common/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/accelerators/accelerator_table.h" | 8 #include "ash/common/accelerators/accelerator_table.h" |
| 9 #include "ash/common/accessibility_delegate.h" | 9 #include "ash/common/accessibility_delegate.h" |
| 10 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "ash/public/cpp/shell_window_ids.h" | 22 #include "ash/public/cpp/shell_window_ids.h" |
| 23 #include "ash/shell.h" | 23 #include "ash/shell.h" |
| 24 #include "ash/test/ash_test_base.h" | 24 #include "ash/test/ash_test_base.h" |
| 25 #include "ash/test/lock_state_controller_test_api.h" | 25 #include "ash/test/lock_state_controller_test_api.h" |
| 26 #include "ash/test/test_screenshot_delegate.h" | 26 #include "ash/test/test_screenshot_delegate.h" |
| 27 #include "ash/test/test_session_state_animator.h" | 27 #include "ash/test/test_session_state_animator.h" |
| 28 #include "ash/wm/lock_state_controller.h" | 28 #include "ash/wm/lock_state_controller.h" |
| 29 #include "ash/wm/window_state_aura.h" | 29 #include "ash/wm/window_state_aura.h" |
| 30 #include "ash/wm/window_util.h" | 30 #include "ash/wm/window_util.h" |
| 31 #include "base/test/user_action_tester.cc" | 31 #include "base/test/user_action_tester.cc" |
| 32 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 32 #include "ui/aura/client/aura_constants.h" | 33 #include "ui/aura/client/aura_constants.h" |
| 33 #include "ui/aura/test/test_window_delegate.h" | 34 #include "ui/aura/test/test_window_delegate.h" |
| 34 #include "ui/aura/test/test_windows.h" | 35 #include "ui/aura/test/test_windows.h" |
| 35 #include "ui/aura/window.h" | 36 #include "ui/aura/window.h" |
| 36 #include "ui/display/manager/display_manager.h" | 37 #include "ui/display/manager/display_manager.h" |
| 37 #include "ui/display/screen.h" | 38 #include "ui/display/screen.h" |
| 38 #include "ui/events/event.h" | 39 #include "ui/events/event.h" |
| 39 #include "ui/events/event_processor.h" | 40 #include "ui/events/event_processor.h" |
| 40 #include "ui/events/test/event_generator.h" | 41 #include "ui/events/test/event_generator.h" |
| 41 #include "ui/message_center/message_center.h" | 42 #include "ui/message_center/message_center.h" |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 }; | 716 }; |
| 716 GetController()->RegisterAccelerators(accelerators, arraysize(accelerators)); | 717 GetController()->RegisterAccelerators(accelerators, arraysize(accelerators)); |
| 717 | 718 |
| 718 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 719 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 719 params.context = CurrentContext(); | 720 params.context = CurrentContext(); |
| 720 params.bounds = gfx::Rect(5, 5, 20, 20); | 721 params.bounds = gfx::Rect(5, 5, 20, 20); |
| 721 views::Widget* widget = new views::Widget; | 722 views::Widget* widget = new views::Widget; |
| 722 widget->Init(params); | 723 widget->Init(params); |
| 723 widget->Show(); | 724 widget->Show(); |
| 724 widget->Activate(); | 725 widget->Activate(); |
| 725 widget->GetNativeView()->SetProperty(aura::client::kCanMaximizeKey, true); | 726 widget->GetNativeView()->SetProperty(aura::client::kResizeBehaviorKey, |
| 727 ui::mojom::kResizeBehaviorCanMaximize); |
| 726 | 728 |
| 727 ui::test::EventGenerator& generator = GetEventGenerator(); | 729 ui::test::EventGenerator& generator = GetEventGenerator(); |
| 728 wm::WindowState* window_state = wm::GetWindowState(widget->GetNativeView()); | 730 wm::WindowState* window_state = wm::GetWindowState(widget->GetNativeView()); |
| 729 | 731 |
| 730 // Toggling not suppressed. | 732 // Toggling not suppressed. |
| 731 generator.PressKey(ui::VKEY_J, ui::EF_ALT_DOWN); | 733 generator.PressKey(ui::VKEY_J, ui::EF_ALT_DOWN); |
| 732 EXPECT_TRUE(window_state->IsFullscreen()); | 734 EXPECT_TRUE(window_state->IsFullscreen()); |
| 733 | 735 |
| 734 // The same accelerator - toggling suppressed. | 736 // The same accelerator - toggling suppressed. |
| 735 generator.PressKey(ui::VKEY_J, ui::EF_ALT_DOWN | ui::EF_IS_REPEAT); | 737 generator.PressKey(ui::VKEY_J, ui::EF_ALT_DOWN | ui::EF_IS_REPEAT); |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 EXPECT_TRUE(IsMessageCenterEmpty()); | 1413 EXPECT_TRUE(IsMessageCenterEmpty()); |
| 1412 | 1414 |
| 1413 // If the action is LOCK_SCREEN, we must reset the state by unlocking the | 1415 // If the action is LOCK_SCREEN, we must reset the state by unlocking the |
| 1414 // screen before we proceed testing the rest of accelerators. | 1416 // screen before we proceed testing the rest of accelerators. |
| 1415 ResetStateIfNeeded(); | 1417 ResetStateIfNeeded(); |
| 1416 } | 1418 } |
| 1417 } | 1419 } |
| 1418 #endif // defined(OS_CHROMEOS) | 1420 #endif // defined(OS_CHROMEOS) |
| 1419 | 1421 |
| 1420 } // namespace ash | 1422 } // namespace ash |
| OLD | NEW |