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