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

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

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/wayland/wayland_display.cc ('k') | ui/ozone/platform/wayland/wayland_surface_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/wayland_display_unittest.cc
diff --git a/ui/ozone/platform/wayland/wayland_display_unittest.cc b/ui/ozone/platform/wayland/wayland_display_unittest.cc
index a50f83fbcf3b37c04ca9373ca3b0877bdecefaea..3b37154a689b7b922b10b51eb83326f4769bb29e 100644
--- a/ui/ozone/platform/wayland/wayland_display_unittest.cc
+++ b/ui/ozone/platform/wayland/wayland_display_unittest.cc
@@ -5,6 +5,7 @@
#include <wayland-server-core.h>
#include <xdg-shell-unstable-v5-server-protocol.h>
+#include "base/run_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/ozone/platform/wayland/fake_server.h"
#include "ui/ozone/platform/wayland/wayland_display.h"
@@ -12,31 +13,36 @@
namespace ui {
TEST(WaylandDisplayTest, UseUnstableVersion) {
+ base::MessageLoopForUI message_loop;
wl::FakeServer server;
EXPECT_CALL(*server.xdg_shell(),
UseUnstableVersion(XDG_SHELL_VERSION_CURRENT));
ASSERT_TRUE(server.Start());
WaylandDisplay display;
ASSERT_TRUE(display.Initialize());
- wl_display_roundtrip(display.display());
+ display.StartProcessingEvents();
+
+ base::RunLoop().RunUntilIdle();
+ server.Pause();
}
TEST(WaylandDisplayTest, Ping) {
+ base::MessageLoopForUI message_loop;
wl::FakeServer server;
ASSERT_TRUE(server.Start());
WaylandDisplay display;
ASSERT_TRUE(display.Initialize());
- wl_display_roundtrip(display.display());
+ display.StartProcessingEvents();
+ base::RunLoop().RunUntilIdle();
server.Pause();
xdg_shell_send_ping(server.xdg_shell()->resource(), 1234);
EXPECT_CALL(*server.xdg_shell(), Pong(1234));
- server.Flush();
server.Resume();
-
- wl_display_roundtrip(display.display());
+ base::RunLoop().RunUntilIdle();
+ server.Pause();
}
} // namespace ui
« no previous file with comments | « ui/ozone/platform/wayland/wayland_display.cc ('k') | ui/ozone/platform/wayland/wayland_surface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698