Flutter Engine
stub_flutter_api.cc File Reference
#include "flutter/shell/platform/common/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)
 
FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar (FlutterDesktopPluginRegistrarRef registrar)
 
int64_t FlutterDesktopTextureRegistrarRegisterExternalTexture (FlutterDesktopTextureRegistrarRef texture_registrar, const FlutterDesktopTextureInfo *info)
 
bool FlutterDesktopTextureRegistrarUnregisterExternalTexture (FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id)
 
bool FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable (FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id)
 

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)
GAsyncResult * result
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 }
void * user_data
GAsyncResult * result
virtual bool MessengerSendWithReply(const char *channel, const uint8_t *message, const size_t message_size, const FlutterDesktopBinaryReply reply, void *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 }
void * user_data
FlKeyEvent FlKeyResponderAsyncCallback callback
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)
FlKeyEvent FlKeyResponderAsyncCallback callback
static flutter::testing::StubFlutterApi * s_stub_implementation

◆ FlutterDesktopRegistrarGetTextureRegistrar()

FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar ( FlutterDesktopPluginRegistrarRef  registrar)

Definition at line 96 of file stub_flutter_api.cc.

97  {
98  return reinterpret_cast<FlutterDesktopTextureRegistrarRef>(1);
99 }
struct FlutterDesktopTextureRegistrar * FlutterDesktopTextureRegistrarRef

◆ FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable()

bool FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable ( FlutterDesktopTextureRegistrarRef  texture_registrar,
int64_t  texture_id 
)

Definition at line 123 of file stub_flutter_api.cc.

Referenced by flutter::TextureRegistrarImpl::MarkTextureFrameAvailable().

125  {
126  bool result = false;
127  if (s_stub_implementation) {
129  texture_id);
130  }
131  return result;
132 }
int64_t texture_id
GAsyncResult * result
virtual bool TextureRegistrarMarkTextureFrameAvailable(int64_t texture_id)
static flutter::testing::StubFlutterApi * s_stub_implementation

◆ FlutterDesktopTextureRegistrarRegisterExternalTexture()

int64_t FlutterDesktopTextureRegistrarRegisterExternalTexture ( FlutterDesktopTextureRegistrarRef  texture_registrar,
const FlutterDesktopTextureInfo info 
)

Definition at line 101 of file stub_flutter_api.cc.

Referenced by flutter::TextureRegistrarImpl::RegisterTexture().

103  {
104  uint64_t result = -1;
105  if (s_stub_implementation) {
106  result =
108  }
109  return result;
110 }
GAsyncResult * result
static flutter::testing::StubFlutterApi * s_stub_implementation
virtual int64_t TextureRegistrarRegisterExternalTexture(const FlutterDesktopTextureInfo *info)

◆ FlutterDesktopTextureRegistrarUnregisterExternalTexture()

bool FlutterDesktopTextureRegistrarUnregisterExternalTexture ( FlutterDesktopTextureRegistrarRef  texture_registrar,
int64_t  texture_id 
)

Definition at line 112 of file stub_flutter_api.cc.

Referenced by flutter::TextureRegistrarImpl::UnregisterTexture().

114  {
115  bool result = false;
116  if (s_stub_implementation) {
118  texture_id);
119  }
120  return result;
121 }
int64_t texture_id
GAsyncResult * result
virtual bool TextureRegistrarUnregisterExternalTexture(int64_t texture_id)
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().