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

Unified Diff: athena/util/fill_layout_manager_unittest.cc

Issue 697143005: Fills athena background always. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: visibility changed Created 6 years, 1 month 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 | « athena/util/fill_layout_manager.cc ('k') | athena/virtual_keyboard/virtual_keyboard_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/util/fill_layout_manager_unittest.cc
diff --git a/athena/util/fill_layout_manager_unittest.cc b/athena/util/fill_layout_manager_unittest.cc
index d478e3dc47aee0f68e916d542956b486dd10458a..9f312200154d257571b8cca0379a73359debc402 100644
--- a/athena/util/fill_layout_manager_unittest.cc
+++ b/athena/util/fill_layout_manager_unittest.cc
@@ -18,47 +18,68 @@ TEST(FillLayoutManagerTest, ChildWindowSizedCorrectly) {
scoped_ptr<aura::Window> child(new aura::Window(nullptr));
child->SetBounds(gfx::Rect(0, 0, 5, 10));
- EXPECT_NE(child->bounds().size().ToString(),
- parent->bounds().size().ToString());
+ EXPECT_NE(parent->bounds().size().ToString(),
+ child->bounds().size().ToString());
parent->AddChild(child.get());
- EXPECT_EQ(child->bounds().size().ToString(),
- parent->bounds().size().ToString());
+ EXPECT_EQ(parent->bounds().size().ToString(),
+ child->bounds().size().ToString());
parent->SetBounds(gfx::Rect(0, 0, 100, 200));
- EXPECT_EQ(child->bounds().size().ToString(),
- parent->bounds().size().ToString());
+ EXPECT_EQ(parent->bounds().size().ToString(),
+ child->bounds().size().ToString());
// Menu, tooltip, and popup should not be filled.
scoped_ptr<aura::Window> menu(new aura::Window(nullptr));
menu->SetType(ui::wm::WINDOW_TYPE_MENU);
menu->SetBounds(gfx::Rect(0, 0, 5, 10));
- EXPECT_EQ(menu->bounds().ToString(), "0,0 5x10");
+ EXPECT_EQ("0,0 5x10", menu->bounds().ToString());
parent->AddChild(menu.get());
- EXPECT_EQ(menu->bounds().ToString(), "0,0 5x10");
+ EXPECT_EQ("0,0 5x10", menu->bounds().ToString());
menu->SetBounds(gfx::Rect(0, 0, 100, 200));
- EXPECT_EQ(menu->bounds().ToString(), "0,0 100x200");
+ EXPECT_EQ("0,0 100x200", menu->bounds().ToString());
scoped_ptr<aura::Window> tooltip(new aura::Window(nullptr));
tooltip->SetType(ui::wm::WINDOW_TYPE_TOOLTIP);
tooltip->SetBounds(gfx::Rect(0, 0, 5, 10));
- EXPECT_EQ(tooltip->bounds().ToString(), "0,0 5x10");
+ EXPECT_EQ("0,0 5x10", tooltip->bounds().ToString());
parent->AddChild(tooltip.get());
- EXPECT_EQ(tooltip->bounds().ToString(), "0,0 5x10");
+ EXPECT_EQ("0,0 5x10", tooltip->bounds().ToString());
tooltip->SetBounds(gfx::Rect(0, 0, 100, 200));
- EXPECT_EQ(tooltip->bounds().ToString(), "0,0 100x200");
+ EXPECT_EQ("0,0 100x200", tooltip->bounds().ToString());
scoped_ptr<aura::Window> popup(new aura::Window(nullptr));
popup->SetType(ui::wm::WINDOW_TYPE_POPUP);
popup->SetBounds(gfx::Rect(0, 0, 5, 10));
- EXPECT_EQ(popup->bounds().ToString(), "0,0 5x10");
+ EXPECT_EQ("0,0 5x10", popup->bounds().ToString());
parent->AddChild(popup.get());
- EXPECT_EQ(popup->bounds().ToString(), "0,0 5x10");
+ EXPECT_EQ("0,0 5x10", popup->bounds().ToString());
popup->SetBounds(gfx::Rect(0, 0, 100, 200));
- EXPECT_EQ(popup->bounds().ToString(), "0,0 100x200");
+ EXPECT_EQ("0,0 100x200", popup->bounds().ToString());
+
+ // Frameless window is TYPE_POPUP, but some frameless window may want to be
+ // filled with the specific key.
+ scoped_ptr<aura::Window> frameless(new aura::Window(nullptr));
+ frameless->SetType(ui::wm::WINDOW_TYPE_POPUP);
+ frameless->SetBounds(gfx::Rect(0, 0, 5, 10));
+
+ EXPECT_EQ("0,0 5x10", frameless->bounds().ToString());
+
+ // Adding frameless to |parent|, then set the flag. This order respects
+ // the actual order of creating a views::Widget.
+ parent->AddChild(frameless.get());
+ FillLayoutManager::SetAlwaysFill(frameless.get());
+ frameless->Show();
+
+ EXPECT_EQ(parent->bounds().size().ToString(),
+ frameless->bounds().size().ToString());
+
+ frameless->SetBounds(gfx::Rect(0, 0, 10, 20));
+ EXPECT_EQ(parent->bounds().size().ToString(),
+ frameless->bounds().size().ToString());
}
} // namespace athena
« no previous file with comments | « athena/util/fill_layout_manager.cc ('k') | athena/virtual_keyboard/virtual_keyboard_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698