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

Unified Diff: ui/aura_shell/default_container_layout_manager_unittest.cc

Issue 8414035: Makes DefaultContainerLayoutManager ignore windows with transient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test 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 | « ui/aura_shell/default_container_layout_manager.cc ('k') | views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/aura_shell/default_container_layout_manager.cc ('k') | views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698