Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
fml::testing::MockLogSink Class Reference
Inheritance diagram for fml::testing::MockLogSink:

Public Member Functions

 MockLogSink (fit::closure quitLoop, async_dispatcher_t *dispatcher)
 
void WaitForInterestChange (WaitForInterestChangeCompleter::Sync &completer) override
 
void Connect (fuchsia_logger::LogSinkConnectRequest &request, ConnectCompleter::Sync &completer) override
 
void ConnectStructured (fuchsia_logger::LogSinkConnectStructuredRequest &request, ConnectStructuredCompleter::Sync &completer) override
 
void OnStart () override
 

Detailed Description

Definition at line 56 of file log_interest_listener_unittests.cc.

Constructor & Destructor Documentation

◆ MockLogSink()

fml::testing::MockLogSink::MockLogSink ( fit::closure  quitLoop,
async_dispatcher_t *  dispatcher 
)
inline

Definition at line 59 of file log_interest_listener_unittests.cc.

60 : quit_loop_(std::move(quitLoop)), dispatcher_(dispatcher) {}

Member Function Documentation

◆ Connect()

void fml::testing::MockLogSink::Connect ( fuchsia_logger::LogSinkConnectRequest &  request,
ConnectCompleter::Sync &  completer 
)
inlineoverride

Definition at line 77 of file log_interest_listener_unittests.cc.

78 {}

◆ ConnectStructured()

void fml::testing::MockLogSink::ConnectStructured ( fuchsia_logger::LogSinkConnectStructuredRequest &  request,
ConnectStructuredCompleter::Sync &  completer 
)
inlineoverride

Definition at line 80 of file log_interest_listener_unittests.cc.

82 {}

◆ OnStart()

void fml::testing::MockLogSink::OnStart ( )
inlineoverride

Definition at line 84 of file log_interest_listener_unittests.cc.

84 {
85 ASSERT_EQ(outgoing()->AddProtocol<fuchsia_logger::LogSink>(
86 bindings_.CreateHandler(this, dispatcher_,
87 fidl::kIgnoreBindingClosure)),
88 ZX_OK);
89 }

◆ WaitForInterestChange()

void fml::testing::MockLogSink::WaitForInterestChange ( WaitForInterestChangeCompleter::Sync &  completer)
inlineoverride

Definition at line 62 of file log_interest_listener_unittests.cc.

63 {
64 if (first_call_) {
65 // If it has not been called before, then return a result right away.
66 fuchsia_logger::LogSinkWaitForInterestChangeResponse response = {
67 {.data = {{.min_severity = fuchsia_diagnostics::Severity::kWarn}}}};
68 completer.Reply(fit::ok(response));
69 first_call_ = false;
70 } else {
71 // On the second call, don't return a result.
72 completer_.emplace(completer.ToAsync());
73 quit_loop_();
74 }
75 }
static bool ok(int result)

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