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

Unified Diff: chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc

Issue 2384163003: Use FileDescriptorWatcher in NativeMessageProcessHost. (Closed)
Patch Set: fix test error 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 | « chrome/browser/extensions/api/messaging/native_message_process_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
index b913e422d6fe423e0dd8db8b2da7edbe12b532cf..4d8cf88d382390493b88d5341264f358044a29cd 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
@@ -35,6 +35,10 @@
#include "extensions/common/features/feature_channel.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_POSIX)
+#include "base/files/file_descriptor_watcher_posix.h"
+#endif
+
#if defined(OS_WIN)
#include <windows.h>
#include "base/win/scoped_handle.h"
@@ -102,6 +106,9 @@ class NativeMessagingTest : public ::testing::Test,
NativeMessagingTest()
: current_channel_(version_info::Channel::DEV),
thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
+#if defined(OS_POSIX)
+ file_descriptor_watcher_(base::MessageLoopForIO::current()),
+#endif
channel_closed_(false) {}
void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); }
@@ -164,6 +171,11 @@ class NativeMessagingTest : public ::testing::Test,
std::unique_ptr<NativeMessageHost> native_message_host_;
std::unique_ptr<base::RunLoop> run_loop_;
content::TestBrowserThreadBundle thread_bundle_;
+#if defined(OS_POSIX)
+ // Required to watch a file descriptor from NativeMessageProcessHost.
+ base::FileDescriptorWatcher file_descriptor_watcher_;
+#endif
+
std::string last_message_;
std::unique_ptr<base::DictionaryValue> last_message_parsed_;
bool channel_closed_;
« no previous file with comments | « chrome/browser/extensions/api/messaging/native_message_process_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698