Flutter Engine
flutter::testing::TestTimeoutListener Class Reference

#include <test_timeout_listener.h>

Inheritance diagram for flutter::testing::TestTimeoutListener:

Public Member Functions

 TestTimeoutListener (fml::TimeDelta timeout)
 
 ~TestTimeoutListener ()
 

Detailed Description

Definition at line 20 of file test_timeout_listener.h.

Constructor & Destructor Documentation

◆ TestTimeoutListener()

flutter::testing::TestTimeoutListener::TestTimeoutListener ( fml::TimeDelta  timeout)

Definition at line 71 of file test_timeout_listener.cc.

References FML_LOG, and fml::TimeDelta::ToSeconds().

72  : timeout_(timeout),
73  listener_thread_("test_timeout_listener"),
74  listener_thread_runner_(listener_thread_.GetTaskRunner()),
75  pending_tests_(PendingTests::Create(listener_thread_runner_, timeout_)) {
76  FML_LOG(INFO) << "Test timeout of " << timeout_.ToSeconds()
77  << " seconds per test case will be enforced.";
78 }
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
Definition: thread.cc:45
constexpr int64_t ToSeconds() const
Definition: time_delta.h:64
#define FML_LOG(severity)
Definition: logging.h:65
static std::shared_ptr< PendingTests > Create(fml::RefPtr< fml::TaskRunner > host_task_runner, fml::TimeDelta timeout)

◆ ~TestTimeoutListener()

flutter::testing::TestTimeoutListener::~TestTimeoutListener ( )

Definition at line 80 of file test_timeout_listener.cc.

References FML_CHECK, and fml::TaskRunner::PostTask().

80  {
81  listener_thread_runner_->PostTask(
82  [tests = std::move(pending_tests_)]() mutable { tests.reset(); });
83  FML_CHECK(pending_tests_ == nullptr);
84 }
virtual void PostTask(const fml::closure &task)
Definition: task_runner.cc:24
#define FML_CHECK(condition)
Definition: logging.h:68

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