5#ifndef FLUTTER_SHELL_PLATFORM_LINUX_TESTING_MOCK_BINARY_MESSENGER_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_TESTING_MOCK_BINARY_MESSENGER_H_
8#include <unordered_map>
10#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
12#include "gmock/gmock.h"
27 operator FlBinaryMessenger*();
31 (FlBinaryMessenger * messenger,
35 GDestroyNotify destroy_notify));
39 (FlBinaryMessenger * messenger,
40 FlBinaryMessengerResponseHandle* response_handle,
46 (FlBinaryMessenger * messenger,
49 GCancellable* cancellable,
55 (FlBinaryMessenger * messenger,
61 (FlBinaryMessenger * messenger,
67 (FlBinaryMessenger * messenger,
80 FlBinaryMessenger* instance_ =
nullptr;
81 std::unordered_map<std::string, FlBinaryMessengerMessageHandler>
83 std::unordered_map<std::string, FlBinaryMessengerResponseHandle*>
85 std::unordered_map<std::string, gpointer> user_datas_;
bool HasMessageHandler(const gchar *channel) const
MOCK_METHOD(void, fl_binary_messenger_send_on_channel,(FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data))
MOCK_METHOD(gboolean, fl_binary_messenger_send_response,(FlBinaryMessenger *messenger, FlBinaryMessengerResponseHandle *response_handle, GBytes *response, GError **error))
MOCK_METHOD(void, fl_binary_messenger_resize_channel,(FlBinaryMessenger *messenger, const gchar *channel, int64_t new_size))
MOCK_METHOD(void, fl_binary_messenger_set_message_handler_on_channel,(FlBinaryMessenger *messenger, const gchar *channel, FlBinaryMessengerMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify))
void ReceiveMessage(const gchar *channel, GBytes *message)
MOCK_METHOD(void, fl_binary_messenger_set_warns_on_channel_overflow,(FlBinaryMessenger *messenger, const gchar *channel, bool warns))
void SetMessageHandler(const gchar *channel, FlBinaryMessengerMessageHandler handler, gpointer user_data)
MOCK_METHOD(GBytes *, fl_binary_messenger_send_on_channel_finish,(FlBinaryMessenger *messenger, GAsyncResult *result, GError **error))
G_MODULE_EXPORT GBytes * fl_binary_messenger_send_on_channel_finish(FlBinaryMessenger *self, GAsyncResult *result, GError **error)
G_MODULE_EXPORT void fl_binary_messenger_resize_channel(FlBinaryMessenger *self, const gchar *channel, int64_t new_size)
G_MODULE_EXPORT void fl_binary_messenger_set_message_handler_on_channel(FlBinaryMessenger *self, const gchar *channel, FlBinaryMessengerMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
G_MODULE_EXPORT void fl_binary_messenger_send_on_channel(FlBinaryMessenger *self, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
G_MODULE_EXPORT gboolean fl_binary_messenger_send_response(FlBinaryMessenger *self, FlBinaryMessengerResponseHandle *response_handle, GBytes *response, GError **error)
G_MODULE_EXPORT void fl_binary_messenger_set_warns_on_channel_overflow(FlBinaryMessenger *self, const gchar *channel, bool warns)
G_MODULE_EXPORT GObject typedef void(* FlBinaryMessengerMessageHandler)(FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error