| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/controls/native/native_view_host_aura.h" | 5 #include "ui/views/controls/native/native_view_host_aura.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 NativeViewHostWindowObserver test_observer; | 263 NativeViewHostWindowObserver test_observer; |
| 264 child_win->AddObserver(&test_observer); | 264 child_win->AddObserver(&test_observer); |
| 265 | 265 |
| 266 host()->Detach(); | 266 host()->Detach(); |
| 267 EXPECT_EQ(root_window, child_win->GetRootWindow()); | 267 EXPECT_EQ(root_window, child_win->GetRootWindow()); |
| 268 EXPECT_EQ(child_win_tree_host, child_win->GetHost()); | 268 EXPECT_EQ(child_win_tree_host, child_win->GetHost()); |
| 269 | 269 |
| 270 DestroyHost(); | 270 DestroyHost(); |
| 271 DestroyTopLevel(); | 271 DestroyTopLevel(); |
| 272 if (!IsMus()) { | 272 if (!IsMus() && !IsAuraMusClient()) { |
| 273 // The window is detached, so no longer associated with any Widget | 273 // The window is detached, so no longer associated with any Widget |
| 274 // hierarchy. The root window still owns it, but the test harness checks | 274 // hierarchy. The root window still owns it, but the test harness checks |
| 275 // for orphaned windows during TearDown(). | 275 // for orphaned windows during TearDown(). |
| 276 EXPECT_EQ(0u, test_observer.events().size()) | 276 EXPECT_EQ(0u, test_observer.events().size()) |
| 277 << (*test_observer.events().begin()).type; | 277 << (*test_observer.events().begin()).type; |
| 278 delete child_win; | 278 delete child_win; |
| 279 } else { | 279 } else { |
| 280 // In mus, the child window is still attached to the aura::WindowTreeHost | 280 // In mus and aura-mus, the child window is still attached to the |
| 281 // for the Widget. So destroying the toplevel Widget takes down the child | 281 // aura::WindowTreeHost for the Widget. So destroying the toplevel Widget |
| 282 // window with it. | 282 // takes down the child window with it. |
| 283 } | 283 } |
| 284 | 284 |
| 285 ASSERT_EQ(1u, test_observer.events().size()); | 285 ASSERT_EQ(1u, test_observer.events().size()); |
| 286 EXPECT_EQ(NativeViewHostWindowObserver::EVENT_DESTROYED, | 286 EXPECT_EQ(NativeViewHostWindowObserver::EVENT_DESTROYED, |
| 287 test_observer.events().back().type); | 287 test_observer.events().back().type); |
| 288 } | 288 } |
| 289 | 289 |
| 290 // Ensure the clipping window is hidden before setting the native view's bounds. | 290 // Ensure the clipping window is hidden before setting the native view's bounds. |
| 291 // This is a regression test for http://crbug.com/388699. | 291 // This is a regression test for http://crbug.com/388699. |
| 292 TEST_F(NativeViewHostAuraTest, RemoveClippingWindowOrder) { | 292 TEST_F(NativeViewHostAuraTest, RemoveClippingWindowOrder) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 host()->SetVisible(false); | 371 host()->SetVisible(false); |
| 372 EXPECT_FALSE(clipping_window()->IsVisible()); | 372 EXPECT_FALSE(clipping_window()->IsVisible()); |
| 373 EXPECT_FALSE(child()->IsVisible()); | 373 EXPECT_FALSE(child()->IsVisible()); |
| 374 | 374 |
| 375 DestroyHost(); | 375 DestroyHost(); |
| 376 DestroyTopLevel(); | 376 DestroyTopLevel(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 } // namespace views | 379 } // namespace views |
| OLD | NEW |