| 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 <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3263 }; | 3263 }; |
| 3264 | 3264 |
| 3265 SubclassWindowHelper* SubclassWindowHelper::instance_ = nullptr; | 3265 SubclassWindowHelper* SubclassWindowHelper::instance_ = nullptr; |
| 3266 | 3266 |
| 3267 // This test validates whether the WM_SYSCOMMAND message for SC_MOVE is | 3267 // This test validates whether the WM_SYSCOMMAND message for SC_MOVE is |
| 3268 // received when we post a WM_NCLBUTTONDOWN message for the caption in the | 3268 // received when we post a WM_NCLBUTTONDOWN message for the caption in the |
| 3269 // following scenarios:- | 3269 // following scenarios:- |
| 3270 // 1. Posting a WM_NCMOUSEMOVE message for a different location. | 3270 // 1. Posting a WM_NCMOUSEMOVE message for a different location. |
| 3271 // 2. Posting a WM_NCMOUSEMOVE message with a different hittest code. | 3271 // 2. Posting a WM_NCMOUSEMOVE message with a different hittest code. |
| 3272 // 3. Posting a WM_MOUSEMOVE message. | 3272 // 3. Posting a WM_MOUSEMOVE message. |
| 3273 TEST_F(WidgetTest, SysCommandMoveOnNCLButtonDownOnCaptionAndMoveTest) { | 3273 // Disabled because of flaky timeouts: http://crbug.com/592742 |
| 3274 TEST_F(WidgetTest, DISABLED_SysCommandMoveOnNCLButtonDownOnCaptionAndMoveTest) { |
| 3274 Widget widget; | 3275 Widget widget; |
| 3275 Widget::InitParams params = | 3276 Widget::InitParams params = |
| 3276 CreateParams(Widget::InitParams::TYPE_WINDOW); | 3277 CreateParams(Widget::InitParams::TYPE_WINDOW); |
| 3277 params.native_widget = | 3278 params.native_widget = |
| 3278 CreatePlatformDesktopNativeWidgetImpl(params, &widget, nullptr); | 3279 CreatePlatformDesktopNativeWidgetImpl(params, &widget, nullptr); |
| 3279 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 3280 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 3280 widget.Init(params); | 3281 widget.Init(params); |
| 3281 widget.SetBounds(gfx::Rect(0, 0, 200, 200)); | 3282 widget.SetBounds(gfx::Rect(0, 0, 200, 200)); |
| 3282 widget.Show(); | 3283 widget.Show(); |
| 3283 ::SetCursorPos(500, 500); | 3284 ::SetCursorPos(500, 500); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3336 | 3337 |
| 3337 EXPECT_TRUE(subclass_helper.received_message(WM_NCLBUTTONDOWN)); | 3338 EXPECT_TRUE(subclass_helper.received_message(WM_NCLBUTTONDOWN)); |
| 3338 EXPECT_TRUE(subclass_helper.received_message(WM_MOUSEMOVE)); | 3339 EXPECT_TRUE(subclass_helper.received_message(WM_MOUSEMOVE)); |
| 3339 EXPECT_TRUE(subclass_helper.received_message(WM_SYSCOMMAND)); | 3340 EXPECT_TRUE(subclass_helper.received_message(WM_SYSCOMMAND)); |
| 3340 | 3341 |
| 3341 widget.CloseNow(); | 3342 widget.CloseNow(); |
| 3342 } | 3343 } |
| 3343 | 3344 |
| 3344 // This test validates that destroying the window in the context of the | 3345 // This test validates that destroying the window in the context of the |
| 3345 // WM_SYSCOMMAND message with SC_MOVE does not crash. | 3346 // WM_SYSCOMMAND message with SC_MOVE does not crash. |
| 3346 TEST_F(WidgetTest, DestroyInSysCommandNCLButtonDownOnCaption) { | 3347 // Disabled because of flaky timeouts: http://crbug.com/592742 |
| 3348 TEST_F(WidgetTest, DISABLED_DestroyInSysCommandNCLButtonDownOnCaption) { |
| 3347 Widget widget; | 3349 Widget widget; |
| 3348 Widget::InitParams params = | 3350 Widget::InitParams params = |
| 3349 CreateParams(Widget::InitParams::TYPE_WINDOW); | 3351 CreateParams(Widget::InitParams::TYPE_WINDOW); |
| 3350 params.native_widget = | 3352 params.native_widget = |
| 3351 CreatePlatformDesktopNativeWidgetImpl(params, &widget, nullptr); | 3353 CreatePlatformDesktopNativeWidgetImpl(params, &widget, nullptr); |
| 3352 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 3354 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 3353 widget.Init(params); | 3355 widget.Init(params); |
| 3354 widget.SetBounds(gfx::Rect(0, 0, 200, 200)); | 3356 widget.SetBounds(gfx::Rect(0, 0, 200, 200)); |
| 3355 widget.Show(); | 3357 widget.Show(); |
| 3356 ::SetCursorPos(500, 500); | 3358 ::SetCursorPos(500, 500); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3495 // Moving the child to a different widget should call the removals observer. | 3497 // Moving the child to a different widget should call the removals observer. |
| 3496 WidgetAutoclosePtr widget2(CreateTopLevelPlatformWidget()); | 3498 WidgetAutoclosePtr widget2(CreateTopLevelPlatformWidget()); |
| 3497 widget2->client_view()->AddChildView(child); | 3499 widget2->client_view()->AddChildView(child); |
| 3498 EXPECT_TRUE(removals_observer.DidRemoveView(child)); | 3500 EXPECT_TRUE(removals_observer.DidRemoveView(child)); |
| 3499 | 3501 |
| 3500 widget->RemoveRemovalsObserver(&removals_observer); | 3502 widget->RemoveRemovalsObserver(&removals_observer); |
| 3501 } | 3503 } |
| 3502 | 3504 |
| 3503 } // namespace test | 3505 } // namespace test |
| 3504 } // namespace views | 3506 } // namespace views |
| OLD | NEW |