| Index: components/scheduler/renderer/task_time_reporter_unittest.cc
|
| diff --git a/components/scheduler/renderer/task_time_reporter_unittest.cc b/components/scheduler/renderer/task_time_reporter_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5f59a1f6303a77f55969bcc6e4e2fed1ca9dbd53
|
| --- /dev/null
|
| +++ b/components/scheduler/renderer/task_time_reporter_unittest.cc
|
| @@ -0,0 +1,24 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "components/scheduler/renderer/task_time_reporter.h"
|
| +
|
| +#include "base/test/histogram_tester.h"
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace scheduler {
|
| +TEST(TaskTimeReporterTest, LoggingTime) {
|
| + base::HistogramTester tester;
|
| +
|
| + TaskTimeReporter task_time_reporter;
|
| + for (int i = 1; i <= 101; ++i) {
|
| + base::TimeDelta duration = base::TimeDelta::FromMilliseconds(1);
|
| + if (i == 100) {
|
| + duration = base::TimeDelta::FromMilliseconds(2);
|
| + }
|
| + task_time_reporter.ReportTaskTime(duration);
|
| + }
|
| + tester.ExpectUniqueSample("RendererScheduler.TaskTime", 2000, 1);
|
| +}
|
| +}
|
|
|