| 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/session/session_state_delegate.h" | 7 #include "ash/session/session_state_delegate.h" |
| 8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 delete window1; | 576 delete window1; |
| 577 | 577 |
| 578 ASSERT_FALSE(observer2.destroyed()); | 578 ASSERT_FALSE(observer2.destroyed()); |
| 579 delete window2; | 579 delete window2; |
| 580 } | 580 } |
| 581 | 581 |
| 582 typedef test::NoSessionAshTestBase NoSessionRootWindowControllerTest; | 582 typedef test::NoSessionAshTestBase NoSessionRootWindowControllerTest; |
| 583 | 583 |
| 584 // Make sure that an event handler exists for entire display area. | 584 // Make sure that an event handler exists for entire display area. |
| 585 TEST_F(NoSessionRootWindowControllerTest, Event) { | 585 TEST_F(NoSessionRootWindowControllerTest, Event) { |
| 586 // Hide the shelf since it might otherwise get an event target. |
| 587 RootWindowController* controller = Shell::GetPrimaryRootWindowController(); |
| 588 ShelfLayoutManager* shelf_layout_manager = |
| 589 controller->GetShelfLayoutManager(); |
| 590 shelf_layout_manager->SetAutoHideBehavior( |
| 591 ash::SHELF_AUTO_HIDE_ALWAYS_HIDDEN); |
| 592 |
| 586 aura::Window* root = Shell::GetPrimaryRootWindow(); | 593 aura::Window* root = Shell::GetPrimaryRootWindow(); |
| 587 const gfx::Size size = root->bounds().size(); | 594 const gfx::Size size = root->bounds().size(); |
| 588 aura::Window* event_target = root->GetEventHandlerForPoint(gfx::Point(0, 0)); | 595 aura::Window* event_target = root->GetEventHandlerForPoint(gfx::Point(0, 0)); |
| 589 EXPECT_TRUE(event_target); | 596 EXPECT_TRUE(event_target); |
| 590 EXPECT_EQ(event_target, | 597 EXPECT_EQ(event_target, |
| 591 root->GetEventHandlerForPoint(gfx::Point(0, size.height() - 1))); | 598 root->GetEventHandlerForPoint(gfx::Point(0, size.height() - 1))); |
| 592 EXPECT_EQ(event_target, | 599 EXPECT_EQ(event_target, |
| 593 root->GetEventHandlerForPoint(gfx::Point(size.width() - 1, 0))); | 600 root->GetEventHandlerForPoint(gfx::Point(size.width() - 1, 0))); |
| 594 EXPECT_EQ(event_target, | 601 EXPECT_EQ(event_target, |
| 595 root->GetEventHandlerForPoint(gfx::Point(0, size.height() - 1))); | 602 root->GetEventHandlerForPoint(gfx::Point(0, size.height() - 1))); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 modal_widget->Close(); | 768 modal_widget->Close(); |
| 762 | 769 |
| 763 // Verify that mouse events are now unblocked to the root window. | 770 // Verify that mouse events are now unblocked to the root window. |
| 764 root_window_event_generator.ClickLeftButton(); | 771 root_window_event_generator.ClickLeftButton(); |
| 765 EXPECT_EQ(2, handler.num_mouse_events() / 2); | 772 EXPECT_EQ(2, handler.num_mouse_events() / 2); |
| 766 root_window->RemovePreTargetHandler(&handler); | 773 root_window->RemovePreTargetHandler(&handler); |
| 767 } | 774 } |
| 768 | 775 |
| 769 } // namespace test | 776 } // namespace test |
| 770 } // namespace ash | 777 } // namespace ash |
| OLD | NEW |