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

Unified Diff: trunk/src/ui/views/widget/widget_unittest.cc

Issue 127163002: Relanding this change with the DesktopAuraTopLevelOwnedPopupResizeTest enabled only for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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 | « trunk/src/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/views/widget/widget_unittest.cc
===================================================================
--- trunk/src/ui/views/widget/widget_unittest.cc (revision 243438)
+++ trunk/src/ui/views/widget/widget_unittest.cc (working copy)
@@ -1164,6 +1164,14 @@
}
}
+ aura::Window* owned_window() {
+ return owned_window_;
+ }
+
+ views::Widget* top_level_widget() {
+ return top_level_widget_;
+ }
+
private:
views::Widget widget_;
views::Widget* top_level_widget_;
@@ -1209,6 +1217,29 @@
RunPendingMessages();
}
+#if defined(OS_WIN)
+// TODO(ananta)
+// Fix this test to work on Linux Aura. Need to implement the
+// views::DesktopRootWindowHostX11::SetSize function
+// This test validates that when a top level owned popup Aura window is
+// resized, the widget is resized as well.
+TEST_F(WidgetTest, DesktopAuraTopLevelOwnedPopupResizeTest) {
+ ViewsDelegate::views_delegate = NULL;
+ DesktopAuraTopLevelWindowTest popup_window;
+ ASSERT_NO_FATAL_FAILURE(popup_window.CreateTopLevelWindow(
+ gfx::Rect(0, 0, 200, 200), false));
+
+ gfx::Rect new_size(0, 0, 400, 400);
+ popup_window.owned_window()->SetBounds(new_size);
+
+ EXPECT_EQ(popup_window.top_level_widget()->GetNativeView()->bounds().size(),
+ new_size.size());
+ RunPendingMessages();
+ ASSERT_NO_FATAL_FAILURE(popup_window.DestroyOwnedWindow());
+ RunPendingMessages();
+}
+#endif
+
// Test to ensure that the aura Window's visiblity state is set to visible if
// the underlying widget is hidden and then shown.
TEST_F(WidgetTest, TestWindowVisibilityAfterHide) {
« no previous file with comments | « trunk/src/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698