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

Side by Side Diff: services/ui/test_wm/test_wm.cc

Issue 2559343003: mus: Rename GpuService to Gpu. (Closed)
Patch Set: . Created 4 years 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 | « services/ui/service.cc ('k') | services/ui/ws/gpu_service_proxy.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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/cpp/bindings/binding.h"
11 #include "services/service_manager/public/c/main.h" 11 #include "services/service_manager/public/c/main.h"
12 #include "services/service_manager/public/cpp/connector.h" 12 #include "services/service_manager/public/cpp/connector.h"
13 #include "services/service_manager/public/cpp/service.h" 13 #include "services/service_manager/public/cpp/service.h"
14 #include "services/service_manager/public/cpp/service_context.h" 14 #include "services/service_manager/public/cpp/service_context.h"
15 #include "services/service_manager/public/cpp/service_runner.h" 15 #include "services/service_manager/public/cpp/service_runner.h"
16 #include "services/ui/public/cpp/gpu/gpu_service.h" 16 #include "services/ui/public/cpp/gpu/gpu.h"
17 #include "ui/aura/env.h" 17 #include "ui/aura/env.h"
18 #include "ui/aura/mus/mus_context_factory.h" 18 #include "ui/aura/mus/mus_context_factory.h"
19 #include "ui/aura/mus/property_converter.h" 19 #include "ui/aura/mus/property_converter.h"
20 #include "ui/aura/mus/property_utils.h" 20 #include "ui/aura/mus/property_utils.h"
21 #include "ui/aura/mus/window_manager_delegate.h" 21 #include "ui/aura/mus/window_manager_delegate.h"
22 #include "ui/aura/mus/window_tree_client.h" 22 #include "ui/aura/mus/window_tree_client.h"
23 #include "ui/aura/mus/window_tree_client_delegate.h" 23 #include "ui/aura/mus/window_tree_client_delegate.h"
24 #include "ui/aura/mus/window_tree_host_mus.h" 24 #include "ui/aura/mus/window_tree_host_mus.h"
25 #include "ui/aura/test/test_focus_client.h" 25 #include "ui/aura/test/test_focus_client.h"
26 #include "ui/aura/window.h" 26 #include "ui/aura/window.h"
(...skipping 12 matching lines...) Expand all
39 public: 39 public:
40 TestWM() {} 40 TestWM() {}
41 41
42 ~TestWM() override { 42 ~TestWM() override {
43 // WindowTreeHost uses state from WindowTreeClient, so destroy it first. 43 // WindowTreeHost uses state from WindowTreeClient, so destroy it first.
44 window_tree_host_.reset(); 44 window_tree_host_.reset();
45 45
46 // WindowTreeClient destruction may callback to us. 46 // WindowTreeClient destruction may callback to us.
47 window_tree_client_.reset(); 47 window_tree_client_.reset();
48 48
49 gpu_service_.reset(); 49 gpu_.reset();
50 50
51 display::Screen::SetScreenInstance(nullptr); 51 display::Screen::SetScreenInstance(nullptr);
52 } 52 }
53 53
54 private: 54 private:
55 // service_manager::Service: 55 // service_manager::Service:
56 void OnStart() override { 56 void OnStart() override {
57 CHECK(!started_); 57 CHECK(!started_);
58 started_ = true; 58 started_ = true;
59 screen_ = base::MakeUnique<display::ScreenBase>(); 59 screen_ = base::MakeUnique<display::ScreenBase>();
60 display::Screen::SetScreenInstance(screen_.get()); 60 display::Screen::SetScreenInstance(screen_.get());
61 aura_env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS); 61 aura_env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS);
62 gpu_service_ = ui::GpuService::Create(context()->connector(), nullptr); 62 gpu_ = ui::Gpu::Create(context()->connector(), nullptr);
63 compositor_context_factory_ = 63 compositor_context_factory_ =
64 base::MakeUnique<aura::MusContextFactory>(gpu_service_.get()); 64 base::MakeUnique<aura::MusContextFactory>(gpu_.get());
65 aura_env_->set_context_factory(compositor_context_factory_.get()); 65 aura_env_->set_context_factory(compositor_context_factory_.get());
66 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>( 66 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>(
67 context()->connector(), this, this); 67 context()->connector(), this, this);
68 aura_env_->SetWindowTreeClient(window_tree_client_.get()); 68 aura_env_->SetWindowTreeClient(window_tree_client_.get());
69 window_tree_client_->ConnectAsWindowManager(); 69 window_tree_client_->ConnectAsWindowManager();
70 } 70 }
71 71
72 bool OnConnect(const service_manager::ServiceInfo& remote_info, 72 bool OnConnect(const service_manager::ServiceInfo& remote_info,
73 service_manager::InterfaceRegistry* registry) override { 73 service_manager::InterfaceRegistry* registry) override {
74 return false; 74 return false;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 std::unique_ptr<display::ScreenBase> screen_; 171 std::unique_ptr<display::ScreenBase> screen_;
172 172
173 std::unique_ptr<aura::Env> aura_env_; 173 std::unique_ptr<aura::Env> aura_env_;
174 ::wm::WMState wm_state_; 174 ::wm::WMState wm_state_;
175 aura::PropertyConverter property_converter_; 175 aura::PropertyConverter property_converter_;
176 aura::test::TestFocusClient focus_client_; 176 aura::test::TestFocusClient focus_client_;
177 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_; 177 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_;
178 aura::Window* root_ = nullptr; 178 aura::Window* root_ = nullptr;
179 aura::WindowManagerClient* window_manager_client_ = nullptr; 179 aura::WindowManagerClient* window_manager_client_ = nullptr;
180 std::unique_ptr<aura::WindowTreeClient> window_tree_client_; 180 std::unique_ptr<aura::WindowTreeClient> window_tree_client_;
181 std::unique_ptr<ui::GpuService> gpu_service_; 181 std::unique_ptr<ui::Gpu> gpu_;
182 std::unique_ptr<aura::MusContextFactory> compositor_context_factory_; 182 std::unique_ptr<aura::MusContextFactory> compositor_context_factory_;
183 183
184 bool started_ = false; 184 bool started_ = false;
185 185
186 DISALLOW_COPY_AND_ASSIGN(TestWM); 186 DISALLOW_COPY_AND_ASSIGN(TestWM);
187 }; 187 };
188 188
189 } // namespace test 189 } // namespace test
190 } // namespace ui 190 } // namespace ui
191 191
192 MojoResult ServiceMain(MojoHandle service_request_handle) { 192 MojoResult ServiceMain(MojoHandle service_request_handle) {
193 service_manager::ServiceRunner runner(new ui::test::TestWM); 193 service_manager::ServiceRunner runner(new ui::test::TestWM);
194 return runner.Run(service_request_handle); 194 return runner.Run(service_request_handle);
195 } 195 }
OLDNEW
« no previous file with comments | « services/ui/service.cc ('k') | services/ui/ws/gpu_service_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698