Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
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
virtual void Complete (std::unique_ptr< fml::Mapping > data)=0
 
virtual void CompleteEmpty ()=0
 
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
Definition: texture_gles.cc:63

◆ CompleteEmpty()

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

Implements flutter::PlatformMessageResponse.

Definition at line 49 of file platform_message.h.

49{ FinalizeComplete(); };

◆ Create()

static fml::RefPtr< FakePlatformMessageResponse > flutter_runner::testing::FakePlatformMessageResponse::Create ( )
inlinestatic

Definition at line 21 of file platform_message.h.

21 {
22 return fml::AdoptRef(new FakePlatformMessageResponse());
23 }
RefPtr< T > AdoptRef(T *ptr)
Definition: ref_ptr.h:222

◆ ExpectCompleted()

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

Definition at line 25 of file platform_message.h.

25 {
27 if (is_complete_) {
28 EXPECT_EQ(expected, response_);
29 }
30 }
#define EXPECT_TRUE(handle)
Definition: unit_test.h:678

◆ IsCompleted()

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

Definition at line 32 of file platform_message.h.

32{ return 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
Win32Message message

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