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 "ui/aura/mus/window_tree_client.h" | 5 #include "ui/aura/mus/window_tree_client.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 ASSERT_FALSE(window_tree()->has_change()); | 1220 ASSERT_FALSE(window_tree()->has_change()); |
1221 ASSERT_EQ(1u, root_window()->children().size()); | 1221 ASSERT_EQ(1u, root_window()->children().size()); |
1222 Window* server_window = root_window()->children()[0]; | 1222 Window* server_window = root_window()->children()[0]; |
1223 EXPECT_EQ(window1->parent(), server_window); | 1223 EXPECT_EQ(window1->parent(), server_window); |
1224 EXPECT_EQ(window2->parent(), server_window); | 1224 EXPECT_EQ(window2->parent(), server_window); |
1225 ASSERT_EQ(2u, server_window->children().size()); | 1225 ASSERT_EQ(2u, server_window->children().size()); |
1226 EXPECT_EQ(window1, server_window->children()[0]); | 1226 EXPECT_EQ(window1, server_window->children()[0]); |
1227 EXPECT_EQ(window2, server_window->children()[1]); | 1227 EXPECT_EQ(window2, server_window->children()[1]); |
1228 } | 1228 } |
1229 | 1229 |
| 1230 // Ensures when WindowTreeClient::OnWindowDeleted() is called nothing is |
| 1231 // scheduled on the server side. |
| 1232 TEST_F(WindowTreeClientClientTest, OnWindowDeletedDoesntNotifyServer) { |
| 1233 Window window1(nullptr); |
| 1234 window1.Init(ui::LAYER_NOT_DRAWN); |
| 1235 Window* window2 = new Window(nullptr); |
| 1236 window2->Init(ui::LAYER_NOT_DRAWN); |
| 1237 window1.AddChild(window2); |
| 1238 window_tree()->AckAllChanges(); |
| 1239 window_tree_client()->OnWindowDeleted(server_id(window2)); |
| 1240 EXPECT_FALSE(window_tree()->has_change()); |
| 1241 } |
| 1242 |
1230 } // namespace aura | 1243 } // namespace aura |
OLD | NEW |