| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
| 12 #include "ui/aura/client/cursor_client.h" | 12 #include "ui/aura/client/cursor_client.h" |
| 13 #include "ui/aura/client/window_tree_client.h" | 13 #include "ui/aura/client/window_tree_client.h" |
| 14 #include "ui/aura/test/test_window_delegate.h" | 14 #include "ui/aura/test/test_window_delegate.h" |
| 15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 16 #include "ui/aura/window_tree_host.h" | 16 #include "ui/aura/window_tree_host.h" |
| 17 #include "ui/display/screen.h" |
| 17 #include "ui/events/event_processor.h" | 18 #include "ui/events/event_processor.h" |
| 18 #include "ui/events/event_utils.h" | 19 #include "ui/events/event_utils.h" |
| 19 #include "ui/events/test/event_generator.h" | 20 #include "ui/events/test/event_generator.h" |
| 20 #include "ui/gfx/screen.h" | |
| 21 #include "ui/views/test/native_widget_factory.h" | 21 #include "ui/views/test/native_widget_factory.h" |
| 22 #include "ui/views/test/test_views.h" | 22 #include "ui/views/test/test_views.h" |
| 23 #include "ui/views/test/test_views_delegate.h" | 23 #include "ui/views/test/test_views_delegate.h" |
| 24 #include "ui/views/test/views_test_base.h" | 24 #include "ui/views/test/views_test_base.h" |
| 25 #include "ui/views/test/widget_test.h" | 25 #include "ui/views/test/widget_test.h" |
| 26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| 27 #include "ui/views/window/dialog_delegate.h" | 27 #include "ui/views/window/dialog_delegate.h" |
| 28 | 28 |
| 29 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
| 30 #include "ui/base/view_prop.h" | 30 #include "ui/base/view_prop.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 TEST_F(DesktopAuraWidgetTest, TopLevelOwnedPopupRepositionTest) { | 425 TEST_F(DesktopAuraWidgetTest, TopLevelOwnedPopupRepositionTest) { |
| 426 DesktopAuraTopLevelWindowTest popup_window; | 426 DesktopAuraTopLevelWindowTest popup_window; |
| 427 | 427 |
| 428 popup_window.set_use_async_mode(false); | 428 popup_window.set_use_async_mode(false); |
| 429 | 429 |
| 430 ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow( | 430 ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow( |
| 431 gfx::Rect(0, 0, 200, 200), false)); | 431 gfx::Rect(0, 0, 200, 200), false)); |
| 432 | 432 |
| 433 gfx::Rect new_pos(10, 10, 400, 400); | 433 gfx::Rect new_pos(10, 10, 400, 400); |
| 434 popup_window.owned_window()->SetBoundsInScreen( | 434 popup_window.owned_window()->SetBoundsInScreen( |
| 435 new_pos, gfx::Screen::GetScreen()->GetDisplayNearestPoint(gfx::Point())); | 435 new_pos, |
| 436 display::Screen::GetScreen()->GetDisplayNearestPoint(gfx::Point())); |
| 436 | 437 |
| 437 EXPECT_EQ(new_pos, | 438 EXPECT_EQ(new_pos, |
| 438 popup_window.top_level_widget()->GetWindowBoundsInScreen()); | 439 popup_window.top_level_widget()->GetWindowBoundsInScreen()); |
| 439 | 440 |
| 440 ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow()); | 441 ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow()); |
| 441 } | 442 } |
| 442 | 443 |
| 443 // The following code verifies we can correctly destroy a Widget from a mouse | 444 // The following code verifies we can correctly destroy a Widget from a mouse |
| 444 // enter/exit. We could test move/drag/enter/exit but in general we don't run | 445 // enter/exit. We could test move/drag/enter/exit but in general we don't run |
| 445 // nested message loops from such events, nor has the code ever really dealt | 446 // nested message loops from such events, nor has the code ever really dealt |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled); | 653 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled); |
| 653 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled); | 654 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled); |
| 654 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled); | 655 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled); |
| 655 widget.CloseNow(); | 656 widget.CloseNow(); |
| 656 } | 657 } |
| 657 | 658 |
| 658 #endif // defined(OS_WIN) | 659 #endif // defined(OS_WIN) |
| 659 | 660 |
| 660 } // namespace test | 661 } // namespace test |
| 661 } // namespace views | 662 } // namespace views |
| OLD | NEW |