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

Unified Diff: views/controls/label_unittest.cc

Issue 8142026: Revert 104076 - Change std::wstring to string16 for views::Link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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 | « views/controls/label.cc ('k') | views/controls/link.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/label_unittest.cc
===================================================================
--- views/controls/label_unittest.cc (revision 104083)
+++ views/controls/label_unittest.cc (working copy)
@@ -41,7 +41,7 @@
TEST(LabelTest, TextProperty) {
Label label;
- string16 test_text(ASCIIToUTF16("A random string."));
+ std::wstring test_text(L"A random string.");
label.SetText(test_text);
EXPECT_EQ(test_text, label.GetText());
}
@@ -52,7 +52,7 @@
GURL url(my_url);
label.SetURL(url);
EXPECT_EQ(my_url, label.GetURL().spec());
- EXPECT_EQ(UTF8ToUTF16(my_url), label.GetText());
+ EXPECT_EQ(UTF8ToWide(my_url), label.GetText());
}
TEST(LabelTest, ColorProperty) {
@@ -111,7 +111,7 @@
TEST(LabelTest, TooltipProperty) {
Label label;
string16 test_text(ASCIIToUTF16("My cool string."));
- label.SetText(test_text);
+ label.SetText(UTF16ToWideHack(test_text));
string16 tooltip;
EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
@@ -158,7 +158,7 @@
TEST(LabelTest, Accessibility) {
Label label;
string16 test_text(ASCIIToUTF16("My special text."));
- label.SetText(test_text);
+ label.SetText(UTF16ToWideHack(test_text));
ui::AccessibleViewState state;
label.GetAccessibleState(&state);
@@ -169,7 +169,7 @@
TEST(LabelTest, SingleLineSizing) {
Label label;
- string16 test_text(ASCIIToUTF16("A not so random string in one line."));
+ std::wstring test_text(L"A not so random string in one line.");
label.SetText(test_text);
// GetPreferredSize
@@ -196,8 +196,7 @@
TEST(LabelTest, MultiLineSizing) {
Label label;
label.set_focusable(false);
- string16 test_text(
- ASCIIToUTF16("A random string\nwith multiple lines\nand returns!"));
+ std::wstring test_text(L"A random string\nwith multiple lines\nand returns!");
label.SetText(test_text);
label.SetMultiLine(true);
@@ -285,7 +284,7 @@
// align right really means align left.
label.set_rtl_alignment_mode(Label::AUTO_DETECT_ALIGNMENT);
- string16 test_text(ASCIIToUTF16("Here's a string with no returns."));
+ std::wstring test_text(L"Here's a string with no returns.");
label.SetText(test_text);
gfx::Size required_size(label.GetPreferredSize());
gfx::Size extra(22, 8);
@@ -295,7 +294,7 @@
required_size.height() + extra.height());
// Do some basic verifications for all three alignments.
- string16 paint_text;
+ std::wstring paint_text;
gfx::Rect text_bounds;
int flags;
@@ -403,7 +402,7 @@
// align right really means align left.
label.set_rtl_alignment_mode(Label::AUTO_DETECT_ALIGNMENT);
- string16 test_text(ASCIIToUTF16("Another string\nwith returns\n\n!"));
+ std::wstring test_text(L"Another string\nwith returns\n\n!");
label.SetText(test_text);
label.SetMultiLine(true);
label.SizeToFit(0);
@@ -414,7 +413,7 @@
label.height() + extra.height());
// Do some basic verifications for all three alignments.
- string16 paint_text;
+ std::wstring paint_text;
gfx::Rect text_bounds;
int flags;
label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
@@ -543,7 +542,7 @@
std::string locale = l10n_util::GetApplicationLocale("");
base::i18n::SetICUDefaultLocale("he");
- string16 test_text(ASCIIToUTF16("Here's a string with no returns."));
+ std::wstring test_text(L"Here's a string with no returns.");
label.SetText(test_text);
gfx::Size required_size(label.GetPreferredSize());
gfx::Size extra(22, 8);
@@ -553,7 +552,7 @@
required_size.height() + extra.height());
// Do some basic verifications for all three alignments.
- string16 paint_text;
+ std::wstring paint_text;
gfx::Rect text_bounds;
int flags;
@@ -665,7 +664,7 @@
std::string locale = l10n_util::GetApplicationLocale("");
base::i18n::SetICUDefaultLocale("he");
- string16 test_text(ASCIIToUTF16("Another string\nwith returns\n\n!"));
+ std::wstring test_text(L"Another string\nwith returns\n\n!");
label.SetText(test_text);
label.SetMultiLine(true);
label.SizeToFit(0);
@@ -676,7 +675,7 @@
label.height() + extra.height());
// Do some basic verifications for all three alignments.
- string16 paint_text;
+ std::wstring paint_text;
gfx::Rect text_bounds;
int flags;
label.CalculateDrawStringParams(&paint_text, &text_bounds, &flags);
« no previous file with comments | « views/controls/label.cc ('k') | views/controls/link.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698