| 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/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 delete window1; | 657 delete window1; |
| 658 | 658 |
| 659 ASSERT_FALSE(observer2.destroyed()); | 659 ASSERT_FALSE(observer2.destroyed()); |
| 660 delete window2; | 660 delete window2; |
| 661 } | 661 } |
| 662 | 662 |
| 663 typedef test::NoSessionAshTestBase NoSessionRootWindowControllerTest; | 663 typedef test::NoSessionAshTestBase NoSessionRootWindowControllerTest; |
| 664 | 664 |
| 665 // Make sure that an event handler exists for entire display area. | 665 // Make sure that an event handler exists for entire display area. |
| 666 TEST_F(NoSessionRootWindowControllerTest, Event) { | 666 TEST_F(NoSessionRootWindowControllerTest, Event) { |
| 667 // Hide the shelf since it might otherwise get an event target. | |
| 668 RootWindowController* controller = Shell::GetPrimaryRootWindowController(); | |
| 669 ShelfLayoutManager* shelf_layout_manager = | |
| 670 controller->GetShelfLayoutManager(); | |
| 671 shelf_layout_manager->SetAutoHideBehavior( | |
| 672 ash::SHELF_AUTO_HIDE_ALWAYS_HIDDEN); | |
| 673 | |
| 674 aura::Window* root = Shell::GetPrimaryRootWindow(); | 667 aura::Window* root = Shell::GetPrimaryRootWindow(); |
| 675 const gfx::Size size = root->bounds().size(); | 668 const gfx::Size size = root->bounds().size(); |
| 676 aura::Window* event_target = root->GetEventHandlerForPoint(gfx::Point(0, 0)); | 669 aura::Window* event_target = root->GetEventHandlerForPoint(gfx::Point(0, 0)); |
| 677 EXPECT_TRUE(event_target); | 670 EXPECT_TRUE(event_target); |
| 678 EXPECT_EQ(event_target, | 671 EXPECT_EQ(event_target, |
| 679 root->GetEventHandlerForPoint(gfx::Point(0, size.height() - 1))); | 672 root->GetEventHandlerForPoint(gfx::Point(0, size.height() - 1))); |
| 680 EXPECT_EQ(event_target, | 673 EXPECT_EQ(event_target, |
| 681 root->GetEventHandlerForPoint(gfx::Point(size.width() - 1, 0))); | 674 root->GetEventHandlerForPoint(gfx::Point(size.width() - 1, 0))); |
| 682 EXPECT_EQ(event_target, | 675 EXPECT_EQ(event_target, |
| 683 root->GetEventHandlerForPoint(gfx::Point(0, size.height() - 1))); | 676 root->GetEventHandlerForPoint(gfx::Point(0, size.height() - 1))); |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 keyboard_controller->ui()->GetKeyboardWindow()->SetBounds( | 1022 keyboard_controller->ui()->GetKeyboardWindow()->SetBounds( |
| 1030 gfx::Rect(0, 400, 800, 200)); | 1023 gfx::Rect(0, 400, 800, 200)); |
| 1031 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); | 1024 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); |
| 1032 | 1025 |
| 1033 UpdateDisplay("600x800"); | 1026 UpdateDisplay("600x800"); |
| 1034 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); | 1027 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); |
| 1035 } | 1028 } |
| 1036 | 1029 |
| 1037 } // namespace test | 1030 } // namespace test |
| 1038 } // namespace ash | 1031 } // namespace ash |
| OLD | NEW |