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

Unified Diff: components/arc/standalone/service_helper_unittest.cc

Issue 2391743002: Use FileDescriptorWatcher in ServiceHelper. (Closed)
Patch Set: self-review Created 4 years, 2 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 | « components/arc/standalone/service_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/standalone/service_helper_unittest.cc
diff --git a/components/arc/standalone/service_helper_unittest.cc b/components/arc/standalone/service_helper_unittest.cc
index a72703b0a798ab8910a0164607a7407ebfe16aec..35dd5af37a479b0841070e691d720ed28644a055 100644
--- a/components/arc/standalone/service_helper_unittest.cc
+++ b/components/arc/standalone/service_helper_unittest.cc
@@ -10,7 +10,9 @@
#include <memory>
#include "base/bind.h"
+#include "base/files/file_descriptor_watcher_posix.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
@@ -39,6 +41,10 @@ class ServiceHelperTest : public ::testing::Test {
base_loop_.reset(new base::MessageLoopForIO());
run_loop_.reset(new base::RunLoop());
+ // Required to watch a file descriptor from ServiceHelper.
+ file_descriptor_watcher_ =
+ base::MakeUnique<FileDescriptorWatcher>(base_loop_.get());
+
// This cannot be put inside SetUp() because we need to run it after fork().
helper_.reset(new ServiceHelper());
helper_->Init(base::Bind(&ServiceHelperTest::Quit,
@@ -47,6 +53,7 @@ class ServiceHelperTest : public ::testing::Test {
protected:
std::unique_ptr<base::MessageLoopForIO> base_loop_;
+ std::unique_ptr<base::MessageLoopForIO> file_descriptor_watcher_;
std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<ServiceHelper> helper_;
« no previous file with comments | « components/arc/standalone/service_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698