| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/mus/desktop_window_tree_host_mus.h" | 5 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
| 6 | 6 |
| 7 #include "base/debug/stack_trace.h" | 7 #include "base/debug/stack_trace.h" |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 std::unique_ptr<Widget> widget2(CreateWidget()); | 177 std::unique_ptr<Widget> widget2(CreateWidget()); |
| 178 widget2->Show(); | 178 widget2->Show(); |
| 179 | 179 |
| 180 aura::test::ChangeCompletionWaiter waiter( | 180 aura::test::ChangeCompletionWaiter waiter( |
| 181 MusClient::Get()->window_tree_client(), | 181 MusClient::Get()->window_tree_client(), |
| 182 aura::ChangeType::REORDER, true); | 182 aura::ChangeType::REORDER, true); |
| 183 widget2->StackAtTop(); | 183 widget2->StackAtTop(); |
| 184 waiter.Wait(); | 184 waiter.Wait(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 TEST_F(DesktopWindowTreeHostMusTest, StackAbove) { |
| 188 std::unique_ptr<Widget> widget1(CreateWidget(nullptr)); |
| 189 widget1->Show(); |
| 190 |
| 191 std::unique_ptr<Widget> widget2(CreateWidget(nullptr)); |
| 192 widget2->Show(); |
| 193 |
| 194 aura::test::ChangeCompletionWaiter waiter( |
| 195 MusClient::Get()->window_tree_client(), |
| 196 aura::ChangeType::REORDER, true); |
| 197 widget1->StackAboveWidget(widget2.get()); |
| 198 waiter.Wait(); |
| 199 } |
| 200 |
| 187 TEST_F(DesktopWindowTreeHostMusTest, TransientParentWiredToHostWindow) { | 201 TEST_F(DesktopWindowTreeHostMusTest, TransientParentWiredToHostWindow) { |
| 188 std::unique_ptr<Widget> widget1(CreateWidget()); | 202 std::unique_ptr<Widget> widget1(CreateWidget()); |
| 189 widget1->Show(); | 203 widget1->Show(); |
| 190 | 204 |
| 191 std::unique_ptr<Widget> widget2( | 205 std::unique_ptr<Widget> widget2( |
| 192 CreateWidget(nullptr, widget1->GetNativeView())); | 206 CreateWidget(nullptr, widget1->GetNativeView())); |
| 193 widget2->Show(); | 207 widget2->Show(); |
| 194 | 208 |
| 195 aura::client::TransientWindowClient* transient_window_client = | 209 aura::client::TransientWindowClient* transient_window_client = |
| 196 aura::client::GetTransientWindowClient(); | 210 aura::client::GetTransientWindowClient(); |
| 197 // Even though the widget1->GetNativeView() was specified as the parent we | 211 // Even though the widget1->GetNativeView() was specified as the parent we |
| 198 // expect the transient parents to be marked at the host level. | 212 // expect the transient parents to be marked at the host level. |
| 199 EXPECT_EQ(widget1->GetNativeView()->GetHost()->window(), | 213 EXPECT_EQ(widget1->GetNativeView()->GetHost()->window(), |
| 200 transient_window_client->GetTransientParent( | 214 transient_window_client->GetTransientParent( |
| 201 widget2->GetNativeView()->GetHost()->window())); | 215 widget2->GetNativeView()->GetHost()->window())); |
| 202 } | 216 } |
| 203 | 217 |
| 204 } // namespace views | 218 } // namespace views |
| OLD | NEW |