diff options
Diffstat (limited to 'ui/wm')
-rw-r--r-- | ui/wm/core/transient_window_stacking_client.cc | 6 | ||||
-rw-r--r-- | ui/wm/core/transient_window_stacking_client_unittest.cc | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/ui/wm/core/transient_window_stacking_client.cc b/ui/wm/core/transient_window_stacking_client.cc index 740fe99..9be72b6 100644 --- a/ui/wm/core/transient_window_stacking_client.cc +++ b/ui/wm/core/transient_window_stacking_client.cc @@ -94,12 +94,6 @@ bool TransientWindowStackingClient::AdjustStacking( *target = siblings[target_i]; } - // If we couldn't find a valid target position, don't move anything. - if (*direction == Window::STACK_ABOVE && - ((*target)->layer() && (*target)->layer()->delegate() == NULL)) { - return false; - } - return *child != *target; } diff --git a/ui/wm/core/transient_window_stacking_client_unittest.cc b/ui/wm/core/transient_window_stacking_client_unittest.cc index 7b8c127..5e37cf4 100644 --- a/ui/wm/core/transient_window_stacking_client_unittest.cc +++ b/ui/wm/core/transient_window_stacking_client_unittest.cc @@ -174,4 +174,19 @@ TEST_F(TransientWindowStackingClientTest, TransientChildrenGroupBelow) { EXPECT_EQ("2 22 21 213 211 212 1 11", ChildWindowIDsAsString(parent.get())); } +// Tests that windows can be stacked above windows with a NULL layer delegate. +// Windows have a NULL layer delegate when they are in the process of closing. +// See crbug.com/443433 +TEST_F(TransientWindowStackingClientTest, + StackAboveWindowWithNULLLayerDelegate) { + scoped_ptr<Window> parent(CreateTestWindowWithId(0, root_window())); + scoped_ptr<Window> w1(CreateTestWindowWithId(1, parent.get())); + scoped_ptr<Window> w2(CreateTestWindowWithId(2, parent.get())); + w2->layer()->set_delegate(NULL); + EXPECT_EQ(w2.get(), parent->children().back()); + + parent->StackChildAbove(w1.get(), w2.get()); + EXPECT_EQ(w1.get(), parent->children().back()); +} + } // namespace wm |