OLD | NEW |
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/label_button.h" | 5 #include "ui/views/controls/button/label_button.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 } | 469 } |
470 | 470 |
471 void TearDown() override { | 471 void TearDown() override { |
472 widget_.reset(); | 472 widget_.reset(); |
473 ViewsTestBase::TearDown(); | 473 ViewsTestBase::TearDown(); |
474 ui::test::MaterialDesignControllerTestAPI::UninitializeMode(); | 474 ui::test::MaterialDesignControllerTestAPI::UninitializeMode(); |
475 } | 475 } |
476 | 476 |
477 protected: | 477 protected: |
478 // Required to host the test target. | 478 // Required to host the test target. |
479 scoped_ptr<Widget> widget_; | 479 std::unique_ptr<Widget> widget_; |
480 | 480 |
481 // The test target. | 481 // The test target. |
482 InkDropLabelButton* button_ = nullptr; | 482 InkDropLabelButton* button_ = nullptr; |
483 | 483 |
484 private: | 484 private: |
485 DISALLOW_COPY_AND_ASSIGN(InkDropLabelButtonTest); | 485 DISALLOW_COPY_AND_ASSIGN(InkDropLabelButtonTest); |
486 }; | 486 }; |
487 | 487 |
488 TEST_F(InkDropLabelButtonTest, HoverStateAfterMouseEnterAndExitEvents) { | 488 TEST_F(InkDropLabelButtonTest, HoverStateAfterMouseEnterAndExitEvents) { |
489 ui::test::EventGenerator event_generator(GetContext(), | 489 ui::test::EventGenerator event_generator(GetContext(), |
(...skipping 14 matching lines...) Expand all Loading... |
504 | 504 |
505 // Verifies the target event handler View is the |LabelButton| and not any of | 505 // Verifies the target event handler View is the |LabelButton| and not any of |
506 // the child Views. | 506 // the child Views. |
507 TEST_F(InkDropLabelButtonTest, TargetEventHandler) { | 507 TEST_F(InkDropLabelButtonTest, TargetEventHandler) { |
508 View* target_view = widget_->GetRootView()->GetEventHandlerForPoint( | 508 View* target_view = widget_->GetRootView()->GetEventHandlerForPoint( |
509 button_->bounds().CenterPoint()); | 509 button_->bounds().CenterPoint()); |
510 EXPECT_EQ(button_, target_view); | 510 EXPECT_EQ(button_, target_view); |
511 } | 511 } |
512 | 512 |
513 } // namespace views | 513 } // namespace views |
OLD | NEW |