| 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 TEST_F(DesktopAuraWidgetTest, TopLevelOwnedPopupRepositionTest) { | 427 TEST_F(DesktopAuraWidgetTest, TopLevelOwnedPopupRepositionTest) { |
| 428 DesktopAuraTopLevelWindowTest popup_window; | 428 DesktopAuraTopLevelWindowTest popup_window; |
| 429 | 429 |
| 430 popup_window.set_use_async_mode(false); | 430 popup_window.set_use_async_mode(false); |
| 431 | 431 |
| 432 ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow( | 432 ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow( |
| 433 gfx::Rect(0, 0, 200, 200), false)); | 433 gfx::Rect(0, 0, 200, 200), false)); |
| 434 | 434 |
| 435 gfx::Rect new_pos(10, 10, 400, 400); | 435 gfx::Rect new_pos(10, 10, 400, 400); |
| 436 popup_window.owned_window()->SetBoundsInScreen( | 436 popup_window.owned_window()->SetBoundsInScreen( |
| 437 new_pos, | 437 new_pos, gfx::Screen::GetScreen()->GetDisplayNearestPoint(gfx::Point())); |
| 438 gfx::Screen::GetScreenFor( | |
| 439 popup_window.owned_window())->GetDisplayNearestPoint(gfx::Point())); | |
| 440 | 438 |
| 441 EXPECT_EQ(new_pos, | 439 EXPECT_EQ(new_pos, |
| 442 popup_window.top_level_widget()->GetWindowBoundsInScreen()); | 440 popup_window.top_level_widget()->GetWindowBoundsInScreen()); |
| 443 | 441 |
| 444 ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow()); | 442 ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow()); |
| 445 } | 443 } |
| 446 | 444 |
| 447 // The following code verifies we can correctly destroy a Widget from a mouse | 445 // The following code verifies we can correctly destroy a Widget from a mouse |
| 448 // enter/exit. We could test move/drag/enter/exit but in general we don't run | 446 // enter/exit. We could test move/drag/enter/exit but in general we don't run |
| 449 // nested message loops from such events, nor has the code ever really dealt | 447 // nested message loops from such events, nor has the code ever really dealt |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 reinterpret_cast<WPARAM>(win32_window), | 627 reinterpret_cast<WPARAM>(win32_window), |
| 630 MAKELPARAM(WM_LBUTTONDOWN, HTCLIENT)); | 628 MAKELPARAM(WM_LBUTTONDOWN, HTCLIENT)); |
| 631 EXPECT_EQ(activate_result, MA_ACTIVATE); | 629 EXPECT_EQ(activate_result, MA_ACTIVATE); |
| 632 | 630 |
| 633 modal_dialog_widget->CloseNow(); | 631 modal_dialog_widget->CloseNow(); |
| 634 } | 632 } |
| 635 #endif // defined(OS_WIN) | 633 #endif // defined(OS_WIN) |
| 636 | 634 |
| 637 } // namespace test | 635 } // namespace test |
| 638 } // namespace views | 636 } // namespace views |
| OLD | NEW |