| Index: ui/ozone/platform/wayland/fake_server.cc
|
| diff --git a/ui/ozone/platform/wayland/fake_server.cc b/ui/ozone/platform/wayland/fake_server.cc
|
| index 03704a94d049c1a42dda143f8248e595858cb0e1..67a0a16314ca47d89deaa23927ebbc8fc7f7001c 100644
|
| --- a/ui/ozone/platform/wayland/fake_server.cc
|
| +++ b/ui/ozone/platform/wayland/fake_server.cc
|
| @@ -18,6 +18,7 @@ namespace wl {
|
| namespace {
|
|
|
| const uint32_t kCompositorVersion = 4;
|
| +const uint32_t kOutputVersion = 2;
|
| const uint32_t kSeatVersion = 4;
|
| const uint32_t kXdgShellVersion = 1;
|
|
|
| @@ -278,6 +279,7 @@ void Global::Bind(wl_client* client,
|
| global->resource_ = resource;
|
| wl_resource_set_implementation(resource, global->implementation_, global,
|
| &Global::OnResourceDestroyed);
|
| + global->OnBind();
|
| }
|
|
|
| // static
|
| @@ -296,6 +298,21 @@ void MockCompositor::AddSurface(std::unique_ptr<MockSurface> surface) {
|
| surfaces_.push_back(std::move(surface));
|
| }
|
|
|
| +MockOutput::MockOutput()
|
| + : Global(&wl_output_interface, nullptr, kOutputVersion) {}
|
| +
|
| +MockOutput::~MockOutput() {}
|
| +
|
| +void MockOutput::OnBind() {
|
| + gfx::Rect bounds = Display().bounds();
|
| + const char* kUnknownMake = "unknown";
|
| + const char* kUnknownModel = "unknown";
|
| + wl_output_send_geometry(resource(), bounds.x(), bounds.y(), 0, 0, 0,
|
| + kUnknownMake, kUnknownModel, 0);
|
| + wl_output_send_mode(resource(), WL_OUTPUT_MODE_CURRENT, bounds.width(),
|
| + bounds.height(), 0);
|
| +}
|
| +
|
| MockSeat::MockSeat() : Global(&wl_seat_interface, &seat_impl, kSeatVersion) {}
|
|
|
| MockSeat::~MockSeat() {}
|
| @@ -319,6 +336,10 @@ FakeServer::~FakeServer() {
|
| Stop();
|
| }
|
|
|
| +void FakeServer::AddDisplay(const display::Display& fake_display) {
|
| + output_.SetDisplay(fake_display);
|
| +}
|
| +
|
| bool FakeServer::Start() {
|
| display_.reset(wl_display_create());
|
| if (!display_)
|
| @@ -335,6 +356,8 @@ bool FakeServer::Start() {
|
| return false;
|
| if (!compositor_.Initialize(display_.get()))
|
| return false;
|
| + if (!output_.Initialize(display_.get()))
|
| + return false;
|
| if (!seat_.Initialize(display_.get()))
|
| return false;
|
| if (!xdg_shell_.Initialize(display_.get()))
|
|
|