1 // Copyright 2014 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.
5 #include "base/debug/task_annotator.h"
7 #include "base/pending_task.h"
8 #include "testing/gtest/include/gtest/gtest.h"
14 void TestTask(int* result) {
20 TEST(TaskAnnotatorTest, QueueAndRunTask) {
22 PendingTask pending_task(FROM_HERE, Bind(&TestTask, &result));
24 TaskAnnotator annotator;
25 annotator.DidQueueTask("TaskAnnotatorTest::Queue", pending_task);
28 "TaskAnnotatorTest::Queue", "TaskAnnotatorTest::Run", pending_task);
29 EXPECT_EQ(123, result);