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

Side by Side Diff: ui/views/controls/styled_label_unittest.cc

Issue 342833002: [Password Generation] Update Aura UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Coments Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/styled_label.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 styled()->SetBounds(0, 398 styled()->SetBounds(0,
399 0, 399 0,
400 label.GetPreferredSize().width(), 400 label.GetPreferredSize().width(),
401 label.GetPreferredSize().height()); 401 label.GetPreferredSize().height());
402 402
403 // Make sure we have the same sizing as a label. 403 // Make sure we have the same sizing as a label.
404 EXPECT_EQ(label.GetPreferredSize().height(), styled()->height()); 404 EXPECT_EQ(label.GetPreferredSize().height(), styled()->height());
405 EXPECT_EQ(label.GetPreferredSize().width(), styled()->width()); 405 EXPECT_EQ(label.GetPreferredSize().width(), styled()->width());
406 } 406 }
407 407
408 TEST_F(StyledLabelTest, LineHeight) {
409 const std::string text("one");
410 InitStyledLabel(text);
411 int default_height = styled()->GetHeightForWidth(100);
412 const std::string newline_text("one\ntwo\nthree");
413 InitStyledLabel(newline_text);
414 styled()->SetLineHeight(18);
415 EXPECT_EQ(18 * 2 + default_height, styled()->GetHeightForWidth(100));
416 }
417
408 TEST_F(StyledLabelTest, HandleEmptyLayout) { 418 TEST_F(StyledLabelTest, HandleEmptyLayout) {
409 const std::string text("This is a test block of text."); 419 const std::string text("This is a test block of text.");
410 InitStyledLabel(text); 420 InitStyledLabel(text);
411 styled()->Layout(); 421 styled()->Layout();
412 EXPECT_EQ(0, styled()->child_count()); 422 EXPECT_EQ(0, styled()->child_count());
413 } 423 }
414 424
415 } // namespace views 425 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/styled_label.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698