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/wm/panels/panel_layout_manager.h" | 5 #include "ash/common/wm/panels/panel_layout_manager.h" |
6 | 6 |
7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
9 #include "ash/common/shelf/shelf_button.h" | 9 #include "ash/common/shelf/shelf_button.h" |
10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
11 #include "ash/common/shelf/shelf_types.h" | 11 #include "ash/common/shelf/shelf_types.h" |
12 #include "ash/common/shelf/shelf_view.h" | 12 #include "ash/common/shelf/shelf_view.h" |
13 #include "ash/common/shell_window_ids.h" | 13 #include "ash/common/shell_window_ids.h" |
14 #include "ash/common/system/web_notification/web_notification_tray.h" | |
15 #include "ash/common/wm/mru_window_tracker.h" | 14 #include "ash/common/wm/mru_window_tracker.h" |
16 #include "ash/common/wm/window_state.h" | 15 #include "ash/common/wm/window_state.h" |
17 #include "ash/common/wm_shell.h" | 16 #include "ash/common/wm_shell.h" |
18 #include "ash/screen_util.h" | 17 #include "ash/screen_util.h" |
19 #include "ash/shelf/shelf.h" | 18 #include "ash/shelf/shelf.h" |
20 #include "ash/shelf/shelf_layout_manager.h" | 19 #include "ash/shelf/shelf_layout_manager.h" |
21 #include "ash/shelf/shelf_util.h" | 20 #include "ash/shelf/shelf_util.h" |
22 #include "ash/shelf/shelf_widget.h" | 21 #include "ash/shelf/shelf_widget.h" |
23 #include "ash/shell.h" | 22 #include "ash/shell.h" |
24 #include "ash/test/ash_test_base.h" | 23 #include "ash/test/ash_test_base.h" |
(...skipping 23 matching lines...) Expand all Loading... |
48 PanelLayoutManagerTest() {} | 47 PanelLayoutManagerTest() {} |
49 ~PanelLayoutManagerTest() override {} | 48 ~PanelLayoutManagerTest() override {} |
50 | 49 |
51 void SetUp() override { | 50 void SetUp() override { |
52 test::AshTestBase::SetUp(); | 51 test::AshTestBase::SetUp(); |
53 ASSERT_TRUE(test::TestShelfDelegate::instance()); | 52 ASSERT_TRUE(test::TestShelfDelegate::instance()); |
54 | 53 |
55 shelf_view_test_.reset( | 54 shelf_view_test_.reset( |
56 new test::ShelfViewTestAPI(GetShelfView(Shelf::ForPrimaryDisplay()))); | 55 new test::ShelfViewTestAPI(GetShelfView(Shelf::ForPrimaryDisplay()))); |
57 shelf_view_test_->SetAnimationDuration(1); | 56 shelf_view_test_->SetAnimationDuration(1); |
58 | |
59 WebNotificationTray::DisableAnimationsForTest(true); | |
60 } | |
61 | |
62 void TearDown() override { | |
63 test::AshTestBase::TearDown(); | |
64 | |
65 WebNotificationTray::DisableAnimationsForTest(false); // Reenable animation | |
66 } | 57 } |
67 | 58 |
68 aura::Window* CreateNormalWindow(const gfx::Rect& bounds) { | 59 aura::Window* CreateNormalWindow(const gfx::Rect& bounds) { |
69 return CreateTestWindowInShellWithBounds(bounds); | 60 return CreateTestWindowInShellWithBounds(bounds); |
70 } | 61 } |
71 | 62 |
72 aura::Window* CreatePanelWindowWithDelegate(aura::WindowDelegate* delegate, | 63 aura::Window* CreatePanelWindowWithDelegate(aura::WindowDelegate* delegate, |
73 const gfx::Rect& bounds) { | 64 const gfx::Rect& bounds) { |
74 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( | 65 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
75 delegate, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); | 66 delegate, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); | 807 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); |
817 target = targeter->FindTargetForEvent(root, &touch); | 808 target = targeter->FindTargetForEvent(root, &touch); |
818 EXPECT_NE(w.get(), target); | 809 EXPECT_NE(w.get(), target); |
819 } | 810 } |
820 | 811 |
821 INSTANTIATE_TEST_CASE_P(LtrRtl, | 812 INSTANTIATE_TEST_CASE_P(LtrRtl, |
822 PanelLayoutManagerTextDirectionTest, | 813 PanelLayoutManagerTextDirectionTest, |
823 testing::Bool()); | 814 testing::Bool()); |
824 | 815 |
825 } // namespace ash | 816 } // namespace ash |
OLD | NEW |