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

Unified Diff: ui/views/controls/button/blue_button_unittest.cc

Issue 1216673005: views::LabelButton should not call virtual methods from its constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150703-Views-ButtonBorderRefactor
Patch Set: self review Created 5 years, 5 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/button/blue_button.cc ('k') | ui/views/controls/button/checkbox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/blue_button_unittest.cc
diff --git a/ui/views/controls/button/blue_button_unittest.cc b/ui/views/controls/button/blue_button_unittest.cc
index d2f92a3e4a1cfaf916787122ba8e077f22a42082..881ec649d2352175683ecb3c5938bc0418ca7619 100644
--- a/ui/views/controls/button/blue_button_unittest.cc
+++ b/ui/views/controls/button/blue_button_unittest.cc
@@ -13,32 +13,18 @@
namespace views {
-namespace {
-
-class TestBlueButton : public BlueButton {
- public:
- TestBlueButton() : BlueButton(NULL, base::ASCIIToUTF16("foo")) {}
- ~TestBlueButton() override {}
-
- using BlueButton::OnNativeThemeChanged;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestBlueButton);
-};
-
-} // namespace
-
typedef ViewsTestBase BlueButtonTest;
TEST_F(BlueButtonTest, Border) {
// Compared to a normal LabelButton...
- LabelButton button(NULL, base::ASCIIToUTF16("foo"));
+ LabelButton button(nullptr);
+ button.InitAsTextbutton(base::ASCIIToUTF16("foo"));
button.SetBoundsRect(gfx::Rect(gfx::Point(0, 0), button.GetPreferredSize()));
gfx::Canvas button_canvas(button.bounds().size(), 1.0, true);
button.border()->Paint(button, &button_canvas);
// ... a special blue border should be used.
- TestBlueButton blue_button;
+ BlueButton blue_button(nullptr, base::ASCIIToUTF16("foo"));
blue_button.SetBoundsRect(gfx::Rect(gfx::Point(0, 0),
blue_button.GetPreferredSize()));
gfx::Canvas canvas(blue_button.bounds().size(), 1.0, true);
« no previous file with comments | « ui/views/controls/button/blue_button.cc ('k') | ui/views/controls/button/checkbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698