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

Unified Diff: views/widget/widget_unittest.cc

Issue 8052019: Create constrained windows in a hidden state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and address comments Created 9 years, 2 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 | « views/widget/native_widget_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_unittest.cc
diff --git a/views/widget/widget_unittest.cc b/views/widget/widget_unittest.cc
index ab16a55f28520cee528c157a43e703f24f8d2ed6..468aa067529a7c0fc29af9eaa4a85bfb8c792e22 100644
--- a/views/widget/widget_unittest.cc
+++ b/views/widget/widget_unittest.cc
@@ -133,6 +133,17 @@ Widget* CreateChildPlatformWidget(gfx::NativeView parent_native_view) {
return child;
}
+Widget* CreateChildPopupPlatformWidget(gfx::NativeView parent_native_view) {
+ Widget* child = new Widget;
+ Widget::InitParams child_params(Widget::InitParams::TYPE_POPUP);
+ child_params.child = true;
+ child_params.native_widget = CreatePlatformNativeWidget(child);
+ child_params.parent = parent_native_view;
+ child->Init(child_params);
+ child->SetContentsView(new View);
+ return child;
+}
+
Widget* CreateTopLevelNativeWidgetViews() {
Widget* toplevel = new Widget;
Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
@@ -318,9 +329,11 @@ TEST_F(WidgetTest, Visibility) {
gfx::NativeView parent = toplevel->GetNativeView();
#endif
Widget* child = CreateChildPlatformWidget(parent);
+ Widget* child_popup = CreateChildPopupPlatformWidget(parent);
EXPECT_FALSE(toplevel->IsVisible());
EXPECT_FALSE(child->IsVisible());
+ EXPECT_FALSE(child_popup->IsVisible());
child->Show();
@@ -331,6 +344,11 @@ TEST_F(WidgetTest, Visibility) {
EXPECT_TRUE(toplevel->IsVisible());
EXPECT_TRUE(child->IsVisible());
+ EXPECT_FALSE(child_popup->IsVisible());
+
+ child_popup->Show();
+
+ EXPECT_TRUE(child_popup->IsVisible());
toplevel->CloseNow();
// |child| should be automatically destroyed with |toplevel|.
« no previous file with comments | « views/widget/native_widget_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698