Flutter Engine
The Flutter Engine
Protected Member Functions | Protected Attributes | List of all members
flutter::testing::MockMessageQueue Class Referenceabstract

#include <test_keyboard.h>

Protected Member Functions

void PushBack (const Win32Message *message)
 
LRESULT DispatchFront ()
 
BOOL Win32PeekMessage (LPMSG lpMsg, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
 
virtual LRESULT Win32SendMessage (UINT const message, WPARAM const wparam, LPARAM const lparam)=0
 

Protected Attributes

std::list< Win32Message_pending_messages
 
std::list< Win32Message_sent_messages
 

Detailed Description

Definition at line 115 of file test_keyboard.h.

Member Function Documentation

◆ DispatchFront()

LRESULT flutter::testing::MockMessageQueue::DispatchFront ( )
protected

Definition at line 209 of file test_keyboard.cc.

209 {
211 << "Called DispatchFront while pending message queue is empty";
212 Win32Message message = _pending_messages.front();
213 _pending_messages.pop_front();
214 _sent_messages.push_back(message);
216 Win32SendMessage(message.message, message.wParam, message.lParam);
217 if (message.expected_result != kWmResultDontCheck) {
218 EXPECT_EQ(result, message.expected_result)
219 << " This is the " << _sent_messages.size()
220 << ordinal(_sent_messages.size()) << " event, with\n " << std::hex
221 << "Message 0x" << message.message << " LParam 0x" << message.lParam
222 << " WParam 0x" << message.wParam;
223 }
224 return result;
225}
std::list< Win32Message > _pending_messages
std::list< Win32Message > _sent_messages
virtual LRESULT Win32SendMessage(UINT const message, WPARAM const wparam, LPARAM const lparam)=0
GAsyncResult * result
#define FML_DCHECK(condition)
Definition: logging.h:103
Win32Message message
constexpr LRESULT kWmResultDontCheck
Definition: wm_builders.h:16
LONG_PTR LRESULT
Definition: windows_types.h:61

◆ PushBack()

void flutter::testing::MockMessageQueue::PushBack ( const Win32Message message)
protected

Definition at line 205 of file test_keyboard.cc.

205 {
206 _pending_messages.push_back(*message);
207}

◆ Win32PeekMessage()

BOOL flutter::testing::MockMessageQueue::Win32PeekMessage ( LPMSG  lpMsg,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  wRemoveMsg 
)
protected

Definition at line 227 of file test_keyboard.cc.

230 {
231 for (auto iter = _pending_messages.begin(); iter != _pending_messages.end();
232 ++iter) {
233 if (iter->message >= wMsgFilterMin && iter->message <= wMsgFilterMax) {
234 *lpMsg = MSG{
235 .message = iter->message,
236 .wParam = iter->wParam,
237 .lParam = iter->lParam,
238 };
239 if ((wRemoveMsg & PM_REMOVE) == PM_REMOVE) {
240 _pending_messages.erase(iter);
241 }
242 return TRUE;
243 }
244 }
245 return FALSE;
246}
return FALSE
struct tagMSG MSG

◆ Win32SendMessage()

virtual LRESULT flutter::testing::MockMessageQueue::Win32SendMessage ( UINT const  message,
WPARAM const  wparam,
LPARAM const  lparam 
)
protectedpure virtual

Member Data Documentation

◆ _pending_messages

std::list<Win32Message> flutter::testing::MockMessageQueue::_pending_messages
protected

Definition at line 138 of file test_keyboard.h.

◆ _sent_messages

std::list<Win32Message> flutter::testing::MockMessageQueue::_sent_messages
protected

Definition at line 139 of file test_keyboard.h.


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