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

Unified Diff: ui/ozone/platform/wayland/fake_server.h

Issue 2042503002: ozone/platform/wayland: Add support for wl_output_interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WaylandDisplay => WaylandConnection, WaylandScreen => WaylandOutput 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
Index: ui/ozone/platform/wayland/fake_server.h
diff --git a/ui/ozone/platform/wayland/fake_server.h b/ui/ozone/platform/wayland/fake_server.h
index 499d84f436392484008ba7f86090ac799f258f20..4d32df12fe16097825e94e3ecbde296221d67180 100644
--- a/ui/ozone/platform/wayland/fake_server.h
+++ b/ui/ozone/platform/wayland/fake_server.h
@@ -12,6 +12,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "testing/gmock/include/gmock/gmock.h"
+#include "ui/display/display.h"
rjkroege 2016/07/08 21:59:19 What is this file for? Can you add a class comment
joone 2016/07/20 00:07:20 I removed display::Display dependency.
struct wl_client;
struct wl_display;
@@ -92,6 +93,7 @@ class Global {
virtual ~Global();
bool Initialize(wl_display* display);
+ virtual void OnBind() {}
// The first bound resource to this global, which is usually all that is
// useful when testing a simple client.
@@ -127,6 +129,20 @@ class MockCompositor : public Global {
DISALLOW_COPY_AND_ASSIGN(MockCompositor);
};
+class MockOutput : public Global {
+ public:
+ MockOutput();
+ ~MockOutput() override;
+ void SetDisplay(const display::Display& display) { fake_display_ = display; }
+ const display::Display& Display() { return fake_display_; }
+ void OnBind() override;
+
+ private:
+ display::Display fake_display_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockOutput);
+};
+
class MockSeat : public Global {
public:
MockSeat();
@@ -172,6 +188,8 @@ class FakeServer : public base::Thread, base::MessagePumpLibevent::Watcher {
// Resume the server after flushing client connections.
void Resume();
+ void AddDisplay(const display::Display&);
+
template <typename T>
T* GetObject(uint32_t id) {
wl_resource* resource = wl_client_get_object(client_, id);
@@ -199,6 +217,7 @@ class FakeServer : public base::Thread, base::MessagePumpLibevent::Watcher {
bool paused_ = false;
MockCompositor compositor_;
+ MockOutput output_;
MockSeat seat_;
MockXdgShell xdg_shell_;

Powered by Google App Engine
This is Rietveld 408576698