| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/scheduler/renderer/task_time_reporter.h" |
| 6 |
| 7 #include "base/test/histogram_tester.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace scheduler { |
| 11 TEST(TaskTimeReporterTest, LoggingTime) { |
| 12 base::HistogramTester tester; |
| 13 |
| 14 TaskTimeReporter task_time_reporter; |
| 15 for (int i = 1; i <= 101; ++i) { |
| 16 base::TimeDelta duration = base::TimeDelta::FromMilliseconds(1); |
| 17 if (i == 100) { |
| 18 duration = base::TimeDelta::FromMilliseconds(2); |
| 19 } |
| 20 task_time_reporter.ReportTaskTime(duration); |
| 21 } |
| 22 tester.ExpectUniqueSample("RendererScheduler.TaskTime", 2000, 1); |
| 23 } |
| 24 } |
| OLD | NEW |