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

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

Issue 1320633002: Optimize for TouchStart responsiveness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try set OnPageLoadStarted in RenderFrameImpl::OnNavigate Created 5 years, 3 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/task_cost_estimator.cc ('k') | components/scheduler/renderer/user_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/renderer/task_cost_estimator_unittest.cc
diff --git a/components/scheduler/renderer/task_cost_estimator_unittest.cc b/components/scheduler/renderer/task_cost_estimator_unittest.cc
index 7e104edac5ccfe5b9ea1034bd14730ec3e0351e9..563b747e98c66f3e6e40f6176edbeb05f6b54072 100644
--- a/components/scheduler/renderer/task_cost_estimator_unittest.cc
+++ b/components/scheduler/renderer/task_cost_estimator_unittest.cc
@@ -44,7 +44,20 @@ TEST_F(TaskCostEstimatorTest, BasicEstimation) {
EXPECT_EQ(base::TimeDelta::FromMilliseconds(500),
estimator.expected_task_duration());
-};
+}
+
+TEST_F(TaskCostEstimatorTest, Clear) {
+ TaskCostEstimatorForTest estimator(&clock_, 1, 100);
+ base::PendingTask task(FROM_HERE, base::Closure());
+
+ estimator.WillProcessTask(task);
+ clock_.Advance(base::TimeDelta::FromMilliseconds(500));
+ estimator.DidProcessTask(task);
+
+ estimator.Clear();
+
+ EXPECT_EQ(base::TimeDelta(), estimator.expected_task_duration());
+}
TEST_F(TaskCostEstimatorTest, NestedRunLoop) {
TaskCostEstimatorForTest estimator(&clock_, 1, 100);
@@ -60,6 +73,6 @@ TEST_F(TaskCostEstimatorTest, NestedRunLoop) {
EXPECT_EQ(base::TimeDelta::FromMilliseconds(1000),
estimator.expected_task_duration());
-};
+}
} // namespace scheduler
« no previous file with comments | « components/scheduler/renderer/task_cost_estimator.cc ('k') | components/scheduler/renderer/user_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698