| Index: chrome/browser/ui/views/toolbar/toolbar_action_view_unittest.cc
|
| diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view_unittest.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view_unittest.cc
|
| index a7afc4194b910b72af2d0f01ae9e20f5c764552f..3b6fe74fb106506803bc2e3178eeec47bc1e237e 100644
|
| --- a/chrome/browser/ui/views/toolbar/toolbar_action_view_unittest.cc
|
| +++ b/chrome/browser/ui/views/toolbar/toolbar_action_view_unittest.cc
|
| @@ -117,8 +117,13 @@ class ToolbarActionViewUnitTest : public views::ViewsTestBase {
|
| views::ViewsTestBase::TearDown();
|
| }
|
|
|
| + protected:
|
| views::Widget* widget() { return widget_; }
|
|
|
| + void SetDraggedView(views::View* dragged_view) {
|
| + widget()->set_dragged_view(dragged_view);
|
| + }
|
| +
|
| private:
|
| // The widget managed by this test.
|
| views::Widget* widget_;
|
| @@ -192,6 +197,16 @@ TEST_F(ToolbarActionViewUnitTest, BasicToolbarActionViewTest) {
|
| controller.HidePopup();
|
| EXPECT_EQ(views::Button::STATE_NORMAL, view.state());
|
|
|
| + // Simulate dragging |view|. Once a drag is started a capture loss should
|
| + // reset button state.
|
| + view.SetHotTracked(true);
|
| + EXPECT_EQ(views::Button::ButtonState::STATE_HOVERED, view.state());
|
| + SetDraggedView(&view);
|
| + widget()->SetCapture(&view);
|
| + widget()->ReleaseCapture();
|
| + EXPECT_EQ(views::Button::ButtonState::STATE_NORMAL, view.state());
|
| + SetDraggedView(nullptr);
|
| +
|
| // Ensure that the button's enabled state reflects that of the controller.
|
| controller.SetEnabled(false);
|
| EXPECT_EQ(views::Button::STATE_DISABLED, view.state());
|
|
|