| 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/shelf/shelf_button.h" | 8 #include "ash/common/shelf/shelf_button.h" |
| 9 #include "ash/common/shelf/shelf_layout_manager.h" | 9 #include "ash/common/shelf/shelf_layout_manager.h" |
| 10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 | 848 |
| 849 SetShelfVisibilityState(Shell::GetPrimaryRootWindow(), SHELF_VISIBLE); | 849 SetShelfVisibilityState(Shell::GetPrimaryRootWindow(), SHELF_VISIBLE); |
| 850 RunAllPendingInMessageLoop(); | 850 RunAllPendingInMessageLoop(); |
| 851 | 851 |
| 852 // Windows should be restored to their prior state. | 852 // Windows should be restored to their prior state. |
| 853 EXPECT_TRUE(w1->IsVisible()); | 853 EXPECT_TRUE(w1->IsVisible()); |
| 854 EXPECT_FALSE(w2->IsVisible()); | 854 EXPECT_FALSE(w2->IsVisible()); |
| 855 EXPECT_TRUE(w3->IsVisible()); | 855 EXPECT_TRUE(w3->IsVisible()); |
| 856 } | 856 } |
| 857 | 857 |
| 858 #if !defined(OS_WIN) |
| 858 // Verifies that touches along the attached edge of a panel do not | 859 // Verifies that touches along the attached edge of a panel do not |
| 859 // target the panel itself. | 860 // target the panel itself. |
| 860 TEST_F(PanelLayoutManagerTest, TouchHitTestPanel) { | 861 TEST_F(PanelLayoutManagerTest, TouchHitTestPanel) { |
| 861 aura::test::TestWindowDelegate delegate; | 862 aura::test::TestWindowDelegate delegate; |
| 862 std::unique_ptr<aura::Window> w( | 863 std::unique_ptr<aura::Window> w( |
| 863 CreatePanelWindowWithDelegate(&delegate, gfx::Rect(0, 0, 200, 200))); | 864 CreatePanelWindowWithDelegate(&delegate, gfx::Rect(0, 0, 200, 200))); |
| 864 ui::EventTarget* root = w->GetRootWindow(); | 865 ui::EventTarget* root = w->GetRootWindow(); |
| 865 ui::EventTargeter* targeter = root->GetEventTargeter(); | 866 ui::EventTargeter* targeter = root->GetEventTargeter(); |
| 866 | 867 |
| 867 // Note that the constants used in the touch locations below are | 868 // Note that the constants used in the touch locations below are |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 bounds = w->bounds(); | 903 bounds = w->bounds(); |
| 903 touch.set_location(gfx::Point(bounds.x() + 4, bounds.y() - 6)); | 904 touch.set_location(gfx::Point(bounds.x() + 4, bounds.y() - 6)); |
| 904 target = targeter->FindTargetForEvent(root, &touch); | 905 target = targeter->FindTargetForEvent(root, &touch); |
| 905 EXPECT_EQ(w.get(), target); | 906 EXPECT_EQ(w.get(), target); |
| 906 | 907 |
| 907 // Hit test outside the left edge with a left-aligned shelf. | 908 // Hit test outside the left edge with a left-aligned shelf. |
| 908 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); | 909 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); |
| 909 target = targeter->FindTargetForEvent(root, &touch); | 910 target = targeter->FindTargetForEvent(root, &touch); |
| 910 EXPECT_NE(w.get(), target); | 911 EXPECT_NE(w.get(), target); |
| 911 } | 912 } |
| 913 #endif // !defined(OS_WIN) |
| 912 | 914 |
| 913 INSTANTIATE_TEST_CASE_P(LtrRtl, | 915 INSTANTIATE_TEST_CASE_P(LtrRtl, |
| 914 PanelLayoutManagerTextDirectionTest, | 916 PanelLayoutManagerTextDirectionTest, |
| 915 testing::Bool()); | 917 testing::Bool()); |
| 916 | 918 |
| 917 } // namespace ash | 919 } // namespace ash |
| OLD | NEW |