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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 using WindowTreeShutdownTest = testing::Test; | 1357 using WindowTreeShutdownTest = testing::Test; |
1358 | 1358 |
1359 // Makes sure WindowTreeClient doesn't get any messages during shutdown. | 1359 // Makes sure WindowTreeClient doesn't get any messages during shutdown. |
1360 TEST_F(WindowTreeShutdownTest, DontSendMessagesDuringShutdown) { | 1360 TEST_F(WindowTreeShutdownTest, DontSendMessagesDuringShutdown) { |
1361 std::unique_ptr<TestWindowTreeClient> client; | 1361 std::unique_ptr<TestWindowTreeClient> client; |
1362 { | 1362 { |
1363 // Create a tree with one window. | 1363 // Create a tree with one window. |
1364 WindowServerTestHelper ws_test_helper; | 1364 WindowServerTestHelper ws_test_helper; |
1365 WindowServer* window_server = ws_test_helper.window_server(); | 1365 WindowServer* window_server = ws_test_helper.window_server(); |
1366 TestScreenManager screen_manager; | 1366 TestScreenManager screen_manager; |
1367 screen_manager.Init(window_server->display_manager()); | 1367 screen_manager.Init(window_server->display_manager(), |
| 1368 display::ScreenManager::WINDOW_MODE_INTERNAL); |
1368 window_server->user_id_tracker()->AddUserId(kTestUserId1); | 1369 window_server->user_id_tracker()->AddUserId(kTestUserId1); |
1369 screen_manager.AddDisplay(); | 1370 screen_manager.AddDisplay(); |
1370 | 1371 |
1371 AddWindowManager(window_server, kTestUserId1); | 1372 AddWindowManager(window_server, kTestUserId1); |
1372 window_server->user_id_tracker()->SetActiveUserId(kTestUserId1); | 1373 window_server->user_id_tracker()->SetActiveUserId(kTestUserId1); |
1373 TestWindowTreeBinding* test_binding = | 1374 TestWindowTreeBinding* test_binding = |
1374 ws_test_helper.window_server_delegate()->last_binding(); | 1375 ws_test_helper.window_server_delegate()->last_binding(); |
1375 ASSERT_TRUE(test_binding); | 1376 ASSERT_TRUE(test_binding); |
1376 WindowTree* tree = test_binding->tree(); | 1377 WindowTree* tree = test_binding->tree(); |
1377 const ClientWindowId window_id = BuildClientWindowId(tree, 2); | 1378 const ClientWindowId window_id = BuildClientWindowId(tree, 2); |
1378 ASSERT_TRUE(tree->NewWindow(window_id, ServerWindow::Properties())); | 1379 ASSERT_TRUE(tree->NewWindow(window_id, ServerWindow::Properties())); |
1379 | 1380 |
1380 // Release the client so that it survices shutdown. | 1381 // Release the client so that it survices shutdown. |
1381 client = test_binding->ReleaseClient(); | 1382 client = test_binding->ReleaseClient(); |
1382 client->tracker()->changes()->clear(); | 1383 client->tracker()->changes()->clear(); |
1383 } | 1384 } |
1384 | 1385 |
1385 // Client should not have got any messages after shutdown. | 1386 // Client should not have got any messages after shutdown. |
1386 EXPECT_TRUE(client->tracker()->changes()->empty()); | 1387 EXPECT_TRUE(client->tracker()->changes()->empty()); |
1387 } | 1388 } |
1388 | 1389 |
1389 } // namespace test | 1390 } // namespace test |
1390 } // namespace ws | 1391 } // namespace ws |
1391 } // namespace ui | 1392 } // namespace ui |
OLD | NEW |