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

Unified Diff: ui/ozone/platform/wayland/fake_server.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/fake_server.h ('k') | ui/ozone/platform/wayland/wayland_display.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2afc547aa2b2e66dcd35223b13e23cedc4535e3e..be406898c548a95721ba07627185fbd22b290794 100644
--- a/ui/ozone/platform/wayland/fake_server.cc
+++ b/ui/ozone/platform/wayland/fake_server.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/files/scoped_file.h"
+#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
namespace wl {
@@ -274,6 +275,7 @@ FakeServer::FakeServer()
resume_event_(false, false) {}
FakeServer::~FakeServer() {
+ Resume();
Stop();
}
@@ -312,10 +314,6 @@ bool FakeServer::Start() {
return true;
}
-void FakeServer::Flush() {
- wl_display_flush_clients(display_.get());
-}
-
void FakeServer::Pause() {
task_runner()->PostTask(
FROM_HERE, base::Bind(&FakeServer::DoPause, base::Unretained(this)));
@@ -323,10 +321,13 @@ void FakeServer::Pause() {
}
void FakeServer::Resume() {
+ if (display_)
+ wl_display_flush_clients(display_.get());
resume_event_.Signal();
}
void FakeServer::DoPause() {
+ base::RunLoop().RunUntilIdle();
pause_event_.Signal();
resume_event_.Wait();
}
« no previous file with comments | « ui/ozone/platform/wayland/fake_server.h ('k') | ui/ozone/platform/wayland/wayland_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698