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

Side by Side Diff: ui/views/controls/button/custom_button_unittest.cc

Issue 1550443002: Pushed InkDropHost inheritence up to CustomButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/button/image_button.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/controls/button/custom_button.h" 5 #include "ui/views/controls/button/custom_button.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/base/layout.h" 10 #include "ui/base/layout.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 private: 126 private:
127 InkDropHost* ink_drop_host_; 127 InkDropHost* ink_drop_host_;
128 bool* ink_shown_; 128 bool* ink_shown_;
129 bool* ink_hidden_; 129 bool* ink_hidden_;
130 130
131 DISALLOW_COPY_AND_ASSIGN(TestInkDropDelegate); 131 DISALLOW_COPY_AND_ASSIGN(TestInkDropDelegate);
132 }; 132 };
133 133
134 // A test Button class that owns a TestInkDropDelegate. 134 // A test Button class that owns a TestInkDropDelegate.
135 class TestButtonWithInkDrop : public TestCustomButton, 135 class TestButtonWithInkDrop : public TestCustomButton {
136 public views::InkDropHost {
137 public: 136 public:
138 TestButtonWithInkDrop(bool* ink_shown, bool* ink_hidden) 137 TestButtonWithInkDrop(bool* ink_shown, bool* ink_hidden)
139 : TestCustomButton(), 138 : TestCustomButton(),
140 ink_drop_delegate_( 139 ink_drop_delegate_(
141 new TestInkDropDelegate(this, ink_shown, ink_hidden)) { 140 new TestInkDropDelegate(this, ink_shown, ink_hidden)) {
142 set_ink_drop_delegate(ink_drop_delegate_.get()); 141 set_ink_drop_delegate(ink_drop_delegate_.get());
143 } 142 }
144 ~TestButtonWithInkDrop() override {} 143 ~TestButtonWithInkDrop() override {}
145 144
146 // views::InkDropHost: 145 // views::InkDropHost:
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 generator.PressLeftButton(); 466 generator.PressLeftButton();
468 EXPECT_TRUE(ink_shown()); 467 EXPECT_TRUE(ink_shown());
469 EXPECT_FALSE(ink_hidden()); 468 EXPECT_FALSE(ink_hidden());
470 469
471 widget()->SetCapture(button()); 470 widget()->SetCapture(button());
472 widget()->ReleaseCapture(); 471 widget()->ReleaseCapture();
473 EXPECT_TRUE(ink_hidden()); 472 EXPECT_TRUE(ink_hidden());
474 } 473 }
475 474
476 } // namespace views 475 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698