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

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: 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
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..a277962c073cd4fced10a5cb2a129972ac858c6d 100644
--- a/athena/util/fill_layout_manager_unittest.cc
+++ b/athena/util/fill_layout_manager_unittest.cc
@@ -18,47 +18,63 @@ 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->SetProperty(kAlwaysFillWindowKey, true);
+ frameless->SetBounds(gfx::Rect(0, 0, 5, 10));
+
+ EXPECT_EQ("0,0 5x10", frameless->bounds().ToString());
+ parent->AddChild(frameless.get());
+ 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

Powered by Google App Engine
This is Rietveld 408576698