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

Unified Diff: ui/views/window/dialog_delegate_unittest.cc

Issue 2907983002: Allow dialogs to use a custom View as their title. (Closed)
Patch Set: merge Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate_unittest.cc
diff --git a/ui/views/window/dialog_delegate_unittest.cc b/ui/views/window/dialog_delegate_unittest.cc
index 936936f98f309bb36894798e3f1fc2e9b884c437..98ef4b80800d915926f4b27908698c86eb24a058 100644
--- a/ui/views/window/dialog_delegate_unittest.cc
+++ b/ui/views/window/dialog_delegate_unittest.cc
@@ -324,6 +324,20 @@ TEST_F(DialogTest, BoundsAccommodateTitle) {
dialog2->TearDown();
}
+TEST_F(DialogTest, ActualBoundsMatchPreferredBounds) {
+ dialog()->set_title(base::ASCIIToUTF16(
+ "La la la look at me I'm a really really long title that needs to be "
+ "really really long so that the title will multiline wrap."));
+ dialog()->GetWidget()->UpdateWindowTitle();
+
+ views::View* root_view = dialog()->GetWidget()->GetRootView();
+ gfx::Size preferred_size(root_view->GetPreferredSize());
+ EXPECT_FALSE(preferred_size.IsEmpty());
+ root_view->SizeToPreferredSize();
+ root_view->Layout();
+ EXPECT_EQ(preferred_size, root_view->size());
+}
+
// Tests default focus is assigned correctly when showing a new dialog.
TEST_F(DialogTest, InitialFocus) {
EXPECT_TRUE(dialog()->input()->HasFocus());
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698