#include "content/browser/scheduler/responsiveness/jank_monitor_impl.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/bind.h"
#include "base/test/test_mock_time_task_runner.h"
#include "content/browser/scheduler/responsiveness/native_event_observer.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace responsiveness {
class TestObserver : public JankMonitor::Observer { … };
class TestMetricSource : public MetricSource { … };
class TestJankMonitor : public JankMonitorImpl { … };
class JankMonitorTest : public testing::Test { … };
TEST_F(JankMonitorTest, LifeCycle) { … }
#define VALIDATE_TEST_OBSERVER_CALLS …
TEST_F(JankMonitorTest, JankUIThread) { … }
TEST_F(JankMonitorTest, JankIOThread) { … }
TEST_F(JankMonitorTest, JankUIThreadReentrant) { … }
TEST_F(JankMonitorTest, ReentrantResponsive) { … }
TEST_F(JankMonitorTest, JankNestedRunLoop) { … }
TEST_F(JankMonitorTest, JankUIAndIOThread) { … }
TEST_F(JankMonitorTest, StartStopTimer) { … }
class TestJankMonitorShutdownRace : public JankMonitorImpl { … };
TEST(JankMonitorShutdownTest, ShutdownRace_TimerRestarted) { … }
class TestJankMonitorShutdownRaceTimerFired : public JankMonitorImpl { … };
TEST(JankMonitorShutdownTest, ShutdownRace_TimerFired) { … }
#undef VALIDATE_TEST_OBSERVER_CALLS
}
}