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

Side by Side Diff: ui/views/controls/native/native_view_host_aura_unittest.cc

Issue 2696573003: Have WindowTreeClient detect error state earlier (Closed)
Patch Set: Fix test exposed by new check Created 3 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « ui/aura/mus/window_tree_client_observer.h ('k') | ui/views/mus/pointer_watcher_event_router.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/aura/mus/window_tree_client_observer.h ('k') | ui/views/mus/pointer_watcher_event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698