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

Unified Diff: components/scheduler/renderer/idle_time_estimator_unittest.cc

Issue 1409073002: Make IdleTimeEstimator ignore nested tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Needs to be DCHECK_GE Created 5 years, 2 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 | « components/scheduler/renderer/idle_time_estimator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/renderer/idle_time_estimator_unittest.cc
diff --git a/components/scheduler/renderer/idle_time_estimator_unittest.cc b/components/scheduler/renderer/idle_time_estimator_unittest.cc
index 8f34944304e95e4db7347f6435df18d0aa56693c..38e90d7b934d00c10dd27108f1fcc8fd668cbca1 100644
--- a/components/scheduler/renderer/idle_time_estimator_unittest.cc
+++ b/components/scheduler/renderer/idle_time_estimator_unittest.cc
@@ -143,4 +143,22 @@ TEST_F(IdleTimeEstimatorTest, Estimation_MultipleTasks) {
estimator_->GetExpectedIdleDuration(frame_length_));
}
+TEST_F(IdleTimeEstimatorTest, IgnoresNestedTasks) {
+ SimulateFrameWithOneCompositorTask(5);
+ SimulateFrameWithOneCompositorTask(5);
+
+ base::PendingTask task(FROM_HERE, base::Closure());
+ estimator_->WillProcessTask(task);
+ SimulateFrameWithTwoCompositorTasks(4, 4);
+ SimulateFrameWithTwoCompositorTasks(4, 4);
+ SimulateFrameWithTwoCompositorTasks(4, 4);
+ SimulateFrameWithTwoCompositorTasks(4, 4);
+ estimator_->DidCommitFrameToCompositor();
+ estimator_->DidProcessTask(task);
+
+ EXPECT_EQ(base::TimeDelta::FromMilliseconds(11),
+ estimator_->GetExpectedIdleDuration(frame_length_));
+}
+
+
} // namespace scheduler
« no previous file with comments | « components/scheduler/renderer/idle_time_estimator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698