Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc

Issue 291093012: Fix some views unittests on desktop Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: docs Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698