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

Unified Diff: ui/aura/window_unittest.cc

Issue 58343004: Allow stacking below windows with layers with NULL delegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index dfe8a9c75edcc64a691ba9eebef3336fb0a53a57..16749444cb8b6234e630be88a70e8d834feecc95 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -2171,6 +2171,26 @@ TEST_F(WindowTest, AcquireThenRecreateLayer) {
w.reset();
}
+TEST_F(WindowTest, StackWindowAtBottomBelowWindowWhoseLayerHasNoDelegate) {
+ scoped_ptr<Window> window1(CreateTestWindowWithId(1, root_window()));
+ window1->layer()->set_name("1");
+ scoped_ptr<Window> window2(CreateTestWindowWithId(2, root_window()));
+ window2->layer()->set_name("2");
+ scoped_ptr<Window> window3(CreateTestWindowWithId(3, root_window()));
+ window3->layer()->set_name("3");
+
+ EXPECT_EQ("1 2 3", ChildWindowIDsAsString(root_window()));
+ EXPECT_EQ("1 2 3",
+ ui::test::ChildLayerNamesAsString(*root_window()->layer()));
+ window1->layer()->set_delegate(NULL);
+ root_window()->StackChildAtBottom(window3.get());
+
+ // Window 3 should have moved to the bottom.
+ EXPECT_EQ("3 1 2", ChildWindowIDsAsString(root_window()));
+ EXPECT_EQ("3 1 2",
+ ui::test::ChildLayerNamesAsString(*root_window()->layer()));
+}
+
TEST_F(WindowTest, StackWindowsWhoseLayersHaveNoDelegate) {
scoped_ptr<Window> window1(CreateTestWindowWithId(1, root_window()));
window1->layer()->set_name("1");
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698