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

Side by Side Diff: ui/ozone/platform/wayland/fake_server.h

Issue 1739193004: ozone/platform/wayland: Use more realistic event processing and request flushing in tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wayland-test2
Patch Set: Use watching_ instead of base::MessageLoopForUI::IsCurrent() 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 | « no previous file | ui/ozone/platform/wayland/fake_server.cc » ('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 #ifndef UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_
6 #define UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ 6 #define UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_
7 7
8 #include <wayland-server-core.h> 8 #include <wayland-server-core.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 FakeServer(); 139 FakeServer();
140 ~FakeServer() override; 140 ~FakeServer() override;
141 141
142 // Start the fake Wayland server. If this succeeds, the WAYLAND_SOCKET 142 // Start the fake Wayland server. If this succeeds, the WAYLAND_SOCKET
143 // environment variable will be set to the string representation of a file 143 // environment variable will be set to the string representation of a file
144 // descriptor that a client can connect to. The caller is responsible for 144 // descriptor that a client can connect to. The caller is responsible for
145 // ensuring that this file descriptor gets closed (for example, by calling 145 // ensuring that this file descriptor gets closed (for example, by calling
146 // wl_display_connect). 146 // wl_display_connect).
147 bool Start(); 147 bool Start();
148 148
149 void Flush(); 149 // Pause the server when it becomes idle.
150 void Pause();
150 151
151 void Pause(); 152 // Resume the server after flushing client connections.
152 void Resume(); 153 void Resume();
153 154
154 template <typename T> 155 template <typename T>
155 T* GetObject(uint32_t id) { 156 T* GetObject(uint32_t id) {
156 wl_resource* resource = wl_client_get_object(client_, id); 157 wl_resource* resource = wl_client_get_object(client_, id);
157 return resource ? T::FromResource(resource) : nullptr; 158 return resource ? T::FromResource(resource) : nullptr;
158 } 159 }
159 160
160 MockXdgShell* xdg_shell() { return &xdg_shell_; } 161 MockXdgShell* xdg_shell() { return &xdg_shell_; }
161 162
(...skipping 18 matching lines...) Expand all
180 MockXdgShell xdg_shell_; 181 MockXdgShell xdg_shell_;
181 182
182 base::MessagePumpLibevent::FileDescriptorWatcher controller_; 183 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
183 184
184 DISALLOW_COPY_AND_ASSIGN(FakeServer); 185 DISALLOW_COPY_AND_ASSIGN(FakeServer);
185 }; 186 };
186 187
187 } // namespace wl 188 } // namespace wl
188 189
189 #endif // UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ 190 #endif // UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/wayland/fake_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698