Flutter Engine
 
Loading...
Searching...
No Matches
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 ConnectStructured (fuchsia_logger::LogSinkConnectStructuredRequest &request, ConnectStructuredCompleter::Sync &completer) override
 
void OnStart () override
 
void handle_unknown_method (fidl::UnknownMethodMetadata< fuchsia_logger::LogSink > metadata, fidl::UnknownMethodCompleter::Sync &completer) override
 

Detailed Description

Definition at line 61 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 64 of file log_interest_listener_unittests.cc.

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

Member Function Documentation

◆ ConnectStructured()

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

Definition at line 82 of file log_interest_listener_unittests.cc.

84 {}

◆ handle_unknown_method()

void fml::testing::MockLogSink::handle_unknown_method ( fidl::UnknownMethodMetadata< fuchsia_logger::LogSink >  metadata,
fidl::UnknownMethodCompleter::Sync &  completer 
)
inlineoverride

Definition at line 93 of file log_interest_listener_unittests.cc.

95 {}

◆ OnStart()

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

Definition at line 86 of file log_interest_listener_unittests.cc.

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

◆ WaitForInterestChange()

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

Definition at line 67 of file log_interest_listener_unittests.cc.

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

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