diff options
author | Daichi Hirono | 2017-03-05 23:02:42 -0600 |
---|---|---|
committer | Daichi Hirono | 2017-03-13 19:09:29 -0500 |
commit | 57b780fbc3e2c2442c2f58dcb83818e786246b35 (patch) | |
tree | cf2426a800b3566d8f65b884831bf75e42cd47e1 /libappfuse/tests/FuseAppLoopTest.cc | |
parent | cc9d94ce04dbb63a745001323213bb667ea2e00f (diff) | |
download | platform-system-core-57b780fbc3e2c2442c2f58dcb83818e786246b35.tar.gz platform-system-core-57b780fbc3e2c2442c2f58dcb83818e786246b35.tar.xz platform-system-core-57b780fbc3e2c2442c2f58dcb83818e786246b35.zip |
Add ReadOrAgain and WriteOrAgain methods to FuseMessage.
These methods return kAgain if operation cannot be done without blocking
the current thread.
The CL also introduecs new helper function SetupMessageSockets so that
FuseMessages are always transfered via sockets that save message
boundaries.
Bug: 34903085
Test: libappfuse_test
Change-Id: I34544372cc1b0c7bc9622e581ae16c018a123fa9
Diffstat (limited to 'libappfuse/tests/FuseAppLoopTest.cc')
-rw-r--r-- | libappfuse/tests/FuseAppLoopTest.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libappfuse/tests/FuseAppLoopTest.cc b/libappfuse/tests/FuseAppLoopTest.cc index 25906cf1c..64dd81330 100644 --- a/libappfuse/tests/FuseAppLoopTest.cc +++ b/libappfuse/tests/FuseAppLoopTest.cc | |||
@@ -109,10 +109,7 @@ class FuseAppLoopTest : public ::testing::Test { | |||
109 | 109 | ||
110 | void SetUp() override { | 110 | void SetUp() override { |
111 | base::SetMinimumLogSeverity(base::VERBOSE); | 111 | base::SetMinimumLogSeverity(base::VERBOSE); |
112 | int sockets[2]; | 112 | ASSERT_TRUE(SetupMessageSockets(&sockets_)); |
113 | ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sockets)); | ||
114 | sockets_[0].reset(sockets[0]); | ||
115 | sockets_[1].reset(sockets[1]); | ||
116 | thread_ = std::thread([this] { | 113 | thread_ = std::thread([this] { |
117 | StartFuseAppLoop(sockets_[1].release(), &callback_); | 114 | StartFuseAppLoop(sockets_[1].release(), &callback_); |
118 | }); | 115 | }); |