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 ui::EventTarget* root = w->GetRootWindow(); | 842 aura::Window* root = w->GetRootWindow(); |
843 ui::EventTargeter* targeter = root->GetEventTargeter(); | 843 ui::EventTargeter* targeter = |
| 844 root->GetHost()->dispatcher()->GetDefaultEventTargeter(); |
844 | 845 |
845 // Note that the constants used in the touch locations below are | 846 // Note that the constants used in the touch locations below are |
846 // arbitrarily-selected small numbers which will ensure the point is | 847 // arbitrarily-selected small numbers which will ensure the point is |
847 // within the default extended region surrounding the panel. This value | 848 // within the default extended region surrounding the panel. This value |
848 // is calculated as | 849 // is calculated as |
849 // kResizeOutsideBoundsSize * kResizeOutsideBoundsScaleForTouch | 850 // kResizeOutsideBoundsSize * kResizeOutsideBoundsScaleForTouch |
850 // in src/ash/root_window_controller.cc. | 851 // in src/ash/root_window_controller.cc. |
851 | 852 |
852 // Hit test outside the right edge with a bottom-aligned shelf. | 853 // Hit test outside the right edge with a bottom-aligned shelf. |
853 SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM); | 854 SetAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); | 887 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); |
887 target = targeter->FindTargetForEvent(root, &touch); | 888 target = targeter->FindTargetForEvent(root, &touch); |
888 EXPECT_NE(w.get(), target); | 889 EXPECT_NE(w.get(), target); |
889 } | 890 } |
890 | 891 |
891 INSTANTIATE_TEST_CASE_P(LtrRtl, | 892 INSTANTIATE_TEST_CASE_P(LtrRtl, |
892 PanelLayoutManagerTextDirectionTest, | 893 PanelLayoutManagerTextDirectionTest, |
893 testing::Bool()); | 894 testing::Bool()); |
894 | 895 |
895 } // namespace ash | 896 } // namespace ash |
OLD | NEW |