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

Side by Side Diff: services/ui/ws/window_tree_unittest.cc

Issue 2512593003: Cleanup display creation in mus tests. (Closed)
Patch Set: Make const. Created 4 years, 1 month 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 | « services/ui/ws/window_manager_state_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "services/service_manager/public/interfaces/connector.mojom.h" 15 #include "services/service_manager/public/interfaces/connector.mojom.h"
16 #include "services/ui/common/types.h" 16 #include "services/ui/common/types.h"
17 #include "services/ui/common/util.h" 17 #include "services/ui/common/util.h"
18 #include "services/ui/public/interfaces/window_tree.mojom.h" 18 #include "services/ui/public/interfaces/window_tree.mojom.h"
19 #include "services/ui/surfaces/display_compositor.h" 19 #include "services/ui/surfaces/display_compositor.h"
20 #include "services/ui/ws/default_access_policy.h" 20 #include "services/ui/ws/default_access_policy.h"
21 #include "services/ui/ws/display_manager.h"
21 #include "services/ui/ws/ids.h" 22 #include "services/ui/ws/ids.h"
22 #include "services/ui/ws/platform_display.h" 23 #include "services/ui/ws/platform_display.h"
23 #include "services/ui/ws/platform_display_factory.h" 24 #include "services/ui/ws/platform_display_factory.h"
24 #include "services/ui/ws/platform_display_init_params.h" 25 #include "services/ui/ws/platform_display_init_params.h"
25 #include "services/ui/ws/server_window.h" 26 #include "services/ui/ws/server_window.h"
26 #include "services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h" 27 #include "services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h"
27 #include "services/ui/ws/test_change_tracker.h" 28 #include "services/ui/ws/test_change_tracker.h"
28 #include "services/ui/ws/test_server_window_delegate.h" 29 #include "services/ui/ws/test_server_window_delegate.h"
29 #include "services/ui/ws/test_utils.h" 30 #include "services/ui/ws/test_utils.h"
30 #include "services/ui/ws/window_manager_access_policy.h" 31 #include "services/ui/ws/window_manager_access_policy.h"
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 1349
1349 using WindowTreeShutdownTest = testing::Test; 1350 using WindowTreeShutdownTest = testing::Test;
1350 1351
1351 // Makes sure WindowTreeClient doesn't get any messages during shutdown. 1352 // Makes sure WindowTreeClient doesn't get any messages during shutdown.
1352 TEST_F(WindowTreeShutdownTest, DontSendMessagesDuringShutdown) { 1353 TEST_F(WindowTreeShutdownTest, DontSendMessagesDuringShutdown) {
1353 std::unique_ptr<TestWindowTreeClient> client; 1354 std::unique_ptr<TestWindowTreeClient> client;
1354 { 1355 {
1355 // Create a tree with one window. 1356 // Create a tree with one window.
1356 WindowServerTestHelper ws_test_helper; 1357 WindowServerTestHelper ws_test_helper;
1357 WindowServer* window_server = ws_test_helper.window_server(); 1358 WindowServer* window_server = ws_test_helper.window_server();
1359 TestPlatformScreen platform_screen;
1360 platform_screen.Init(window_server->display_manager());
1358 window_server->user_id_tracker()->AddUserId(kTestUserId1); 1361 window_server->user_id_tracker()->AddUserId(kTestUserId1);
1359 const int kNumHostsToCreate = 1; 1362 platform_screen.AddDisplay();
1360 ws_test_helper.window_server_delegate()->CreateDisplays(kNumHostsToCreate);
1361 1363
1362 AddWindowManager(window_server, kTestUserId1); 1364 AddWindowManager(window_server, kTestUserId1);
1363 window_server->user_id_tracker()->SetActiveUserId(kTestUserId1); 1365 window_server->user_id_tracker()->SetActiveUserId(kTestUserId1);
1364 TestWindowTreeBinding* test_binding = 1366 TestWindowTreeBinding* test_binding =
1365 ws_test_helper.window_server_delegate()->last_binding(); 1367 ws_test_helper.window_server_delegate()->last_binding();
1366 ASSERT_TRUE(test_binding); 1368 ASSERT_TRUE(test_binding);
1367 WindowTree* tree = test_binding->tree(); 1369 WindowTree* tree = test_binding->tree();
1368 const ClientWindowId window_id = BuildClientWindowId(tree, 2); 1370 const ClientWindowId window_id = BuildClientWindowId(tree, 2);
1369 ASSERT_TRUE(tree->NewWindow(window_id, ServerWindow::Properties())); 1371 ASSERT_TRUE(tree->NewWindow(window_id, ServerWindow::Properties()));
1370 1372
1371 // Release the client so that it survices shutdown. 1373 // Release the client so that it survices shutdown.
1372 client = test_binding->ReleaseClient(); 1374 client = test_binding->ReleaseClient();
1373 client->tracker()->changes()->clear(); 1375 client->tracker()->changes()->clear();
1374 } 1376 }
1375 1377
1376 // Client should not have got any messages after shutdown. 1378 // Client should not have got any messages after shutdown.
1377 EXPECT_TRUE(client->tracker()->changes()->empty()); 1379 EXPECT_TRUE(client->tracker()->changes()->empty());
1378 } 1380 }
1379 1381
1380 } // namespace test 1382 } // namespace test
1381 } // namespace ws 1383 } // namespace ws
1382 } // namespace ui 1384 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_manager_state_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698