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

Unified Diff: ui/views/controls/styled_label_unittest.cc

Issue 24012002: Move Range code to gfx. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: d Created 7 years, 3 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/controls/styled_label_listener.h ('k') | ui/views/controls/textfield/native_textfield_views.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/styled_label_unittest.cc
diff --git a/ui/views/controls/styled_label_unittest.cc b/ui/views/controls/styled_label_unittest.cc
index 3e2b15354b62c2da3c53a00d92e1e8826454e57d..dac53930f2fd937afcb64eb3de5a95e27716c1eb 100644
--- a/ui/views/controls/styled_label_unittest.cc
+++ b/ui/views/controls/styled_label_unittest.cc
@@ -21,7 +21,7 @@ class StyledLabelTest : public testing::Test, public StyledLabelListener {
virtual ~StyledLabelTest() {}
// StyledLabelListener implementation.
- virtual void StyledLabelLinkClicked(const ui::Range& range,
+ virtual void StyledLabelLinkClicked(const gfx::Range& range,
int event_flags) OVERRIDE {}
protected:
@@ -121,13 +121,13 @@ TEST_F(StyledLabelTest, BasicWrapping) {
TEST_F(StyledLabelTest, CreateLinks) {
const std::string text("This is a test block of text.");
InitStyledLabel(text);
- styled()->AddStyleRange(ui::Range(0, 1),
+ styled()->AddStyleRange(gfx::Range(0, 1),
StyledLabel::RangeStyleInfo::CreateForLink());
- styled()->AddStyleRange(ui::Range(1, 2),
+ styled()->AddStyleRange(gfx::Range(1, 2),
StyledLabel::RangeStyleInfo::CreateForLink());
- styled()->AddStyleRange(ui::Range(10, 11),
+ styled()->AddStyleRange(gfx::Range(10, 11),
StyledLabel::RangeStyleInfo::CreateForLink());
- styled()->AddStyleRange(ui::Range(12, 13),
+ styled()->AddStyleRange(gfx::Range(12, 13),
StyledLabel::RangeStyleInfo::CreateForLink());
styled()->SetBounds(0, 0, 1000, 1000);
@@ -140,7 +140,7 @@ TEST_F(StyledLabelTest, DontBreakLinks) {
const std::string link_text("and this should be a link");
InitStyledLabel(text + link_text);
styled()->AddStyleRange(
- ui::Range(text.size(), text.size() + link_text.size()),
+ gfx::Range(text.size(), text.size() + link_text.size()),
StyledLabel::RangeStyleInfo::CreateForLink());
Label label(ASCIIToUTF16(text + link_text.substr(0, link_text.size() / 2)));
@@ -163,7 +163,7 @@ TEST_F(StyledLabelTest, StyledRangeWithDisabledLineWrapping) {
StyledLabel::RangeStyleInfo style_info;
style_info.disable_line_wrapping = true;
styled()->AddStyleRange(
- ui::Range(text.size(), text.size() + unbreakable_text.size()),
+ gfx::Range(text.size(), text.size() + unbreakable_text.size()),
style_info);
Label label(ASCIIToUTF16(
@@ -187,7 +187,7 @@ TEST_F(StyledLabelTest, StyledRangeUnderlined) {
StyledLabel::RangeStyleInfo style_info;
style_info.font_style = gfx::Font::UNDERLINE;
styled()->AddStyleRange(
- ui::Range(text.size(), text.size() + underlined_text.size()),
+ gfx::Range(text.size(), text.size() + underlined_text.size()),
style_info);
styled()->SetBounds(0, 0, 1000, 1000);
@@ -208,7 +208,7 @@ TEST_F(StyledLabelTest, StyledRangeBold) {
StyledLabel::RangeStyleInfo style_info;
style_info.font_style = gfx::Font::BOLD;
- styled()->AddStyleRange(ui::Range(0, bold_text.size()), style_info);
+ styled()->AddStyleRange(gfx::Range(0, bold_text.size()), style_info);
// Calculate the bold text width if it were a pure label view, both with bold
// and normal style.
@@ -265,11 +265,11 @@ TEST_F(StyledLabelTest, Color) {
StyledLabel::RangeStyleInfo style_info_red;
style_info_red.color = SK_ColorRED;
- styled()->AddStyleRange(ui::Range(0, text_red.size()), style_info_red);
+ styled()->AddStyleRange(gfx::Range(0, text_red.size()), style_info_red);
StyledLabel::RangeStyleInfo style_info_link =
StyledLabel::RangeStyleInfo::CreateForLink();
- styled()->AddStyleRange(ui::Range(text_red.size(),
+ styled()->AddStyleRange(gfx::Range(text_red.size(),
text_red.size() + text_link.size()),
style_info_link);
@@ -323,9 +323,9 @@ TEST_F(StyledLabelTest, StyledRangeWithTooltip) {
StyledLabel::RangeStyleInfo tooltip_style;
tooltip_style.tooltip = ASCIIToUTF16("tooltip");
styled()->AddStyleRange(
- ui::Range(tooltip_start, tooltip_start + tooltip_text.size()),
+ gfx::Range(tooltip_start, tooltip_start + tooltip_text.size()),
tooltip_style);
- styled()->AddStyleRange(ui::Range(link_start, link_start + link_text.size()),
+ styled()->AddStyleRange(gfx::Range(link_start, link_start + link_text.size()),
StyledLabel::RangeStyleInfo::CreateForLink());
// Break line inside the range with the tooltip.
« no previous file with comments | « ui/views/controls/styled_label_listener.h ('k') | ui/views/controls/textfield/native_textfield_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698