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

Unified Diff: components/mus/ws/display_unittest.cc

Issue 2105483002: mus: Make sure only valid user-ids can be active. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/cursor_unittest.cc ('k') | components/mus/ws/user_id_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/display_unittest.cc
diff --git a/components/mus/ws/display_unittest.cc b/components/mus/ws/display_unittest.cc
index a06a3b02f62c741acdfe0835f95d61b6183888c5..dfc24ef25a802af1b401923b03b84798976d34be 100644
--- a/components/mus/ws/display_unittest.cc
+++ b/components/mus/ws/display_unittest.cc
@@ -33,6 +33,9 @@ namespace ws {
namespace test {
namespace {
+const UserId kTestId1 = "2";
+const UserId kTestId2 = "21";
+
ClientWindowId ClientWindowIdForFirstRoot(WindowTree* tree) {
if (tree->roots().empty())
return ClientWindowId();
@@ -62,6 +65,8 @@ class DisplayTest : public testing::Test {
window_server_.reset(new WindowServer(&window_server_delegate_,
scoped_refptr<SurfacesState>()));
window_server_delegate_.set_window_server(window_server_.get());
+ window_server_->user_id_tracker()->AddUserId(kTestId1);
+ window_server_->user_id_tracker()->AddUserId(kTestId2);
}
protected:
@@ -79,8 +84,6 @@ TEST_F(DisplayTest, CallsCreateDefaultDisplays) {
const int kNumHostsToCreate = 2;
window_server_delegate_.set_num_displays_to_create(kNumHostsToCreate);
- const UserId kTestId1 = "2";
- const UserId kTestId2 = "21";
DisplayManager* display_manager = window_server_->display_manager();
WindowManagerWindowTreeFactorySetTestApi(
window_server_->window_manager_window_tree_factory_set())
@@ -118,8 +121,6 @@ TEST_F(DisplayTest, CallsCreateDefaultDisplays) {
TEST_F(DisplayTest, Destruction) {
window_server_delegate_.set_num_displays_to_create(1);
- const UserId kTestId1 = "2";
- const UserId kTestId2 = "21";
WindowManagerWindowTreeFactorySetTestApi(
window_server_->window_manager_window_tree_factory_set())
.Add(kTestId1);
@@ -156,8 +157,6 @@ TEST_F(DisplayTest, Destruction) {
TEST_F(DisplayTest, EventStateResetOnUserSwitch) {
window_server_delegate_.set_num_displays_to_create(1);
- const UserId kTestId1 = "20";
- const UserId kTestId2 = "201";
WindowManagerWindowTreeFactorySetTestApi(
window_server_->window_manager_window_tree_factory_set())
.Add(kTestId1);
@@ -205,8 +204,6 @@ TEST_F(DisplayTest, EventStateResetOnUserSwitch) {
// Verifies capture fails when wm is inactive and succeeds when wm is active.
TEST_F(DisplayTest, SetCaptureFromWindowManager) {
window_server_delegate_.set_num_displays_to_create(1);
- const UserId kTestId1 = "20";
- const UserId kTestId2 = "201";
WindowManagerWindowTreeFactorySetTestApi(
window_server_->window_manager_window_tree_factory_set())
.Add(kTestId1);
@@ -240,8 +237,6 @@ TEST_F(DisplayTest, SetCaptureFromWindowManager) {
TEST_F(DisplayTest, FocusFailsForInactiveUser) {
window_server_delegate_.set_num_displays_to_create(1);
- const UserId kTestId1 = "20";
- const UserId kTestId2 = "201";
WindowManagerWindowTreeFactorySetTestApi(
window_server_->window_manager_window_tree_factory_set())
.Add(kTestId1);
@@ -282,7 +277,6 @@ TEST_F(DisplayTest, FocusFailsForInactiveUser) {
// Verifies a single tree is used for multiple displays.
TEST_F(DisplayTest, MultipleDisplays) {
window_server_delegate_.set_num_displays_to_create(2);
- const UserId kTestId1 = "20";
WindowManagerWindowTreeFactorySetTestApi(
window_server_->window_manager_window_tree_factory_set())
.Add(kTestId1);
« no previous file with comments | « components/mus/ws/cursor_unittest.cc ('k') | components/mus/ws/user_id_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698