| 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/common/wm/window_cycle_controller.h" | 5 #include "ash/common/wm/window_cycle_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/aura/wm_window_aura.h" | 10 #include "ash/aura/wm_window_aura.h" |
| 11 #include "ash/common/focus_cycler.h" | 11 #include "ash/common/focus_cycler.h" |
| 12 #include "ash/common/scoped_root_window_for_new_windows.h" | 12 #include "ash/common/scoped_root_window_for_new_windows.h" |
| 13 #include "ash/common/session/session_state_delegate.h" | 13 #include "ash/common/session/session_state_delegate.h" |
| 14 #include "ash/common/shelf/shelf.h" | |
| 15 #include "ash/common/shelf/shelf_widget.h" | 14 #include "ash/common/shelf/shelf_widget.h" |
| 15 #include "ash/common/shelf/wm_shelf.h" |
| 16 #include "ash/common/shell_window_ids.h" | 16 #include "ash/common/shell_window_ids.h" |
| 17 #include "ash/common/wm/window_cycle_list.h" | 17 #include "ash/common/wm/window_cycle_list.h" |
| 18 #include "ash/common/wm/window_state.h" | 18 #include "ash/common/wm/window_state.h" |
| 19 #include "ash/common/wm/wm_event.h" | 19 #include "ash/common/wm/wm_event.h" |
| 20 #include "ash/common/wm_shell.h" | 20 #include "ash/common/wm_shell.h" |
| 21 #include "ash/shell.h" | 21 #include "ash/shell.h" |
| 22 #include "ash/test/ash_test_base.h" | 22 #include "ash/test/ash_test_base.h" |
| 23 #include "ash/test/shelf_test_api.h" | |
| 24 #include "ash/test/shelf_view_test_api.h" | 23 #include "ash/test/shelf_view_test_api.h" |
| 25 #include "ash/test/test_shelf_delegate.h" | 24 #include "ash/test/test_shelf_delegate.h" |
| 26 #include "ash/test/test_shell_delegate.h" | 25 #include "ash/test/test_shell_delegate.h" |
| 27 #include "ash/wm/window_state_aura.h" | 26 #include "ash/wm/window_state_aura.h" |
| 28 #include "ash/wm/window_util.h" | 27 #include "ash/wm/window_util.h" |
| 29 #include "ui/aura/client/aura_constants.h" | 28 #include "ui/aura/client/aura_constants.h" |
| 30 #include "ui/aura/client/screen_position_client.h" | 29 #include "ui/aura/client/screen_position_client.h" |
| 31 #include "ui/aura/env.h" | 30 #include "ui/aura/env.h" |
| 32 #include "ui/aura/test/test_windows.h" | 31 #include "ui/aura/test/test_windows.h" |
| 33 #include "ui/aura/window.h" | 32 #include "ui/aura/window.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 WindowCycleControllerTest() {} | 74 WindowCycleControllerTest() {} |
| 76 ~WindowCycleControllerTest() override {} | 75 ~WindowCycleControllerTest() override {} |
| 77 | 76 |
| 78 void SetUp() override { | 77 void SetUp() override { |
| 79 test::AshTestBase::SetUp(); | 78 test::AshTestBase::SetUp(); |
| 80 ASSERT_TRUE(test::TestShelfDelegate::instance()); | 79 ASSERT_TRUE(test::TestShelfDelegate::instance()); |
| 81 | 80 |
| 82 WindowCycleList::DisableInitialDelayForTesting(); | 81 WindowCycleList::DisableInitialDelayForTesting(); |
| 83 | 82 |
| 84 shelf_view_test_.reset(new test::ShelfViewTestAPI( | 83 shelf_view_test_.reset(new test::ShelfViewTestAPI( |
| 85 test::ShelfTestAPI(Shelf::ForPrimaryDisplay()).shelf_view())); | 84 GetPrimaryShelf()->GetShelfViewForTesting())); |
| 86 shelf_view_test_->SetAnimationDuration(1); | 85 shelf_view_test_->SetAnimationDuration(1); |
| 87 } | 86 } |
| 88 | 87 |
| 89 aura::Window* CreatePanelWindow() { | 88 aura::Window* CreatePanelWindow() { |
| 90 gfx::Rect rect(100, 100); | 89 gfx::Rect rect(100, 100); |
| 91 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( | 90 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
| 92 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, rect); | 91 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, rect); |
| 93 test::TestShelfDelegate::instance()->AddShelfItem(window); | 92 test::TestShelfDelegate::instance()->AddShelfItem(window); |
| 94 shelf_view_test_->RunMessageLoopUntilAnimationsDone(); | 93 shelf_view_test_->RunMessageLoopUntilAnimationsDone(); |
| 95 return window; | 94 return window; |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 // without the new alt+tab selector we check for the event on either | 604 // without the new alt+tab selector we check for the event on either |
| 606 // fullscreen window. | 605 // fullscreen window. |
| 607 KeyEventCounter key_count; | 606 KeyEventCounter key_count; |
| 608 w0->AddPreTargetHandler(&key_count); | 607 w0->AddPreTargetHandler(&key_count); |
| 609 w1->AddPreTargetHandler(&key_count); | 608 w1->AddPreTargetHandler(&key_count); |
| 610 generator.PressKey(ui::VKEY_TAB, ui::EF_ALT_DOWN); | 609 generator.PressKey(ui::VKEY_TAB, ui::EF_ALT_DOWN); |
| 611 EXPECT_EQ(1u, key_count.GetCountAndReset()); | 610 EXPECT_EQ(1u, key_count.GetCountAndReset()); |
| 612 } | 611 } |
| 613 | 612 |
| 614 } // namespace ash | 613 } // namespace ash |
| OLD | NEW |