Flutter Engine
 
Loading...
Searching...
No Matches
flutter_runner::testing::FakePlatformMessageResponse Class Reference

#include <platform_message.h>

Inheritance diagram for flutter_runner::testing::FakePlatformMessageResponse:
flutter::PlatformMessageResponse fml::RefCountedThreadSafe< PlatformMessageResponse > fml::internal::RefCountedThreadSafeBase

Public Member Functions

void ExpectCompleted (std::string expected)
 
bool IsCompleted ()
 
std::unique_ptr< PlatformMessageWithMessage (std::string channel, std::string message)
 
void Complete (std::unique_ptr< fml::Mapping > data) override
 
void CompleteEmpty () override
 
- Public Member Functions inherited from flutter::PlatformMessageResponse
bool is_complete () const
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< PlatformMessageResponse >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 

Static Public Member Functions

static fml::RefPtr< FakePlatformMessageResponseCreate ()
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::PlatformMessageResponse
 PlatformMessageResponse ()
 
virtual ~PlatformMessageResponse ()
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< PlatformMessageResponse >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 
- Protected Attributes inherited from flutter::PlatformMessageResponse
bool is_complete_ = false
 

Detailed Description

Definition at line 19 of file platform_message.h.

Member Function Documentation

◆ Complete()

void flutter_runner::testing::FakePlatformMessageResponse::Complete ( std::unique_ptr< fml::Mapping data)
inlineoverridevirtual

Implements flutter::PlatformMessageResponse.

Definition at line 43 of file platform_message.h.

43 {
44 response_ =
45 std::string(data->GetMapping(), data->GetMapping() + data->GetSize());
46 FinalizeComplete();
47 };
std::shared_ptr< const fml::Mapping > data

References data.

◆ CompleteEmpty()

void flutter_runner::testing::FakePlatformMessageResponse::CompleteEmpty ( )
inlineoverridevirtual

Implements flutter::PlatformMessageResponse.

Definition at line 49 of file platform_message.h.

49{ FinalizeComplete(); };

◆ Create()

◆ ExpectCompleted()

void flutter_runner::testing::FakePlatformMessageResponse::ExpectCompleted ( std::string  expected)
inline

Definition at line 25 of file platform_message.h.

25 {
26 EXPECT_TRUE(is_complete_);
27 if (is_complete_) {
28 EXPECT_EQ(expected, response_);
29 }
30 }

References flutter::PlatformMessageResponse::is_complete_.

◆ IsCompleted()

bool flutter_runner::testing::FakePlatformMessageResponse::IsCompleted ( )
inline

Definition at line 32 of file platform_message.h.

32{ return is_complete_; }

References flutter::PlatformMessageResponse::is_complete_.

◆ WithMessage()

std::unique_ptr< PlatformMessage > flutter_runner::testing::FakePlatformMessageResponse::WithMessage ( std::string  channel,
std::string  message 
)
inline

Definition at line 34 of file platform_message.h.

35 {
36 return std::make_unique<PlatformMessage>(
37 channel,
39 message.c_str() + message.size()),
41 }
static MallocMapping Copy(const T *begin, const T *end)
Definition mapping.h:162
const gchar * channel
G_BEGIN_DECLS GBytes * message

References channel, fml::MallocMapping::Copy(), and message.


The documentation for this class was generated from the following file: