| Index: base/debug/task_annotator_unittest.cc
|
| diff --git a/base/debug/task_annotator_unittest.cc b/base/debug/task_annotator_unittest.cc
|
| index bfb0e7c91399310044840276e83f8fc13752d5ca..8ceefab9c16412565c1b5e1d7e368981352a247b 100644
|
| --- a/base/debug/task_annotator_unittest.cc
|
| +++ b/base/debug/task_annotator_unittest.cc
|
| @@ -3,8 +3,11 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/debug/task_annotator.h"
|
| +#include "base/base_switches.h"
|
| #include "base/bind.h"
|
| #include "base/pending_task.h"
|
| +#include "base/test/histogram_tester.h"
|
| +#include "base/test/scoped_command_line.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| namespace base {
|
| @@ -28,5 +31,25 @@ TEST(TaskAnnotatorTest, QueueAndRunTask) {
|
| EXPECT_EQ(123, result);
|
| }
|
|
|
| +TEST(TaskAnnotatorTest, TaskTimeHistogram) {
|
| + base::test::ScopedCommandLine scoped_command_line;
|
| + base::CommandLine* command_line = scoped_command_line.GetProcessCommandLine();
|
| + command_line->AppendSwitchASCII(switches::kProfilerTiming, "0");
|
| +
|
| + // --profiler-timing=0
|
| + base::PlatformThread::SetName("Compositor");
|
| +
|
| + HistogramTester histogram_tester;
|
| + TaskAnnotator annotator;
|
| +
|
| + int result = 0;
|
| + PendingTask pending_task(FROM_HERE, BindOnce(&TestTask, &result));
|
| +
|
| + annotator.DidQueueTask("TaskAnnotatorTest::Queue", pending_task);
|
| + annotator.RunTask("TaskAnnotatorTest::Queue", &pending_task);
|
| +
|
| + histogram_tester.ExpectTotalCount("Scheduling.TaskTime.Compositor", 1);
|
| +}
|
| +
|
| } // namespace debug
|
| } // namespace base
|
|
|