src/base/task/sequence_manager/sequence_manager_impl_unittest.cc
TEST_P(SequenceManagerTest, DoesNotRecordQueueTimeIfSettingFalse) {
  auto queue = CreateTaskQueue();

  QueueTimeTaskObserver observer;
  sequence_manager()->AddTaskObserver(&observer);

  // We do not record task queue time when the setting is false.
  sequence_manager()->SetAddQueueTimeToTasks(false);
  AdvanceMockTickClock(TimeDelta::FromMilliseconds(99));
  queue->task_runner()->PostTask(FROM_HERE, BindOnce(&NopTask));
  RunLoop().RunUntilIdle();
  EXPECT_THAT(observer.queue_times(), ElementsAre(TimeTicks()));

  sequence_manager()->RemoveTaskObserver(&observer);
}
// TODO(altimin): Add a test that posts an infinite number of other tasks
// from its destructor.
Add a test that posts an infinite number of other tasks
from its destructor.
Add a test that posts an infinite number of other tasks from its destructor .
TEST_P(SequenceManagerTest, DoesNotRecordQueueTimeIfSettingFalse) {
  auto queue = CreateTaskQueue();
  QueueTimeTaskObserver observer;
  sequence_manager()->AddTaskObserver(&observer);
  sequence_manager()->SetAddQueueTimeToTasks(false);
  AdvanceMockTickClock(TimeDelta::FromMilliseconds(99));
  queue->task_runner()->PostTask(FROM_HERE, BindOnce(&NopTask));
  RunLoop().RunUntilIdle();
  EXPECT_THAT(observer.queue_times(), ElementsAre(TimeTicks()));
  sequence_manager()->RemoveTaskObserver(&observer);
}
TEST_P ( SequenceManagerTest , DoesNotRecordQueueTimeIfSettingFalse ) { auto queue = CreateTaskQueue ( ) ; QueueTimeTaskObserver observer ; sequence_manager ( ) -> AddTaskObserver ( & observer ) ; sequence_manager ( ) -> SetAddQueueTimeToTasks ( false ) ; AdvanceMockTickClock ( TimeDelta :: FromMilliseconds ( 99 ) ) ; queue -> task_runner ( ) -> PostTask ( FROM_HERE , BindOnce ( & NopTask ) ) ; RunLoop ( ) . RunUntilIdle ( ) ; EXPECT_THAT ( observer . queue_times ( ) , ElementsAre ( TimeTicks ( ) ) ) ; sequence_manager ( ) -> RemoveTaskObserver ( & observer ) ; }
TODO(altimin): Add a test that posts an infinite number of other tasks
from its destructor.
TODO ( altimin ) : Add a test that posts an infinite number of other tasks from its destructor .
// We do not record task queue time when the setting is false.