Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: ui/views/widget/root_view_unittest.cc

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc ('k') | ui/views/widget/widget_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698