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

Side by Side Diff: ui/views/controls/styled_label_unittest.cc

Issue 681883002: 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
« no previous file with comments | « ui/views/controls/styled_label.h ('k') | ui/views/controls/tabbed_pane/tabbed_pane.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "third_party/skia/include/core/SkColor.h" 11 #include "third_party/skia/include/core/SkColor.h"
12 #include "ui/gfx/font_list.h" 12 #include "ui/gfx/font_list.h"
13 #include "ui/views/border.h" 13 #include "ui/views/border.h"
14 #include "ui/views/controls/link.h" 14 #include "ui/views/controls/link.h"
15 #include "ui/views/controls/styled_label.h" 15 #include "ui/views/controls/styled_label.h"
16 #include "ui/views/controls/styled_label_listener.h" 16 #include "ui/views/controls/styled_label_listener.h"
17 #include "ui/views/test/views_test_base.h" 17 #include "ui/views/test/views_test_base.h"
18 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
19 19
20 using base::ASCIIToUTF16; 20 using base::ASCIIToUTF16;
21 21
22 namespace views { 22 namespace views {
23 23
24 class StyledLabelTest : public ViewsTestBase, public StyledLabelListener { 24 class StyledLabelTest : public ViewsTestBase, public StyledLabelListener {
25 public: 25 public:
26 StyledLabelTest() {} 26 StyledLabelTest() {}
27 virtual ~StyledLabelTest() {} 27 ~StyledLabelTest() override {}
28 28
29 // StyledLabelListener implementation. 29 // StyledLabelListener implementation.
30 virtual void StyledLabelLinkClicked(const gfx::Range& range, 30 void StyledLabelLinkClicked(const gfx::Range& range,
31 int event_flags) override {} 31 int event_flags) override {}
32 32
33 protected: 33 protected:
34 StyledLabel* styled() { return styled_.get(); } 34 StyledLabel* styled() { return styled_.get(); }
35 35
36 void InitStyledLabel(const std::string& ascii_text) { 36 void InitStyledLabel(const std::string& ascii_text) {
37 styled_.reset(new StyledLabel(ASCIIToUTF16(ascii_text), this)); 37 styled_.reset(new StyledLabel(ASCIIToUTF16(ascii_text), this));
38 styled_->set_owned_by_client(); 38 styled_->set_owned_by_client();
39 } 39 }
40 40
41 int StyledLabelContentHeightForWidth(int w) { 41 int StyledLabelContentHeightForWidth(int w) {
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 } 416 }
417 417
418 TEST_F(StyledLabelTest, HandleEmptyLayout) { 418 TEST_F(StyledLabelTest, HandleEmptyLayout) {
419 const std::string text("This is a test block of text."); 419 const std::string text("This is a test block of text.");
420 InitStyledLabel(text); 420 InitStyledLabel(text);
421 styled()->Layout(); 421 styled()->Layout();
422 EXPECT_EQ(0, styled()->child_count()); 422 EXPECT_EQ(0, styled()->child_count());
423 } 423 }
424 424
425 } // namespace views 425 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/styled_label.h ('k') | ui/views/controls/tabbed_pane/tabbed_pane.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698