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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 void CreateHost() { | 99 void CreateHost() { |
100 CreateTopLevel(); | 100 CreateTopLevel(); |
101 CreateTestingHost(); | 101 CreateTestingHost(); |
102 child_.reset(CreateChildForHost(toplevel()->GetNativeView(), | 102 child_.reset(CreateChildForHost(toplevel()->GetNativeView(), |
103 toplevel()->GetRootView(), | 103 toplevel()->GetRootView(), |
104 new View, | 104 new View, |
105 host())); | 105 host())); |
106 } | 106 } |
107 | 107 |
| 108 // test::NativeViewHostTestBase: |
| 109 void TearDown() override { |
| 110 child_.reset(); |
| 111 test::NativeViewHostTestBase::TearDown(); |
| 112 } |
| 113 |
108 private: | 114 private: |
109 std::unique_ptr<Widget> child_; | 115 std::unique_ptr<Widget> child_; |
110 | 116 |
111 DISALLOW_COPY_AND_ASSIGN(NativeViewHostAuraTest); | 117 DISALLOW_COPY_AND_ASSIGN(NativeViewHostAuraTest); |
112 }; | 118 }; |
113 | 119 |
114 // Verifies NativeViewHostAura stops observing native view on destruction. | 120 // Verifies NativeViewHostAura stops observing native view on destruction. |
115 TEST_F(NativeViewHostAuraTest, StopObservingNativeViewOnDestruct) { | 121 TEST_F(NativeViewHostAuraTest, StopObservingNativeViewOnDestruct) { |
116 CreateHost(); | 122 CreateHost(); |
117 aura::Window* child_win = child()->GetNativeView(); | 123 aura::Window* child_win = child()->GetNativeView(); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 376 |
371 host()->SetVisible(false); | 377 host()->SetVisible(false); |
372 EXPECT_FALSE(clipping_window()->IsVisible()); | 378 EXPECT_FALSE(clipping_window()->IsVisible()); |
373 EXPECT_FALSE(child()->IsVisible()); | 379 EXPECT_FALSE(child()->IsVisible()); |
374 | 380 |
375 DestroyHost(); | 381 DestroyHost(); |
376 DestroyTopLevel(); | 382 DestroyTopLevel(); |
377 } | 383 } |
378 | 384 |
379 } // namespace views | 385 } // namespace views |
OLD | NEW |