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

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

Issue 2503923003: Demonstrate external-window-mode in mus-demo (Closed)
Patch Set: Determine external window mode in mus-ws based on if a WM is connected 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
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>
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 using WindowTreeShutdownTest = testing::Test; 1350 using WindowTreeShutdownTest = testing::Test;
1351 1351
1352 // Makes sure WindowTreeClient doesn't get any messages during shutdown. 1352 // Makes sure WindowTreeClient doesn't get any messages during shutdown.
1353 TEST_F(WindowTreeShutdownTest, DontSendMessagesDuringShutdown) { 1353 TEST_F(WindowTreeShutdownTest, DontSendMessagesDuringShutdown) {
1354 std::unique_ptr<TestWindowTreeClient> client; 1354 std::unique_ptr<TestWindowTreeClient> client;
1355 { 1355 {
1356 // Create a tree with one window. 1356 // Create a tree with one window.
1357 WindowServerTestHelper ws_test_helper; 1357 WindowServerTestHelper ws_test_helper;
1358 WindowServer* window_server = ws_test_helper.window_server(); 1358 WindowServer* window_server = ws_test_helper.window_server();
1359 TestPlatformScreen platform_screen; 1359 TestPlatformScreen platform_screen;
1360 platform_screen.Init(window_server->display_manager()); 1360 platform_screen.Init(window_server->display_manager(), false);
tonikitoo 2016/11/22 03:07:39 for good code reading purposes, a named variable f
Tom (Use chromium acct) 2016/11/22 19:19:48 I've added the enum and also a default argument so
1361 window_server->user_id_tracker()->AddUserId(kTestUserId1); 1361 window_server->user_id_tracker()->AddUserId(kTestUserId1);
1362 platform_screen.AddDisplay(); 1362 platform_screen.AddDisplay();
1363 1363
1364 AddWindowManager(window_server, kTestUserId1); 1364 AddWindowManager(window_server, kTestUserId1);
1365 window_server->user_id_tracker()->SetActiveUserId(kTestUserId1); 1365 window_server->user_id_tracker()->SetActiveUserId(kTestUserId1);
1366 TestWindowTreeBinding* test_binding = 1366 TestWindowTreeBinding* test_binding =
1367 ws_test_helper.window_server_delegate()->last_binding(); 1367 ws_test_helper.window_server_delegate()->last_binding();
1368 ASSERT_TRUE(test_binding); 1368 ASSERT_TRUE(test_binding);
1369 WindowTree* tree = test_binding->tree(); 1369 WindowTree* tree = test_binding->tree();
1370 const ClientWindowId window_id = BuildClientWindowId(tree, 2); 1370 const ClientWindowId window_id = BuildClientWindowId(tree, 2);
1371 ASSERT_TRUE(tree->NewWindow(window_id, ServerWindow::Properties())); 1371 ASSERT_TRUE(tree->NewWindow(window_id, ServerWindow::Properties()));
1372 1372
1373 // Release the client so that it survices shutdown. 1373 // Release the client so that it survices shutdown.
1374 client = test_binding->ReleaseClient(); 1374 client = test_binding->ReleaseClient();
1375 client->tracker()->changes()->clear(); 1375 client->tracker()->changes()->clear();
1376 } 1376 }
1377 1377
1378 // Client should not have got any messages after shutdown. 1378 // Client should not have got any messages after shutdown.
1379 EXPECT_TRUE(client->tracker()->changes()->empty()); 1379 EXPECT_TRUE(client->tracker()->changes()->empty());
1380 } 1380 }
1381 1381
1382 } // namespace test 1382 } // namespace test
1383 } // namespace ws 1383 } // namespace ws
1384 } // namespace ui 1384 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698