Chromium Code Reviews| Index: ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc |
| diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc |
| index 30dc551f913c58cbebb587f6aa7df8dad3635e9a..4098b64b7455df22ba111e3c4fb28a2bbdbcd030 100644 |
| --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc |
| +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc |
| @@ -34,8 +34,46 @@ TEST_F(DesktopNativeWidgetAuraTest, CreateWithParentNotInRootWindow) { |
| // bounds after the widget is resized. |
| TEST_F(DesktopNativeWidgetAuraTest, DesktopAuraWindowSizeTest) { |
| Widget widget; |
| + |
| + // On Linux we test this with popup windows because the WM may ignore the size |
| + // suggestion for normal windows. |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| + Widget::InitParams init_params = |
| + CreateParams(Widget::InitParams::TYPE_POPUP); |
| +#else |
| Widget::InitParams init_params = |
| CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| +#endif |
| + |
| + init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| + init_params.native_widget = new DesktopNativeWidgetAura(&widget); |
| + widget.Init(init_params); |
| + |
| + gfx::Rect bounds(0, 0, 100, 100); |
| + widget.SetBounds(bounds); |
| + widget.Show(); |
| + |
| + EXPECT_EQ(bounds.ToString(), |
| + widget.GetNativeView()->GetRootWindow()->bounds().ToString()); |
| + EXPECT_EQ(bounds.ToString(), widget.GetNativeView()->bounds().ToString()); |
| + EXPECT_EQ(bounds.ToString(), |
| + widget.GetNativeView()->parent()->bounds().ToString()); |
| + |
| + gfx::Rect new_bounds(0, 0, 200, 200); |
| + widget.SetBounds(new_bounds); |
| + EXPECT_EQ(new_bounds.ToString(), |
| + widget.GetNativeView()->GetRootWindow()->bounds().ToString()); |
| + EXPECT_EQ(new_bounds.ToString(), widget.GetNativeView()->bounds().ToString()); |
| + EXPECT_EQ(new_bounds.ToString(), |
| + widget.GetNativeView()->parent()->bounds().ToString()); |
| +} |
| + |
| +// Verifies that the AURA windows making up a widget instance have the correct |
|
Daniel Erat
2014/05/23 14:53:59
nit: s/AURA/Aura/
Evan Stade
2014/05/23 15:30:32
oh whoops, I meant to remove this test which is a
|
| +// bounds after the widget is resized. |
| +TEST_F(DesktopNativeWidgetAuraTest, DesktopAuraWindowSizeTestPopup) { |
| + Widget widget; |
| + Widget::InitParams init_params = |
| + CreateParams(Widget::InitParams::TYPE_POPUP); |
| init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| init_params.native_widget = new DesktopNativeWidgetAura(&widget); |
| widget.Init(init_params); |