| Index: ui/views/controls/label_unittest.cc
|
| diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc
|
| index 2ce9b0741e067865c8b4b95e6a8b253ad21f5901..5825b6c88dad84516b88b5d4e916ec5bc00eaf01 100644
|
| --- a/ui/views/controls/label_unittest.cc
|
| +++ b/ui/views/controls/label_unittest.cc
|
| @@ -137,22 +137,20 @@ TEST(LabelTest, ObscuredSurrogatePair) {
|
|
|
| TEST(LabelTest, TooltipProperty) {
|
| Label label;
|
| - base::string16 test_text(ASCIIToUTF16("My cool string."));
|
| - label.SetText(test_text);
|
| + label.SetText(ASCIIToUTF16("My cool string."));
|
|
|
| base::string16 tooltip;
|
| EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
|
| - EXPECT_EQ(test_text, tooltip);
|
| + EXPECT_EQ(label.text(), tooltip);
|
|
|
| base::string16 tooltip_text(ASCIIToUTF16("The tooltip!"));
|
| label.SetTooltipText(tooltip_text);
|
| EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
|
| EXPECT_EQ(tooltip_text, tooltip);
|
|
|
| - base::string16 empty_text;
|
| - label.SetTooltipText(empty_text);
|
| + label.SetTooltipText(base::string16());
|
| EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
|
| - EXPECT_EQ(test_text, tooltip);
|
| + EXPECT_EQ(label.text(), tooltip);
|
|
|
| // Make the label big enough to hold the text
|
| // and expect there to be no tooltip.
|
| @@ -164,7 +162,7 @@ TEST(LabelTest, TooltipProperty) {
|
| EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
|
| EXPECT_EQ(tooltip_text, tooltip);
|
| // Clear out the tooltip.
|
| - label.SetTooltipText(empty_text);
|
| + label.SetTooltipText(base::string16());
|
|
|
| // Shrink the bounds and the tooltip should come back.
|
| label.SetBounds(0, 0, 1, 1);
|
| @@ -187,25 +185,23 @@ TEST(LabelTest, TooltipProperty) {
|
| EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
|
| EXPECT_EQ(tooltip_text, tooltip);
|
| // Clear out the tooltip.
|
| - label.SetTooltipText(empty_text);
|
| + label.SetTooltipText(base::string16());
|
| }
|
|
|
| TEST(LabelTest, Accessibility) {
|
| Label label;
|
| - base::string16 test_text(ASCIIToUTF16("My special text."));
|
| - label.SetText(test_text);
|
| + label.SetText(ASCIIToUTF16("My special text."));
|
|
|
| ui::AXViewState state;
|
| label.GetAccessibleState(&state);
|
| EXPECT_EQ(ui::AX_ROLE_STATIC_TEXT, state.role);
|
| - EXPECT_EQ(test_text, state.name);
|
| + EXPECT_EQ(label.text(), state.name);
|
| EXPECT_TRUE(state.HasStateFlag(ui::AX_STATE_READ_ONLY));
|
| }
|
|
|
| TEST(LabelTest, SingleLineSizing) {
|
| Label label;
|
| - base::string16 test_text(ASCIIToUTF16("A not so random string in one line."));
|
| - label.SetText(test_text);
|
| + label.SetText(ASCIIToUTF16("A not so random string in one line."));
|
|
|
| // GetPreferredSize
|
| gfx::Size required_size = label.GetPreferredSize();
|
| @@ -228,28 +224,23 @@ TEST(LabelTest, SingleLineSizing) {
|
|
|
| TEST(LabelTest, MultilineSmallAvailableWidthSizing) {
|
| Label label;
|
| - base::string16 test_text(ASCIIToUTF16("Too Wide."));
|
| -
|
| label.SetMultiLine(true);
|
| label.SetAllowCharacterBreak(true);
|
| - label.SetElideBehavior(Label::ELIDE_AT_END);
|
| - label.SetText(test_text);
|
| + label.SetText(ASCIIToUTF16("Too Wide."));
|
|
|
| // Check that Label can be laid out at a variety of small sizes,
|
| // splitting the words into up to one character per line if necessary.
|
| // Incorrect word splitting may cause infinite loops in text layout.
|
| gfx::Size required_size = label.GetPreferredSize();
|
| - for (int i = 1; i < required_size.width(); ++i) {
|
| + for (int i = 1; i < required_size.width(); ++i)
|
| EXPECT_GT(label.GetHeightForWidth(i), 0);
|
| - }
|
| }
|
|
|
| TEST(LabelTest, MultiLineSizing) {
|
| Label label;
|
| label.SetFocusable(false);
|
| - base::string16 test_text(
|
| + label.SetText(
|
| ASCIIToUTF16("A random string\nwith multiple lines\nand returns!"));
|
| - label.SetText(test_text);
|
| label.SetMultiLine(true);
|
|
|
| // GetPreferredSize
|
| @@ -331,13 +322,10 @@ TEST(LabelTest, AutoDetectDirectionality) {
|
| label.set_directionality_mode(Label::AUTO_DETECT_DIRECTIONALITY);
|
|
|
| // Test text starts with RTL character.
|
| - base::string16 test_text(base::WideToUTF16(L" \x5d0\x5d1\x5d2 abc"));
|
| - label.SetText(test_text);
|
| + label.SetText(base::WideToUTF16(L" \x5d0\x5d1\x5d2 abc"));
|
| gfx::Size required_size(label.GetPreferredSize());
|
| gfx::Size extra(22, 8);
|
| - label.SetBounds(0,
|
| - 0,
|
| - required_size.width() + extra.width(),
|
| + label.SetBounds(0, 0, required_size.width() + extra.width(),
|
| required_size.height() + extra.height());
|
|
|
| base::string16 paint_text;
|
| @@ -349,12 +337,9 @@ TEST(LabelTest, AutoDetectDirectionality) {
|
| gfx::Canvas::FORCE_LTR_DIRECTIONALITY));
|
|
|
| // Test text starts with LTR character.
|
| - test_text = (base::WideToUTF16(L"ltr \x5d0\x5d1\x5d2 abc"));
|
| - label.SetText(test_text);
|
| + label.SetText(base::WideToUTF16(L"ltr \x5d0\x5d1\x5d2 abc"));
|
| required_size = label.GetPreferredSize();
|
| - label.SetBounds(0,
|
| - 0,
|
| - required_size.width() + extra.width(),
|
| + label.SetBounds(0, 0, required_size.width() + extra.width(),
|
| required_size.height() + extra.height());
|
|
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| @@ -371,13 +356,10 @@ TEST(LabelTest, DrawSingleLineString) {
|
| // align right really means align left.
|
| label.set_directionality_mode(Label::AUTO_DETECT_DIRECTIONALITY);
|
|
|
| - base::string16 test_text(ASCIIToUTF16("Here's a string with no returns."));
|
| - label.SetText(test_text);
|
| + label.SetText(ASCIIToUTF16("Here's a string with no returns."));
|
| gfx::Size required_size(label.GetPreferredSize());
|
| gfx::Size extra(22, 8);
|
| - label.SetBounds(0,
|
| - 0,
|
| - required_size.width() + extra.width(),
|
| + label.SetBounds(0, 0, required_size.width() + extra.width(),
|
| required_size.height() + extra.height());
|
|
|
| // Do some basic verifications for all three alignments.
|
| @@ -387,7 +369,7 @@ TEST(LabelTest, DrawSingleLineString) {
|
|
|
| // Centered text.
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be centered horizontally and vertically.
|
| EXPECT_EQ(extra.width() / 2, text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2 , text_bounds.y());
|
| @@ -403,7 +385,7 @@ TEST(LabelTest, DrawSingleLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be left aligned horizontally and centered vertically.
|
| EXPECT_EQ(0, text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2 , text_bounds.y());
|
| @@ -419,7 +401,7 @@ TEST(LabelTest, DrawSingleLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be right aligned horizontally and centered vertically.
|
| EXPECT_EQ(extra.width(), text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2 , text_bounds.y());
|
| @@ -440,9 +422,7 @@ TEST(LabelTest, DrawSingleLineString) {
|
| required_size_with_border.width());
|
| EXPECT_EQ(required_size.height() + border.height(),
|
| required_size_with_border.height());
|
| - label.SetBounds(0,
|
| - 0,
|
| - required_size_with_border.width() + extra.width(),
|
| + label.SetBounds(0, 0, required_size_with_border.width() + extra.width(),
|
| required_size_with_border.height() + extra.height());
|
|
|
| // Centered text with border.
|
| @@ -450,7 +430,7 @@ TEST(LabelTest, DrawSingleLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be centered horizontally and vertically within the border.
|
| EXPECT_EQ(border.left() + extra.width() / 2, text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2 , text_bounds.y());
|
| @@ -466,7 +446,7 @@ TEST(LabelTest, DrawSingleLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be left aligned horizontally and centered vertically.
|
| EXPECT_EQ(border.left(), text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2 , text_bounds.y());
|
| @@ -482,7 +462,7 @@ TEST(LabelTest, DrawSingleLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be right aligned horizontally and centered vertically.
|
| EXPECT_EQ(border.left() + extra.width(), text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2 , text_bounds.y());
|
| @@ -505,13 +485,11 @@ TEST(LabelTest, DrawMultiLineString) {
|
| // align right really means align left.
|
| label.set_directionality_mode(Label::AUTO_DETECT_DIRECTIONALITY);
|
|
|
| - base::string16 test_text(ASCIIToUTF16("Another string\nwith returns\n\n!"));
|
| - label.SetText(test_text);
|
| + label.SetText(ASCIIToUTF16("Another string\nwith returns\n\n!"));
|
| label.SetMultiLine(true);
|
| label.SizeToFit(0);
|
| gfx::Size extra(50, 10);
|
| - label.SetBounds(label.x(),
|
| - label.y(),
|
| + label.SetBounds(label.x(), label.y(),
|
| label.width() + extra.width(),
|
| label.height() + extra.height());
|
|
|
| @@ -520,7 +498,7 @@ TEST(LabelTest, DrawMultiLineString) {
|
| gfx::Rect text_bounds;
|
| int flags;
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(extra.width() / 2, text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2, text_bounds.y());
|
| EXPECT_GT(text_bounds.width(), kMinTextDimension);
|
| @@ -538,7 +516,7 @@ TEST(LabelTest, DrawMultiLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(0, text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2, text_bounds.y());
|
| EXPECT_GT(text_bounds.width(), kMinTextDimension);
|
| @@ -555,7 +533,7 @@ TEST(LabelTest, DrawMultiLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(extra.width(), text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2, text_bounds.y());
|
| EXPECT_GT(text_bounds.width(), kMinTextDimension);
|
| @@ -573,8 +551,7 @@ TEST(LabelTest, DrawMultiLineString) {
|
| label.SetBorder(Border::CreateEmptyBorder(
|
| border.top(), border.left(), border.bottom(), border.right()));
|
| label.SizeToFit(0);
|
| - label.SetBounds(label.x(),
|
| - label.y(),
|
| + label.SetBounds(label.x(), label.y(),
|
| label.width() + extra.width(),
|
| label.height() + extra.height());
|
|
|
| @@ -582,7 +559,7 @@ TEST(LabelTest, DrawMultiLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(border.left() + extra.width() / 2, text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2, text_bounds.y());
|
| EXPECT_EQ(center_bounds.width(), text_bounds.width());
|
| @@ -599,7 +576,7 @@ TEST(LabelTest, DrawMultiLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(border.left(), text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2, text_bounds.y());
|
| EXPECT_EQ(center_bounds.width(), text_bounds.width());
|
| @@ -616,7 +593,7 @@ TEST(LabelTest, DrawMultiLineString) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(extra.width() + border.left(), text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2, text_bounds.y());
|
| EXPECT_EQ(center_bounds.width(), text_bounds.width());
|
| @@ -637,13 +614,10 @@ TEST(LabelTest, DrawSingleLineStringInRTL) {
|
| std::string locale = l10n_util::GetApplicationLocale("");
|
| base::i18n::SetICUDefaultLocale("he");
|
|
|
| - base::string16 test_text(ASCIIToUTF16("Here's a string with no returns."));
|
| - label.SetText(test_text);
|
| + label.SetText(ASCIIToUTF16("Here's a string with no returns."));
|
| gfx::Size required_size(label.GetPreferredSize());
|
| gfx::Size extra(22, 8);
|
| - label.SetBounds(0,
|
| - 0,
|
| - required_size.width() + extra.width(),
|
| + label.SetBounds(0, 0, required_size.width() + extra.width(),
|
| required_size.height() + extra.height());
|
|
|
| // Do some basic verifications for all three alignments.
|
| @@ -653,7 +627,7 @@ TEST(LabelTest, DrawSingleLineStringInRTL) {
|
|
|
| // Centered text.
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be centered horizontally and vertically.
|
| EXPECT_EQ(extra.width() / 2, text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2 , text_bounds.y());
|
| @@ -669,7 +643,7 @@ TEST(LabelTest, DrawSingleLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be right aligned horizontally and centered vertically.
|
| EXPECT_EQ(extra.width(), text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2 , text_bounds.y());
|
| @@ -685,7 +659,7 @@ TEST(LabelTest, DrawSingleLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be left aligned horizontally and centered vertically.
|
| EXPECT_EQ(0, text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2 , text_bounds.y());
|
| @@ -707,9 +681,7 @@ TEST(LabelTest, DrawSingleLineStringInRTL) {
|
| required_size_with_border.width());
|
| EXPECT_EQ(required_size.height() + border.height(),
|
| required_size_with_border.height());
|
| - label.SetBounds(0,
|
| - 0,
|
| - required_size_with_border.width() + extra.width(),
|
| + label.SetBounds(0, 0, required_size_with_border.width() + extra.width(),
|
| required_size_with_border.height() + extra.height());
|
|
|
| // Centered text with border.
|
| @@ -717,7 +689,7 @@ TEST(LabelTest, DrawSingleLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be centered horizontally and vertically within the border.
|
| EXPECT_EQ(border.left() + extra.width() / 2, text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2 , text_bounds.y());
|
| @@ -733,7 +705,7 @@ TEST(LabelTest, DrawSingleLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be right aligned horizontally and centered vertically.
|
| EXPECT_EQ(border.left() + extra.width(), text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2 , text_bounds.y());
|
| @@ -749,7 +721,7 @@ TEST(LabelTest, DrawSingleLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| // The text should be left aligned horizontally and centered vertically.
|
| EXPECT_EQ(border.left(), text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2 , text_bounds.y());
|
| @@ -775,13 +747,11 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
|
| std::string locale = l10n_util::GetApplicationLocale("");
|
| base::i18n::SetICUDefaultLocale("he");
|
|
|
| - base::string16 test_text(ASCIIToUTF16("Another string\nwith returns\n\n!"));
|
| - label.SetText(test_text);
|
| + label.SetText(ASCIIToUTF16("Another string\nwith returns\n\n!"));
|
| label.SetMultiLine(true);
|
| label.SizeToFit(0);
|
| gfx::Size extra(50, 10);
|
| - label.SetBounds(label.x(),
|
| - label.y(),
|
| + label.SetBounds(label.x(), label.y(),
|
| label.width() + extra.width(),
|
| label.height() + extra.height());
|
|
|
| @@ -790,7 +760,7 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
|
| gfx::Rect text_bounds;
|
| int flags;
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(extra.width() / 2, text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2, text_bounds.y());
|
| EXPECT_GT(text_bounds.width(), kMinTextDimension);
|
| @@ -806,7 +776,7 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(extra.width(), text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2, text_bounds.y());
|
| EXPECT_GT(text_bounds.width(), kMinTextDimension);
|
| @@ -821,7 +791,7 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(0, text_bounds.x());
|
| EXPECT_EQ(extra.height() / 2, text_bounds.y());
|
| EXPECT_GT(text_bounds.width(), kMinTextDimension);
|
| @@ -837,8 +807,7 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
|
| label.SetBorder(Border::CreateEmptyBorder(
|
| border.top(), border.left(), border.bottom(), border.right()));
|
| label.SizeToFit(0);
|
| - label.SetBounds(label.x(),
|
| - label.y(),
|
| + label.SetBounds(label.x(), label.y(),
|
| label.width() + extra.width(),
|
| label.height() + extra.height());
|
|
|
| @@ -846,7 +815,7 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(border.left() + extra.width() / 2, text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2, text_bounds.y());
|
| EXPECT_EQ(center_bounds.width(), text_bounds.width());
|
| @@ -861,7 +830,7 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(border.left() + extra.width(), text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2, text_bounds.y());
|
| EXPECT_EQ(center_bounds.width(), text_bounds.width());
|
| @@ -876,7 +845,7 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
|
| paint_text.clear();
|
| text_bounds.SetRect(0, 0, 0, 0);
|
| label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
|
| - EXPECT_EQ(test_text, paint_text);
|
| + EXPECT_EQ(label.text(), paint_text);
|
| EXPECT_EQ(border.left(), text_bounds.x());
|
| EXPECT_EQ(border.top() + extra.height() / 2, text_bounds.y());
|
| EXPECT_EQ(center_bounds.width(), text_bounds.width());
|
|
|