| 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/root_view.h" | 5 #include "ui/views/widget/root_view.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 #include "ui/views/context_menu_controller.h" | 10 #include "ui/views/context_menu_controller.h" |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 // Ensure only one call to Layout() happens during Widget initialization, and | 570 // Ensure only one call to Layout() happens during Widget initialization, and |
| 571 // ensure it happens at the ContentView's preferred size. | 571 // ensure it happens at the ContentView's preferred size. |
| 572 TEST_F(RootViewTest, SingleLayoutDuringInit) { | 572 TEST_F(RootViewTest, SingleLayoutDuringInit) { |
| 573 RootViewTestDialogDelegate* delegate = new RootViewTestDialogDelegate(); | 573 RootViewTestDialogDelegate* delegate = new RootViewTestDialogDelegate(); |
| 574 Widget* widget = | 574 Widget* widget = |
| 575 DialogDelegate::CreateDialogWidget(delegate, GetContext(), nullptr); | 575 DialogDelegate::CreateDialogWidget(delegate, GetContext(), nullptr); |
| 576 EXPECT_EQ(1, delegate->layout_count()); | 576 EXPECT_EQ(1, delegate->layout_count()); |
| 577 widget->CloseNow(); | 577 widget->CloseNow(); |
| 578 | 578 |
| 579 // Also test Aura desktop Widget codepaths. | 579 // Also test Aura desktop Widget codepaths. |
| 580 views_delegate()->set_use_desktop_native_widgets(true); | 580 test_views_delegate()->set_use_desktop_native_widgets(true); |
| 581 delegate = new RootViewTestDialogDelegate(); | 581 delegate = new RootViewTestDialogDelegate(); |
| 582 widget = DialogDelegate::CreateDialogWidget(delegate, GetContext(), nullptr); | 582 widget = DialogDelegate::CreateDialogWidget(delegate, GetContext(), nullptr); |
| 583 EXPECT_EQ(1, delegate->layout_count()); | 583 EXPECT_EQ(1, delegate->layout_count()); |
| 584 widget->CloseNow(); | 584 widget->CloseNow(); |
| 585 } | 585 } |
| 586 | 586 |
| 587 } // namespace test | 587 } // namespace test |
| 588 } // namespace views | 588 } // namespace views |
| OLD | NEW |