OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/mus/server_view_drawn_tracker.h" | 5 #include "components/mus/server_view_drawn_tracker.h" |
6 | 6 |
7 #include "components/mus/server_view.h" | 7 #include "components/mus/server_view.h" |
8 #include "components/mus/server_view_drawn_tracker_observer.h" | 8 #include "components/mus/server_view_drawn_tracker_observer.h" |
9 #include "components/mus/test_server_view_delegate.h" | 9 #include "components/mus/test_server_view_delegate.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace mus { | 12 namespace view_manager { |
13 namespace { | 13 namespace { |
14 | 14 |
15 class TestServerViewDrawnTrackerObserver | 15 class TestServerViewDrawnTrackerObserver |
16 : public ServerViewDrawnTrackerObserver { | 16 : public ServerViewDrawnTrackerObserver { |
17 public: | 17 public: |
18 TestServerViewDrawnTrackerObserver() | 18 TestServerViewDrawnTrackerObserver() |
19 : change_count_(0u), | 19 : change_count_(0u), |
20 ancestor_(nullptr), | 20 ancestor_(nullptr), |
21 view_(nullptr), | 21 view_(nullptr), |
22 is_drawn_(false) {} | 22 is_drawn_(false) {} |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 EXPECT_FALSE(drawn_observer.is_drawn()); | 129 EXPECT_FALSE(drawn_observer.is_drawn()); |
130 drawn_observer.clear_change_count(); | 130 drawn_observer.clear_change_count(); |
131 | 131 |
132 root.Add(&child_child); | 132 root.Add(&child_child); |
133 EXPECT_EQ(1u, drawn_observer.change_count()); | 133 EXPECT_EQ(1u, drawn_observer.change_count()); |
134 EXPECT_EQ(&child_child, drawn_observer.view()); | 134 EXPECT_EQ(&child_child, drawn_observer.view()); |
135 EXPECT_EQ(nullptr, drawn_observer.ancestor()); | 135 EXPECT_EQ(nullptr, drawn_observer.ancestor()); |
136 EXPECT_TRUE(drawn_observer.is_drawn()); | 136 EXPECT_TRUE(drawn_observer.is_drawn()); |
137 } | 137 } |
138 | 138 |
139 } // namespace mus | 139 } // namespace view_manager |
OLD | NEW |