Index: ui/aura_shell/default_container_layout_manager_unittest.cc |
diff --git a/ui/aura_shell/default_container_layout_manager_unittest.cc b/ui/aura_shell/default_container_layout_manager_unittest.cc |
index deefc5a0784178ae033e4463244e5cabb6deeb9f..d3dcd056511b9d6acee3939bafc49be7775fbea9 100644 |
--- a/ui/aura_shell/default_container_layout_manager_unittest.cc |
+++ b/ui/aura_shell/default_container_layout_manager_unittest.cc |
@@ -67,11 +67,12 @@ class DefaultContainerLayoutManagerTest : public aura::test::AuraTestBase { |
return workspace_controller_->layout_manager(); |
} |
- private: |
+ protected: |
scoped_ptr<aura::Window> container_; |
ScopedVector<ui::ViewProp> props_; |
scoped_ptr<aura_shell::internal::WorkspaceController> workspace_controller_; |
+ private: |
DISALLOW_COPY_AND_ASSIGN(DefaultContainerLayoutManagerTest); |
}; |
@@ -136,5 +137,23 @@ TEST_F(DefaultContainerLayoutManagerTest, Popup) { |
EXPECT_EQ("0,0 1000x1000", popup->bounds().ToString()); |
} |
+// Make sure a window with a transient parent isn't resized by the layout |
+// manager. |
+TEST_F(DefaultContainerLayoutManagerTest, IgnoreTransient) { |
+ scoped_ptr<aura::Window> window(new aura::Window(NULL)); |
+ props_.push_back( |
+ new ui::ViewProp( |
+ window.get(), views::NativeWidgetAura::kWindowTypeKey, |
+ reinterpret_cast<void*>(Widget::InitParams::TYPE_WINDOW))); |
Ben Goodger (Google)
2011/10/31 18:24:27
It seems like we should have a utility function do
oshima
2011/10/31 19:48:47
I'm adding Widow::SetIntProperty, which should be
|
+ window->SetType(Widget::InitParams::TYPE_WINDOW); |
+ window->Init(ui::Layer::LAYER_HAS_NO_TEXTURE); |
+ aura::Desktop::GetInstance()->AddTransientChild(window.get()); |
+ window->SetBounds(gfx::Rect(0, 0, 200, 200)); |
+ window->Show(); |
+ window->SetParent(container()); |
+ |
+ EXPECT_EQ("0,0 200x200", window->bounds().ToString()); |
+} |
+ |
} // namespace test |
} // namespace aura_shell |