| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/menu_button.h" | 5 #include "ui/views/controls/button/menu_button.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 } | 440 } |
| 441 | 441 |
| 442 TEST_F(MenuButtonTest, | 442 TEST_F(MenuButtonTest, |
| 443 InkDropStateForMenuButtonActivationsWithListenerThatDoesntAcquireALock) { | 443 InkDropStateForMenuButtonActivationsWithListenerThatDoesntAcquireALock) { |
| 444 TestMenuButtonListener menu_button_listener; | 444 TestMenuButtonListener menu_button_listener; |
| 445 CreateMenuButtonWithMenuButtonListener(&menu_button_listener); | 445 CreateMenuButtonWithMenuButtonListener(&menu_button_listener); |
| 446 TestInkDropDelegate ink_drop_delegate; | 446 TestInkDropDelegate ink_drop_delegate; |
| 447 button()->set_ink_drop_delegate(&ink_drop_delegate); | 447 button()->set_ink_drop_delegate(&ink_drop_delegate); |
| 448 button()->Activate(nullptr); | 448 button()->Activate(nullptr); |
| 449 | 449 |
| 450 EXPECT_EQ(InkDropState::QUICK_ACTION, ink_drop_delegate.state()); | 450 EXPECT_EQ(InkDropState::ACTION_TRIGGERED, ink_drop_delegate.state()); |
| 451 } | 451 } |
| 452 | 452 |
| 453 TEST_F( | 453 TEST_F( |
| 454 MenuButtonTest, | 454 MenuButtonTest, |
| 455 InkDropStateForMenuButtonActivationsWithListenerThatDontReleaseAllLocks) { | 455 InkDropStateForMenuButtonActivationsWithListenerThatDontReleaseAllLocks) { |
| 456 PressStateMenuButtonListener menu_button_listener(false); | 456 PressStateMenuButtonListener menu_button_listener(false); |
| 457 CreateMenuButtonWithMenuButtonListener(&menu_button_listener); | 457 CreateMenuButtonWithMenuButtonListener(&menu_button_listener); |
| 458 menu_button_listener.set_menu_button(button()); | 458 menu_button_listener.set_menu_button(button()); |
| 459 TestInkDropDelegate ink_drop_delegate; | 459 TestInkDropDelegate ink_drop_delegate; |
| 460 button()->set_ink_drop_delegate(&ink_drop_delegate); | 460 button()->set_ink_drop_delegate(&ink_drop_delegate); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 generator()->MoveTouch(gfx::Point(10, 30)); | 603 generator()->MoveTouch(gfx::Point(10, 30)); |
| 604 generator()->ReleaseTouch(); | 604 generator()->ReleaseTouch(); |
| 605 EXPECT_EQ(Button::STATE_NORMAL, button()->state()); | 605 EXPECT_EQ(Button::STATE_NORMAL, button()->state()); |
| 606 EXPECT_EQ(nullptr, menu_button_listener.last_source()); | 606 EXPECT_EQ(nullptr, menu_button_listener.last_source()); |
| 607 } | 607 } |
| 608 | 608 |
| 609 #endif // !defined(OS_MACOSX) || defined(USE_AURA) | 609 #endif // !defined(OS_MACOSX) || defined(USE_AURA) |
| 610 | 610 |
| 611 } // namespace views | 611 } // namespace views |
| 612 } // namespace test | 612 } // namespace test |
| OLD | NEW |