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/common/shelf/shelf_button.h" | 7 #include "ash/common/shelf/shelf_button.h" |
8 #include "ash/common/shelf/shelf_layout_manager.h" | 8 #include "ash/common/shelf/shelf_layout_manager.h" |
9 #include "ash/common/shelf/shelf_model.h" | 9 #include "ash/common/shelf/shelf_model.h" |
10 #include "ash/common/shelf/shelf_view.h" | 10 #include "ash/common/shelf/shelf_view.h" |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 EXPECT_FALSE(w2->IsVisible()); | 832 EXPECT_FALSE(w2->IsVisible()); |
833 EXPECT_TRUE(w3->IsVisible()); | 833 EXPECT_TRUE(w3->IsVisible()); |
834 } | 834 } |
835 | 835 |
836 // Verifies that touches along the attached edge of a panel do not | 836 // Verifies that touches along the attached edge of a panel do not |
837 // target the panel itself. | 837 // target the panel itself. |
838 TEST_F(PanelLayoutManagerTest, TouchHitTestPanel) { | 838 TEST_F(PanelLayoutManagerTest, TouchHitTestPanel) { |
839 aura::test::TestWindowDelegate delegate; | 839 aura::test::TestWindowDelegate delegate; |
840 std::unique_ptr<aura::Window> w( | 840 std::unique_ptr<aura::Window> w( |
841 CreatePanelWindowWithDelegate(&delegate, gfx::Rect(0, 0, 200, 200))); | 841 CreatePanelWindowWithDelegate(&delegate, gfx::Rect(0, 0, 200, 200))); |
842 aura::Window* root = w->GetRootWindow(); | 842 ui::EventTarget* root = w->GetRootWindow(); |
843 ui::EventTargeter* targeter = | 843 ui::EventTargeter* targeter = root->GetEventTargeter(); |
844 root->GetHost()->dispatcher()->GetDefaultEventTargeter(); | |
845 | 844 |
846 // Note that the constants used in the touch locations below are | 845 // Note that the constants used in the touch locations below are |
847 // arbitrarily-selected small numbers which will ensure the point is | 846 // arbitrarily-selected small numbers which will ensure the point is |
848 // within the default extended region surrounding the panel. This value | 847 // within the default extended region surrounding the panel. This value |
849 // is calculated as | 848 // is calculated as |
850 // kResizeOutsideBoundsSize * kResizeOutsideBoundsScaleForTouch | 849 // kResizeOutsideBoundsSize * kResizeOutsideBoundsScaleForTouch |
851 // in src/ash/root_window_controller.cc. | 850 // in src/ash/root_window_controller.cc. |
852 | 851 |
853 // Hit test outside the right edge with a bottom-aligned shelf. | 852 // Hit test outside the right edge with a bottom-aligned shelf. |
854 SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM); | 853 SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); | 886 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); |
888 target = targeter->FindTargetForEvent(root, &touch); | 887 target = targeter->FindTargetForEvent(root, &touch); |
889 EXPECT_NE(w.get(), target); | 888 EXPECT_NE(w.get(), target); |
890 } | 889 } |
891 | 890 |
892 INSTANTIATE_TEST_CASE_P(LtrRtl, | 891 INSTANTIATE_TEST_CASE_P(LtrRtl, |
893 PanelLayoutManagerTextDirectionTest, | 892 PanelLayoutManagerTextDirectionTest, |
894 testing::Bool()); | 893 testing::Bool()); |
895 | 894 |
896 } // namespace ash | 895 } // namespace ash |
OLD | NEW |