| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 | 1350 |
| 1351 // Makes sure WindowTreeClient doesn't get any messages during shutdown. | 1351 // Makes sure WindowTreeClient doesn't get any messages during shutdown. |
| 1352 TEST_F(WindowTreeShutdownTest, DontSendMessagesDuringShutdown) { | 1352 TEST_F(WindowTreeShutdownTest, DontSendMessagesDuringShutdown) { |
| 1353 std::unique_ptr<TestWindowTreeClient> client; | 1353 std::unique_ptr<TestWindowTreeClient> client; |
| 1354 { | 1354 { |
| 1355 // Create a tree with one window. | 1355 // Create a tree with one window. |
| 1356 WindowServerTestHelper ws_test_helper; | 1356 WindowServerTestHelper ws_test_helper; |
| 1357 WindowServer* window_server = ws_test_helper.window_server(); | 1357 WindowServer* window_server = ws_test_helper.window_server(); |
| 1358 window_server->user_id_tracker()->AddUserId(kTestUserId1); | 1358 window_server->user_id_tracker()->AddUserId(kTestUserId1); |
| 1359 const int kNumHostsToCreate = 1; | 1359 const int kNumHostsToCreate = 1; |
| 1360 ws_test_helper.window_server_delegate()->set_num_displays_to_create( | 1360 ws_test_helper.window_server_delegate()->CreateDisplays(kNumHostsToCreate); |
| 1361 kNumHostsToCreate); | |
| 1362 | 1361 |
| 1363 WindowManagerWindowTreeFactorySetTestApi( | 1362 WindowManagerWindowTreeFactorySetTestApi( |
| 1364 window_server->window_manager_window_tree_factory_set()) | 1363 window_server->window_manager_window_tree_factory_set()) |
| 1365 .Add(kTestUserId1); | 1364 .Add(kTestUserId1); |
| 1366 window_server->user_id_tracker()->SetActiveUserId(kTestUserId1); | 1365 window_server->user_id_tracker()->SetActiveUserId(kTestUserId1); |
| 1367 TestWindowTreeBinding* test_binding = | 1366 TestWindowTreeBinding* test_binding = |
| 1368 ws_test_helper.window_server_delegate()->last_binding(); | 1367 ws_test_helper.window_server_delegate()->last_binding(); |
| 1369 ASSERT_TRUE(test_binding); | 1368 ASSERT_TRUE(test_binding); |
| 1370 WindowTree* tree = test_binding->tree(); | 1369 WindowTree* tree = test_binding->tree(); |
| 1371 const ClientWindowId window_id = BuildClientWindowId(tree, 2); | 1370 const ClientWindowId window_id = BuildClientWindowId(tree, 2); |
| 1372 ASSERT_TRUE(tree->NewWindow(window_id, ServerWindow::Properties())); | 1371 ASSERT_TRUE(tree->NewWindow(window_id, ServerWindow::Properties())); |
| 1373 | 1372 |
| 1374 // Release the client so that it survices shutdown. | 1373 // Release the client so that it survices shutdown. |
| 1375 client = test_binding->ReleaseClient(); | 1374 client = test_binding->ReleaseClient(); |
| 1376 client->tracker()->changes()->clear(); | 1375 client->tracker()->changes()->clear(); |
| 1377 } | 1376 } |
| 1378 | 1377 |
| 1379 // Client should not have got any messages after shutdown. | 1378 // Client should not have got any messages after shutdown. |
| 1380 EXPECT_TRUE(client->tracker()->changes()->empty()); | 1379 EXPECT_TRUE(client->tracker()->changes()->empty()); |
| 1381 } | 1380 } |
| 1382 | 1381 |
| 1383 } // namespace test | 1382 } // namespace test |
| 1384 } // namespace ws | 1383 } // namespace ws |
| 1385 } // namespace ui | 1384 } // namespace ui |
| OLD | NEW |