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

Side by Side Diff: ui/message_center/views/bounded_label_unittest.cc

Issue 657923005: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 "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_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 11 matching lines...) Expand all
22 22
23 class BoundedLabelTest : public testing::Test { 23 class BoundedLabelTest : public testing::Test {
24 public: 24 public:
25 BoundedLabelTest() { 25 BoundedLabelTest() {
26 digit_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("0"), font_list_); 26 digit_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("0"), font_list_);
27 space_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16(" "), font_list_); 27 space_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16(" "), font_list_);
28 ellipsis_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("\xE2\x80\xA6"), 28 ellipsis_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("\xE2\x80\xA6"),
29 font_list_); 29 font_list_);
30 } 30 }
31 31
32 virtual ~BoundedLabelTest() {} 32 ~BoundedLabelTest() override {}
33 33
34 // Replaces all occurences of three periods ("...") in the specified string 34 // Replaces all occurences of three periods ("...") in the specified string
35 // with an ellipses character (UTF8 "\xE2\x80\xA6") and returns a string16 35 // with an ellipses character (UTF8 "\xE2\x80\xA6") and returns a string16
36 // with the results. This allows test strings to be specified as ASCII const 36 // with the results. This allows test strings to be specified as ASCII const
37 // char* strings, making tests more readable and easier to write. 37 // char* strings, making tests more readable and easier to write.
38 base::string16 ToString(const char* string) { 38 base::string16 ToString(const char* string) {
39 const base::string16 periods = base::UTF8ToUTF16("..."); 39 const base::string16 periods = base::UTF8ToUTF16("...");
40 const base::string16 ellipses = base::UTF8ToUTF16("\xE2\x80\xA6"); 40 const base::string16 ellipses = base::UTF8ToUTF16("\xE2\x80\xA6");
41 base::string16 result = base::UTF8ToUTF16(string); 41 base::string16 result = base::UTF8ToUTF16(string);
42 ReplaceSubstringsAfterOffset(&result, 0, periods, ellipses); 42 ReplaceSubstringsAfterOffset(&result, 0, periods, ellipses);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 // TODO(dharcourt): Add test cases to verify that: 212 // TODO(dharcourt): Add test cases to verify that:
213 // - SetMaxLines() affects the return values of some methods but not others. 213 // - SetMaxLines() affects the return values of some methods but not others.
214 // - Bound changes affects GetPreferredLines(), GetTextSize(), and 214 // - Bound changes affects GetPreferredLines(), GetTextSize(), and
215 // GetWrappedText() return values. 215 // GetWrappedText() return values.
216 // - GetTextFlags are as expected. 216 // - GetTextFlags are as expected.
217 217
218 } // namespace test 218 } // namespace test
219 219
220 } // namespace message_center 220 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/bounded_label.cc ('k') | ui/message_center/views/desktop_popup_alignment_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698