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

Unified Diff: ui/ozone/platform/wayland/wayland_connection_unittest.cc

Issue 2042503002: ozone/platform/wayland: Add support for wl_output_interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [For landding] update comments Created 4 years, 3 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
« no previous file with comments | « ui/ozone/platform/wayland/wayland_connection.cc ('k') | ui/ozone/platform/wayland/wayland_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/wayland_connection_unittest.cc
diff --git a/ui/ozone/platform/wayland/wayland_connection_unittest.cc b/ui/ozone/platform/wayland/wayland_connection_unittest.cc
index abeb8818a15d8281acb250d41b564600600f8cb7..b261ec161229a173188bef640e8d935351968aae 100644
--- a/ui/ozone/platform/wayland/wayland_connection_unittest.cc
+++ b/ui/ozone/platform/wayland/wayland_connection_unittest.cc
@@ -9,9 +9,23 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/ozone/platform/wayland/fake_server.h"
#include "ui/ozone/platform/wayland/wayland_connection.h"
+#include "ui/ozone/platform/wayland/wayland_output.h"
namespace ui {
+class OutputObserver : public WaylandOutput::Observer {
+ public:
+ explicit OutputObserver(const base::Closure& closure) : closure_(closure) {}
+
+ void OnOutputReadyForUse() override {
+ if (!closure_.is_null())
+ closure_.Run();
+ }
+
+ private:
+ const base::Closure closure_;
+};
+
TEST(WaylandConnectionTest, UseUnstableVersion) {
base::MessageLoopForUI message_loop;
wl::FakeServer server;
@@ -45,4 +59,28 @@ TEST(WaylandConnectionTest, Ping) {
server.Pause();
}
+TEST(WaylandConnectionTest, Output) {
+ base::MessageLoopForUI message_loop;
+ wl::FakeServer server;
+ ASSERT_TRUE(server.Start());
+ server.output()->SetRect(gfx::Rect(0, 0, 800, 600));
+ WaylandConnection connection;
+ ASSERT_TRUE(connection.Initialize());
+ connection.StartProcessingEvents();
+
+ base::RunLoop run_loop;
+ OutputObserver observer(run_loop.QuitClosure());
+ connection.PrimaryOutput()->SetObserver(&observer);
+ run_loop.Run();
+
+ ASSERT_TRUE(connection.GetOutputList().size() == 1);
+ WaylandOutput* output = connection.PrimaryOutput();
+ ASSERT_TRUE(output->Geometry().width() == 800);
+ ASSERT_TRUE(output->Geometry().height() == 600);
+
+ server.Resume();
+ base::RunLoop().RunUntilIdle();
+ server.Pause();
+}
+
} // namespace ui
« no previous file with comments | « ui/ozone/platform/wayland/wayland_connection.cc ('k') | ui/ozone/platform/wayland/wayland_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698