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

Unified Diff: ui/views/accessible_pane_view_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 | « no previous file | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/accessible_pane_view_unittest.cc
diff --git a/ui/views/accessible_pane_view_unittest.cc b/ui/views/accessible_pane_view_unittest.cc
index d53fb72f67db1d0e3513b3b11a5633e2f249bce5..10f5556377a5022f3b01280870629332db9d1509 100644
--- a/ui/views/accessible_pane_view_unittest.cc
+++ b/ui/views/accessible_pane_view_unittest.cc
@@ -35,6 +35,7 @@ class TestBarView : public AccessiblePaneView,
private:
void Init();
+ LabelButton* CreateButton(bool add);
scoped_ptr<LabelButton> child_button_;
scoped_ptr<LabelButton> second_child_button_;
@@ -56,14 +57,18 @@ void TestBarView::ButtonPressed(Button* sender, const ui::Event& event) {
void TestBarView::Init() {
SetLayoutManager(new FillLayout());
- base::string16 label;
- child_button_.reset(new LabelButton(this, label));
- AddChildView(child_button_.get());
- second_child_button_.reset(new LabelButton(this, label));
- AddChildView(second_child_button_.get());
- third_child_button_.reset(new LabelButton(this, label));
- AddChildView(third_child_button_.get());
- not_child_button_.reset(new LabelButton(this, label));
+ child_button_.reset(CreateButton(true));
+ second_child_button_.reset(CreateButton(true));
+ third_child_button_.reset(CreateButton(true));
+ not_child_button_.reset(CreateButton(false));
+}
+
+LabelButton* TestBarView::CreateButton(bool add) {
+ LabelButton* button = new LabelButton(this);
+ button->InitAsTextbutton(base::string16());
+ if (add)
+ AddChildView(button);
+ return button;
}
View* TestBarView::GetDefaultFocusableChild() {
« no previous file with comments | « no previous file | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698