OLD | NEW |
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 "ui/message_center/views/bounded_label.h" | 5 #include "ui/message_center/views/bounded_label.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 label_->SetLineLimit(lines_); | 76 label_->SetLineLimit(lines_); |
77 return *this; | 77 return *this; |
78 } | 78 } |
79 | 79 |
80 private: | 80 private: |
81 // The default font list, which will be used for tests. | 81 // The default font list, which will be used for tests. |
82 gfx::FontList font_list_; | 82 gfx::FontList font_list_; |
83 int digit_pixels_; | 83 int digit_pixels_; |
84 int space_pixels_; | 84 int space_pixels_; |
85 int ellipsis_pixels_; | 85 int ellipsis_pixels_; |
86 scoped_ptr<BoundedLabel> label_; | 86 std::unique_ptr<BoundedLabel> label_; |
87 int lines_; | 87 int lines_; |
88 }; | 88 }; |
89 | 89 |
90 /* Test macro *****************************************************************/ | 90 /* Test macro *****************************************************************/ |
91 | 91 |
92 #define TEST_WRAP(expected, text, width, lines) \ | 92 #define TEST_WRAP(expected, text, width, lines) \ |
93 EXPECT_EQ(ToString(expected), \ | 93 EXPECT_EQ(ToString(expected), \ |
94 Label(ToString(text), lines).GetWrappedText(ToPixels(width))) | 94 Label(ToString(text), lines).GetWrappedText(ToPixels(width))) |
95 | 95 |
96 #define TEST_LINES(expected, text, width, lines) \ | 96 #define TEST_LINES(expected, text, width, lines) \ |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 // TODO(dharcourt): Add test cases to verify that: | 210 // TODO(dharcourt): Add test cases to verify that: |
211 // - SetMaxLines() affects the return values of some methods but not others. | 211 // - SetMaxLines() affects the return values of some methods but not others. |
212 // - Bound changes affects GetPreferredLines(), GetTextSize(), and | 212 // - Bound changes affects GetPreferredLines(), GetTextSize(), and |
213 // GetWrappedText() return values. | 213 // GetWrappedText() return values. |
214 // - GetTextFlags are as expected. | 214 // - GetTextFlags are as expected. |
215 | 215 |
216 } // namespace test | 216 } // namespace test |
217 | 217 |
218 } // namespace message_center | 218 } // namespace message_center |
OLD | NEW |