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

Side by Side Diff: components/mus/ws/display_unittest.cc

Issue 1770533002: Change userid from a uint32_t to a string guid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@33connector
Patch Set: . Created 4 years, 9 months 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 | « components/mus/ws/display.cc ('k') | components/mus/ws/test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 base::MessageLoop message_loop_; 71 base::MessageLoop message_loop_;
72 TestWindowManagerFactory test_window_manager_factory_; 72 TestWindowManagerFactory test_window_manager_factory_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(DisplayTest); 74 DISALLOW_COPY_AND_ASSIGN(DisplayTest);
75 }; 75 };
76 76
77 TEST_F(DisplayTest, CallsCreateDefaultDisplays) { 77 TEST_F(DisplayTest, CallsCreateDefaultDisplays) {
78 const int kNumHostsToCreate = 2; 78 const int kNumHostsToCreate = 2;
79 connection_manager_delegate_.set_num_displays_to_create(kNumHostsToCreate); 79 connection_manager_delegate_.set_num_displays_to_create(kNumHostsToCreate);
80 80
81 const UserId kTestId1 = 2; 81 const UserId kTestId1 = "2";
82 const UserId kTestId2 = 21; 82 const UserId kTestId2 = "21";
83 WindowManagerFactoryRegistryTestApi( 83 WindowManagerFactoryRegistryTestApi(
84 connection_manager_->window_manager_factory_registry()) 84 connection_manager_->window_manager_factory_registry())
85 .AddService(kTestId1, &test_window_manager_factory_); 85 .AddService(kTestId1, &test_window_manager_factory_);
86 // The first register should trigger creation of the default 86 // The first register should trigger creation of the default
87 // Displays. There should be kNumHostsToCreate Displays. 87 // Displays. There should be kNumHostsToCreate Displays.
88 EXPECT_EQ(static_cast<size_t>(kNumHostsToCreate), 88 EXPECT_EQ(static_cast<size_t>(kNumHostsToCreate),
89 connection_manager_->displays().size()); 89 connection_manager_->displays().size());
90 90
91 // Each host should have a WindowManagerState for kTestId1. 91 // Each host should have a WindowManagerState for kTestId1.
92 for (Display* display : connection_manager_->displays()) { 92 for (Display* display : connection_manager_->displays()) {
(...skipping 16 matching lines...) Expand all
109 ASSERT_TRUE(state2); 109 ASSERT_TRUE(state2);
110 // Verify the two states have different roots. 110 // Verify the two states have different roots.
111 EXPECT_NE(state1, state2); 111 EXPECT_NE(state1, state2);
112 EXPECT_NE(state1->root(), state2->root()); 112 EXPECT_NE(state1->root(), state2->root());
113 } 113 }
114 } 114 }
115 115
116 TEST_F(DisplayTest, Destruction) { 116 TEST_F(DisplayTest, Destruction) {
117 connection_manager_delegate_.set_num_displays_to_create(1); 117 connection_manager_delegate_.set_num_displays_to_create(1);
118 118
119 const UserId kTestId1 = 2; 119 const UserId kTestId1 = "2";
120 const UserId kTestId2 = 21; 120 const UserId kTestId2 = "21";
121 WindowManagerFactoryRegistryTestApi( 121 WindowManagerFactoryRegistryTestApi(
122 connection_manager_->window_manager_factory_registry()) 122 connection_manager_->window_manager_factory_registry())
123 .AddService(kTestId1, &test_window_manager_factory_); 123 .AddService(kTestId1, &test_window_manager_factory_);
124 124
125 // Add another registry, should trigger creation of another wm. 125 // Add another registry, should trigger creation of another wm.
126 WindowManagerFactoryRegistryTestApi( 126 WindowManagerFactoryRegistryTestApi(
127 connection_manager_->window_manager_factory_registry()) 127 connection_manager_->window_manager_factory_registry())
128 .AddService(kTestId2, &test_window_manager_factory_); 128 .AddService(kTestId2, &test_window_manager_factory_);
129 ASSERT_EQ(1u, connection_manager_->displays().size()); 129 ASSERT_EQ(1u, connection_manager_->displays().size());
130 Display* display = *connection_manager_->displays().begin(); 130 Display* display = *connection_manager_->displays().begin();
(...skipping 15 matching lines...) Expand all
146 EXPECT_FALSE(connection_manager_delegate_.got_on_no_more_connections()); 146 EXPECT_FALSE(connection_manager_delegate_.got_on_no_more_connections());
147 // Destroy the Display, which should shutdown the trees. 147 // Destroy the Display, which should shutdown the trees.
148 connection_manager_->DestroyDisplay(display); 148 connection_manager_->DestroyDisplay(display);
149 EXPECT_EQ(0u, connection_manager_->num_trees()); 149 EXPECT_EQ(0u, connection_manager_->num_trees());
150 EXPECT_TRUE(connection_manager_delegate_.got_on_no_more_connections()); 150 EXPECT_TRUE(connection_manager_delegate_.got_on_no_more_connections());
151 } 151 }
152 152
153 } // namespace test 153 } // namespace test
154 } // namespace ws 154 } // namespace ws
155 } // namespace mus 155 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/display.cc ('k') | components/mus/ws/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698