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

Side by Side Diff: ash/mus/test/wm_test_helper.cc

Issue 2408273002: mash: Port TrayUpdateTest to AshTest (Closed)
Patch Set: Created 4 years, 2 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
« ash/common/wm_shell.h ('K') | « ash/common/wm_shell.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 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 "ash/mus/test/wm_test_helper.h" 5 #include "ash/mus/test/wm_test_helper.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/test/material_design_controller_test_api.h" 8 #include "ash/common/test/material_design_controller_test_api.h"
9 #include "ash/common/test/test_system_tray_delegate.h"
10 #include "ash/common/wm_shell.h"
9 #include "ash/mus/root_window_controller.h" 11 #include "ash/mus/root_window_controller.h"
10 #include "ash/mus/window_manager.h" 12 #include "ash/mus/window_manager.h"
11 #include "ash/mus/window_manager_application.h" 13 #include "ash/mus/window_manager_application.h"
12 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
13 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
14 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_split.h" 17 #include "base/strings/string_split.h"
16 #include "base/test/sequenced_worker_pool_owner.h" 18 #include "base/test/sequenced_worker_pool_owner.h"
17 #include "services/ui/public/cpp/property_type_converters.h" 19 #include "services/ui/public/cpp/property_type_converters.h"
18 #include "services/ui/public/cpp/tests/window_tree_client_private.h" 20 #include "services/ui/public/cpp/tests/window_tree_client_private.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 98
97 window_manager_app_->window_manager_.reset(new WindowManager(nullptr)); 99 window_manager_app_->window_manager_.reset(new WindowManager(nullptr));
98 100
99 window_tree_client_setup_.InitForWindowManager( 101 window_tree_client_setup_.InitForWindowManager(
100 window_manager_app_->window_manager_.get(), 102 window_manager_app_->window_manager_.get(),
101 window_manager_app_->window_manager_.get()); 103 window_manager_app_->window_manager_.get());
102 window_manager_app_->InitWindowManager( 104 window_manager_app_->InitWindowManager(
103 window_tree_client_setup_.OwnWindowTreeClient(), 105 window_tree_client_setup_.OwnWindowTreeClient(),
104 blocking_pool_owner_->pool()); 106 blocking_pool_owner_->pool());
105 107
108 // TODO(jamescook): Pass a TestShellDelegate into WindowManager and use it to
109 // create the various test delegates.
110 WmShell::Get()->SetSystemTrayDelegate(
111 base::MakeUnique<test::TestSystemTrayDelegate>());
112
106 ui::WindowTreeClient* window_tree_client = 113 ui::WindowTreeClient* window_tree_client =
107 window_manager_app_->window_manager()->window_tree_client(); 114 window_manager_app_->window_manager()->window_tree_client();
108 window_tree_client_private_ = 115 window_tree_client_private_ =
109 base::MakeUnique<ui::WindowTreeClientPrivate>(window_tree_client); 116 base::MakeUnique<ui::WindowTreeClientPrivate>(window_tree_client);
110 int next_x = 0; 117 int next_x = 0;
111 CreateRootWindowController("800x600", &next_x); 118 CreateRootWindowController("800x600", &next_x);
112 } 119 }
113 120
114 std::vector<RootWindowController*> WmTestHelper::GetRootsOrderedByDisplayId() { 121 std::vector<RootWindowController*> WmTestHelper::GetRootsOrderedByDisplayId() {
115 std::set<RootWindowController*> roots = 122 std::set<RootWindowController*> roots =
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 root_window_controller->display().id()) == 182 root_window_controller->display().id()) ==
176 screen->display_list()->GetPrimaryDisplayIterator(); 183 screen->display_list()->GetPrimaryDisplayIterator();
177 screen->display_list()->UpdateDisplay( 184 screen->display_list()->UpdateDisplay(
178 root_window_controller->display(), 185 root_window_controller->display(),
179 is_primary ? display::DisplayList::Type::PRIMARY 186 is_primary ? display::DisplayList::Type::PRIMARY
180 : display::DisplayList::Type::NOT_PRIMARY); 187 : display::DisplayList::Type::NOT_PRIMARY);
181 } 188 }
182 189
183 } // namespace mus 190 } // namespace mus
184 } // namespace ash 191 } // namespace ash
OLDNEW
« ash/common/wm_shell.h ('K') | « ash/common/wm_shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698