diff options
Diffstat (limited to 'src/ipc/host_impl_unittest.cc')
-rw-r--r-- | src/ipc/host_impl_unittest.cc | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/ipc/host_impl_unittest.cc b/src/ipc/host_impl_unittest.cc index 0624cd781..121f57bac 100644 --- a/src/ipc/host_impl_unittest.cc +++ b/src/ipc/host_impl_unittest.cc @@ -18,20 +18,21 @@ #include <memory> -#include "perfetto/ext/base/file_utils.h" -#include "perfetto/ext/base/scoped_file.h" -#include "perfetto/ext/base/temp_file.h" -#include "perfetto/ext/base/unix_socket.h" -#include "perfetto/ext/base/utils.h" -#include "perfetto/ext/ipc/service.h" -#include "perfetto/ext/ipc/service_descriptor.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" +#include "perfetto/base/file_utils.h" +#include "perfetto/base/scoped_file.h" +#include "perfetto/base/temp_file.h" +#include "perfetto/base/unix_socket.h" +#include "perfetto/base/utils.h" +#include "perfetto/ipc/service.h" +#include "perfetto/ipc/service_descriptor.h" #include "src/base/test/test_task_runner.h" #include "src/ipc/buffered_frame_deserializer.h" #include "src/ipc/test/test_socket.h" -#include "test/gtest_and_gmock.h" -#include "protos/perfetto/ipc/wire_protocol.pb.h" #include "src/ipc/test/client_unittest_messages.pb.h" +#include "src/ipc/wire_protocol.pb.h" namespace perfetto { namespace ipc { @@ -88,9 +89,7 @@ class FakeClient : public base::UnixSocket::EventListener { MOCK_METHOD0(OnRequestError, void()); explicit FakeClient(base::TaskRunner* task_runner) { - sock_ = base::UnixSocket::Connect(kSockName, this, task_runner, - base::SockFamily::kUnix, - base::SockType::kStream); + sock_ = base::UnixSocket::Connect(kSockName, this, task_runner); } ~FakeClient() override = default; @@ -286,7 +285,7 @@ TEST_F(HostImplTest, InvokeMethodDropReply) { // OnFakeMethod1 will: // - Do nothing on the 1st call, when |drop_reply| == true. - // - Reply on the 2nd call, when |drop_reply| == false. + // - Reply on the the 2nd call, when |drop_reply| == false. EXPECT_CALL(*fake_service, OnFakeMethod1(_, _)) .Times(2) .WillRepeatedly(Invoke([](const RequestProto& req, DeferredBase* reply) { @@ -336,15 +335,15 @@ TEST_F(HostImplTest, SendFileDescriptor) { sizeof(kFileContent))), sizeof(kFileContent)); EXPECT_CALL(*fake_service, OnFakeMethod1(_, _)) - .WillOnce(Invoke( - [on_reply_sent, &tx_file](const RequestProto&, DeferredBase* reply) { - std::unique_ptr<ReplyProto> reply_args(new ReplyProto()); - auto async_res = AsyncResult<ProtoMessage>( - std::unique_ptr<ProtoMessage>(reply_args.release())); - async_res.set_fd(tx_file.fd()); - reply->Resolve(std::move(async_res)); - on_reply_sent(); - })); + .WillOnce(Invoke([on_reply_sent, &tx_file](const RequestProto&, + DeferredBase* reply) { + std::unique_ptr<ReplyProto> reply_args(new ReplyProto()); + auto async_res = AsyncResult<ProtoMessage>( + std::unique_ptr<ProtoMessage>(reply_args.release())); + async_res.set_fd(tx_file.fd()); + reply->Resolve(std::move(async_res)); + on_reply_sent(); + })); task_runner_->RunUntilCheckpoint("on_reply_sent"); tx_file.ReleaseFD(); |