Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64e77184 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "libudx: Move ServiceDispatcher from libpdx_uds to libpdx"

parents c8eb923f 5a244ed3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5,12 +5,15 @@ cc_library_static {
        "-Wall",
        "-Wextra",
        "-Werror",
        "-DLOG_TAG=\"libpdx\"",
        "-DTRACE=0",
    ],
    export_include_dirs: ["private"],
    local_include_dirs: ["private"],
    srcs: [
        "client.cpp",
        "service.cpp",
        "service_dispatcher.cpp",
        "status.cpp",
    ],
}
+0 −1
Original line number Diff line number Diff line
#include "pdx/client.h"

#define LOG_TAG "ServiceFramework"
#include <log/log.h>

#include <pdx/trace.h>
+0 −2
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
#include <pdx/mock_client_channel_factory.h>
#include <pdx/mock_message_reader.h>
#include <pdx/mock_message_writer.h>
#include <pdx/mock_service_dispatcher.h>
#include <pdx/mock_service_endpoint.h>

TEST(MockTypes, Instantiation) {
@@ -15,6 +14,5 @@ TEST(MockTypes, Instantiation) {
  android::pdx::MockMessageReader message_reader;
  android::pdx::MockOutputResourceMapper output_resource_mapper;
  android::pdx::MockMessageWriter message_writer;
  android::pdx::MockServiceDispatcher service_dispatcher;
  android::pdx::MockEndpoint endpoint;
}
+0 −24
Original line number Diff line number Diff line
#ifndef ANDROID_PDX_MOCK_SERVICE_DISPATCHER_H_
#define ANDROID_PDX_MOCK_SERVICE_DISPATCHER_H_

#include <gmock/gmock.h>
#include <pdx/service_dispatcher.h>

namespace android {
namespace pdx {

class MockServiceDispatcher : public ServiceDispatcher {
 public:
  MOCK_METHOD1(AddService, int(const std::shared_ptr<Service>& service));
  MOCK_METHOD1(RemoveService, int(const std::shared_ptr<Service>& service));
  MOCK_METHOD0(ReceiveAndDispatch, int());
  MOCK_METHOD1(ReceiveAndDispatch, int(int timeout));
  MOCK_METHOD0(EnterDispatchLoop, int());
  MOCK_METHOD1(SetCanceled, void(bool cancel));
  MOCK_CONST_METHOD0(IsCanceled, bool());
};

}  // namespace pdx
}  // namespace android

#endif  // ANDROID_PDX_MOCK_SERVICE_DISPATCHER_H_
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ class MockEndpoint : public Endpoint {
  MOCK_METHOD0(AllocateMessageState, void*());
  MOCK_METHOD1(FreeMessageState, void(void* state));
  MOCK_METHOD0(Cancel, Status<void>());
  MOCK_CONST_METHOD0(epoll_fd, int());
};

}  // namespace pdx
Loading