Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: base/debug/task_annotator_unittest.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/debug/task_annotator.cc ('k') | base/file_version_info_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/debug/task_annotator.h" 5 #include "base/debug/task_annotator.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/pending_task.h" 7 #include "base/pending_task.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace base { 10 namespace base {
11 namespace debug { 11 namespace debug {
12 namespace { 12 namespace {
13 13
14 void TestTask(int* result) { 14 void TestTask(int* result) {
15 *result = 123; 15 *result = 123;
16 } 16 }
17 17
18 } // namespace 18 } // namespace
19 19
20 TEST(TaskAnnotatorTest, QueueAndRunTask) { 20 TEST(TaskAnnotatorTest, QueueAndRunTask) {
21 int result = 0; 21 int result = 0;
22 PendingTask pending_task(FROM_HERE, Bind(&TestTask, &result)); 22 PendingTask pending_task(FROM_HERE, Bind(&TestTask, &result));
23 23
24 TaskAnnotator annotator; 24 TaskAnnotator annotator;
25 annotator.DidQueueTask("TaskAnnotatorTest::Queue", pending_task); 25 annotator.DidQueueTask("TaskAnnotatorTest::Queue", pending_task);
26 EXPECT_EQ(0, result); 26 EXPECT_EQ(0, result);
27 annotator.RunTask( 27 annotator.RunTask("TaskAnnotatorTest::Queue", pending_task);
28 "TaskAnnotatorTest::Queue", "TaskAnnotatorTest::Run", pending_task);
29 EXPECT_EQ(123, result); 28 EXPECT_EQ(123, result);
30 } 29 }
31 30
32 } // namespace debug 31 } // namespace debug
33 } // namespace base 32 } // namespace base
OLDNEW
« no previous file with comments | « base/debug/task_annotator.cc ('k') | base/file_version_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698