Chromium Code Reviews| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <memory> | 6 #include <memory> |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 3609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3620 EXPECT_FALSE(removals_observer.DidRemoveView(child)); | 3620 EXPECT_FALSE(removals_observer.DidRemoveView(child)); |
| 3621 | 3621 |
| 3622 // Moving the child to a different widget should call the removals observer. | 3622 // Moving the child to a different widget should call the removals observer. |
| 3623 WidgetAutoclosePtr widget2(CreateTopLevelPlatformWidget()); | 3623 WidgetAutoclosePtr widget2(CreateTopLevelPlatformWidget()); |
| 3624 widget2->client_view()->AddChildView(child); | 3624 widget2->client_view()->AddChildView(child); |
| 3625 EXPECT_TRUE(removals_observer.DidRemoveView(child)); | 3625 EXPECT_TRUE(removals_observer.DidRemoveView(child)); |
| 3626 | 3626 |
| 3627 widget->RemoveRemovalsObserver(&removals_observer); | 3627 widget->RemoveRemovalsObserver(&removals_observer); |
| 3628 } | 3628 } |
| 3629 | 3629 |
| 3630 TEST_F(WidgetTest, MouseWheelEvent) { | |
|
tapted
2016/10/30 23:54:46
nit: tests should have a comment describing their
snake
2016/10/31 11:32:06
Done.
| |
| 3631 Widget* widget = CreateTopLevelPlatformWidget(); | |
|
sadrul
2016/10/29 05:52:54
Like the tests above, use WidgetAutoclosePtr inste
snake
2016/10/31 11:32:06
Done.
| |
| 3632 widget->SetBounds(gfx::Rect(0, 0, 600, 600)); | |
| 3633 EventCountView* event_count_view = new EventCountView(); | |
| 3634 widget->GetContentsView()->AddChildView(event_count_view); | |
| 3635 event_count_view->SetBounds(0, 0, 600, 600); | |
| 3636 widget->Show(); | |
| 3637 | |
| 3638 ui::test::EventGenerator event_generator(GetContext(), | |
| 3639 widget->GetNativeWindow()); | |
| 3640 | |
| 3641 event_generator.MoveMouseWheel(1, 1); | |
| 3642 EXPECT_EQ(1, event_count_view->GetEventCount(ui::ET_MOUSEWHEEL)); | |
| 3643 event_count_view->ResetCounts(); | |
| 3644 | |
| 3645 widget->CloseNow(); | |
| 3646 } | |
| 3647 | |
| 3630 #if defined(OS_WIN) | 3648 #if defined(OS_WIN) |
| 3631 | 3649 |
| 3632 namespace { | 3650 namespace { |
| 3633 | 3651 |
| 3634 // Provides functionality to create a window modal dialog. | 3652 // Provides functionality to create a window modal dialog. |
| 3635 class ModalDialogDelegate : public DialogDelegateView { | 3653 class ModalDialogDelegate : public DialogDelegateView { |
| 3636 public: | 3654 public: |
| 3637 explicit ModalDialogDelegate(ui::ModalType type) : type_(type) {} | 3655 explicit ModalDialogDelegate(ui::ModalType type) : type_(type) {} |
| 3638 ~ModalDialogDelegate() override {} | 3656 ~ModalDialogDelegate() override {} |
| 3639 | 3657 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3827 Transparency_DesktopWidgetTranslucent | 3845 Transparency_DesktopWidgetTranslucent |
| 3828 #endif | 3846 #endif |
| 3829 TEST_F(CompositingWidgetTest, MAYBE_Transparency_DesktopWidgetTranslucent) { | 3847 TEST_F(CompositingWidgetTest, MAYBE_Transparency_DesktopWidgetTranslucent) { |
| 3830 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW); | 3848 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW); |
| 3831 } | 3849 } |
| 3832 | 3850 |
| 3833 #endif // !defined(OS_CHROMEOS) | 3851 #endif // !defined(OS_CHROMEOS) |
| 3834 | 3852 |
| 3835 } // namespace test | 3853 } // namespace test |
| 3836 } // namespace views | 3854 } // namespace views |
| OLD | NEW |