Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc

Issue 2866613002: EQT: Change Expected Queuing Time from per-second to sliding window (Closed)
Patch Set: escape backslash Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()));
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698