| Index: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
|
| diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
|
| index 564556846d8aceaa4125bf1a9246f8f9c64b0781..4e00051f40a710ee94f55494cd7f71890d459c28 100644
|
| --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
|
| +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
|
| @@ -3826,6 +3826,32 @@ TEST_F(RendererSchedulerImplTest, UnresponsiveMainThread) {
|
| scheduler_->MainThreadSeemsUnresponsive(responsiveness_threshold()));
|
| }
|
|
|
| +// As |responsiveness_threshold| == expected queueing time threshold == 0.2s,
|
| +// for a task shorter than the length of the window (1s), the critical value of
|
| +// the length of task x can be calculated by (x/2) * (x/1) = 0.2, in which x =
|
| +// 0.6324.
|
| +TEST_F(RendererSchedulerImplTest, UnresponsiveMainThreadAboveThreshold) {
|
| + EXPECT_FALSE(
|
| + scheduler_->MainThreadSeemsUnresponsive(responsiveness_threshold()));
|
| +
|
| + AdvanceTimeWithTask(0.64);
|
| + EXPECT_TRUE(
|
| + scheduler_->MainThreadSeemsUnresponsive(responsiveness_threshold()));
|
| +}
|
| +
|
| +// As |responsiveness_threshold| == expected queueing time threshold == 0.2s,
|
| +// for a task shorter than the length of the window (1s), the critical value of
|
| +// the length of task x can be calculated by (x/2) * (x/1) = 0.2, in which x =
|
| +// 0.6324.
|
| +TEST_F(RendererSchedulerImplTest, ResponsiveMainThreadBelowThreshold) {
|
| + EXPECT_FALSE(
|
| + scheduler_->MainThreadSeemsUnresponsive(responsiveness_threshold()));
|
| +
|
| + AdvanceTimeWithTask(0.63);
|
| + EXPECT_FALSE(
|
| + scheduler_->MainThreadSeemsUnresponsive(responsiveness_threshold()));
|
| +}
|
| +
|
| TEST_F(RendererSchedulerImplTest, ResponsiveMainThreadDuringTask) {
|
| EXPECT_FALSE(
|
| scheduler_->MainThreadSeemsUnresponsive(responsiveness_threshold()));
|
|
|