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

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

Issue 2484223006: Remove CreateDefaultDisplay(). (Closed)
Patch Set: Remove debug LOG. 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_manager_state.h" 5 #include "services/ui/ws/window_manager_state.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 EXPECT_EQ("InputEvent window=1,1 event_action=7", 540 EXPECT_EQ("InputEvent window=1,1 event_action=7",
541 ChangesToDescription1(*tracker->changes())[0]); 541 ChangesToDescription1(*tracker->changes())[0]);
542 WindowTreeTestApi(window_tree()).AckLastEvent(mojom::EventResult::UNHANDLED); 542 WindowTreeTestApi(window_tree()).AckLastEvent(mojom::EventResult::UNHANDLED);
543 EXPECT_FALSE(window_manager()->on_accelerator_called()); 543 EXPECT_FALSE(window_manager()->on_accelerator_called());
544 } 544 }
545 545
546 // Verifies there is no crash if the WindowTree of a window manager is destroyed 546 // Verifies there is no crash if the WindowTree of a window manager is destroyed
547 // with no roots. 547 // with no roots.
548 TEST(WindowManagerStateShutdownTest, DestroyTreeBeforeDisplay) { 548 TEST(WindowManagerStateShutdownTest, DestroyTreeBeforeDisplay) {
549 WindowServerTestHelper ws_test_helper; 549 WindowServerTestHelper ws_test_helper;
550 ws_test_helper.window_server_delegate()->set_num_displays_to_create(1); 550 ws_test_helper.window_server_delegate()->CreateDisplays(1);
551 WindowServer* window_server = ws_test_helper.window_server(); 551 WindowServer* window_server = ws_test_helper.window_server();
552 const UserId kUserId1 = "2"; 552 const UserId kUserId1 = "2";
553 WindowManagerWindowTreeFactorySetTestApi( 553 WindowManagerWindowTreeFactorySetTestApi(
554 window_server->window_manager_window_tree_factory_set()) 554 window_server->window_manager_window_tree_factory_set())
555 .Add(kUserId1); 555 .Add(kUserId1);
556 ASSERT_EQ(1u, window_server->display_manager()->displays().size()); 556 ASSERT_EQ(1u, window_server->display_manager()->displays().size());
557 Display* display = *(window_server->display_manager()->displays().begin()); 557 Display* display = *(window_server->display_manager()->displays().begin());
558 WindowManagerDisplayRoot* window_manager_display_root = 558 WindowManagerDisplayRoot* window_manager_display_root =
559 display->GetWindowManagerDisplayRootForUser(kUserId1); 559 display->GetWindowManagerDisplayRootForUser(kUserId1);
560 ASSERT_TRUE(window_manager_display_root); 560 ASSERT_TRUE(window_manager_display_root);
561 WindowTree* tree = 561 WindowTree* tree =
562 window_manager_display_root->window_manager_state()->window_tree(); 562 window_manager_display_root->window_manager_state()->window_tree();
563 ASSERT_EQ(1u, tree->roots().size()); 563 ASSERT_EQ(1u, tree->roots().size());
564 ClientWindowId root_client_id; 564 ClientWindowId root_client_id;
565 ASSERT_TRUE(tree->IsWindowKnown(*(tree->roots().begin()), &root_client_id)); 565 ASSERT_TRUE(tree->IsWindowKnown(*(tree->roots().begin()), &root_client_id));
566 EXPECT_TRUE(tree->DeleteWindow(root_client_id)); 566 EXPECT_TRUE(tree->DeleteWindow(root_client_id));
567 window_server->DestroyTree(tree); 567 window_server->DestroyTree(tree);
568 } 568 }
569 569
570 } // namespace test 570 } // namespace test
571 } // namespace ws 571 } // namespace ws
572 } // namespace ui 572 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/user_display_manager_unittest.cc ('k') | services/ui/ws/window_manager_window_tree_factory_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698