| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/toggle_button.h" | 5 #include "ui/views/controls/button/toggle_button.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 // Starts ink drop animation on a ToggleButton and destroys the button. | 84 // Starts ink drop animation on a ToggleButton and destroys the button. |
| 85 // The test verifies that the ink drop layer is removed properly when the | 85 // The test verifies that the ink drop layer is removed properly when the |
| 86 // ToggleButton gets destroyed. | 86 // ToggleButton gets destroyed. |
| 87 TEST_F(ToggleButtonTest, ToggleButtonDestroyed) { | 87 TEST_F(ToggleButtonTest, ToggleButtonDestroyed) { |
| 88 EXPECT_EQ(0, counter()); | 88 EXPECT_EQ(0, counter()); |
| 89 gfx::Point center(10, 10); | 89 gfx::Point center(10, 10); |
| 90 button()->OnMousePressed(ui::MouseEvent( | 90 button()->OnMousePressed(ui::MouseEvent( |
| 91 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(), | 91 ui::ET_MOUSE_PRESSED, center, center, ui::EventTimeForNow(), |
| 92 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON)); | 92 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 93 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE))); |
| 93 EXPECT_EQ(1, counter()); | 94 EXPECT_EQ(1, counter()); |
| 94 delete button(); | 95 delete button(); |
| 95 EXPECT_EQ(0, counter()); | 96 EXPECT_EQ(0, counter()); |
| 96 } | 97 } |
| 97 | 98 |
| 98 } // namespace views | 99 } // namespace views |
| OLD | NEW |