Flutter Engine
stub_flutter_api.cc File Reference
#include "flutter/shell/platform/common/cpp/client_wrapper/testing/stub_flutter_api.h"

Go to the source code of this file.

Namespaces

 flutter
 
 flutter::testing
 

Functions

FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger (FlutterDesktopPluginRegistrarRef registrar)
 
void FlutterDesktopPluginRegistrarSetDestructionHandler (FlutterDesktopPluginRegistrarRef registrar, FlutterDesktopOnPluginRegistrarDestroyed callback)
 
bool FlutterDesktopMessengerSend (FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size)
 
bool FlutterDesktopMessengerSendWithReply (FlutterDesktopMessengerRef messenger, const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
 
void FlutterDesktopMessengerSendResponse (FlutterDesktopMessengerRef messenger, const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
 
void FlutterDesktopMessengerSetCallback (FlutterDesktopMessengerRef messenger, const char *channel, FlutterDesktopMessageCallback callback, void *user_data)
 

Variables

static flutter::testing::StubFlutterApis_stub_implementation
 

Function Documentation

◆ FlutterDesktopMessengerSend()

bool FlutterDesktopMessengerSend ( FlutterDesktopMessengerRef  messenger,
const char *  channel,
const uint8_t *  message,
const size_t  message_size 
)

Definition at line 51 of file stub_flutter_api.cc.

Referenced by flutter::BinaryMessengerImpl::Send().

54  {
55  bool result = false;
57  result =
58  s_stub_implementation->MessengerSend(channel, message, message_size);
59  }
60  return result;
61 }
virtual bool MessengerSend(const char *channel, const uint8_t *message, const size_t message_size)
static flutter::testing::StubFlutterApi * s_stub_implementation

◆ FlutterDesktopMessengerSendResponse()

void FlutterDesktopMessengerSendResponse ( FlutterDesktopMessengerRef  messenger,
const FlutterDesktopMessageResponseHandle handle,
const uint8_t *  data,
size_t  data_length 
)

Definition at line 77 of file stub_flutter_api.cc.

Referenced by flutter::IncomingMessageDispatcher::HandleMessage().

81  {
83  s_stub_implementation->MessengerSendResponse(handle, data, data_length);
84  }
85 }
static flutter::testing::StubFlutterApi * s_stub_implementation
virtual void MessengerSendResponse(const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)

◆ FlutterDesktopMessengerSendWithReply()

bool FlutterDesktopMessengerSendWithReply ( FlutterDesktopMessengerRef  messenger,
const char *  channel,
const uint8_t *  message,
const size_t  message_size,
const FlutterDesktopBinaryReply  reply,
void *  user_data 
)

Definition at line 63 of file stub_flutter_api.cc.

Referenced by flutter::BinaryMessengerImpl::Send().

68  {
69  bool result = false;
72  channel, message, message_size, reply, user_data);
73  }
74  return result;
75 }
virtual bool MessengerSendWithReply(const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *user_data)
G_BEGIN_DECLS FlValue gpointer user_data
static flutter::testing::StubFlutterApi * s_stub_implementation

◆ FlutterDesktopMessengerSetCallback()

void FlutterDesktopMessengerSetCallback ( FlutterDesktopMessengerRef  messenger,
const char *  channel,
FlutterDesktopMessageCallback  callback,
void *  user_data 
)

Definition at line 87 of file stub_flutter_api.cc.

Referenced by flutter::BinaryMessengerImpl::SetMessageHandler().

90  {
93  }
94 }
G_BEGIN_DECLS FlValue gpointer user_data
static flutter::testing::StubFlutterApi * s_stub_implementation
virtual void MessengerSetCallback(const char *channel, FlutterDesktopMessageCallback callback, void *user_data)

◆ FlutterDesktopPluginRegistrarGetMessenger()

FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger ( FlutterDesktopPluginRegistrarRef  registrar)

Definition at line 37 of file stub_flutter_api.cc.

38  {
39  // The stub ignores this, so just return an arbitrary non-zero value.
40  return reinterpret_cast<FlutterDesktopMessengerRef>(1);
41 }

◆ FlutterDesktopPluginRegistrarSetDestructionHandler()

void FlutterDesktopPluginRegistrarSetDestructionHandler ( FlutterDesktopPluginRegistrarRef  registrar,
FlutterDesktopOnPluginRegistrarDestroyed  callback 
)

Definition at line 43 of file stub_flutter_api.cc.

Referenced by flutter::PluginRegistrarManager::GetRegistrar().

45  {
48  }
49 }
virtual void PluginRegistrarSetDestructionHandler(FlutterDesktopOnPluginRegistrarDestroyed callback)
static flutter::testing::StubFlutterApi * s_stub_implementation

Variable Documentation

◆ s_stub_implementation

flutter::testing::StubFlutterApi* s_stub_implementation
static

Definition at line 7 of file stub_flutter_api.cc.

Referenced by flutter::testing::StubFlutterApi::GetTestStub().