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

Side by Side Diff: base/test/task_runner_test_template.h

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/test/sequenced_task_runner_test_template.h ('k') | base/test/test_listener_ios.mm » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file defines tests that implementations of TaskRunner should 5 // This file defines tests that implementations of TaskRunner should
6 // pass in order to be conformant, as well as test cases for optional behavior. 6 // pass in order to be conformant, as well as test cases for optional behavior.
7 // Here's how you use it to test your implementation. 7 // Here's how you use it to test your implementation.
8 // 8 //
9 // Say your class is called MyTaskRunner. Then you need to define a 9 // Say your class is called MyTaskRunner. Then you need to define a
10 // class called MyTaskRunnerTestDelegate in my_task_runner_unittest.cc 10 // class called MyTaskRunnerTestDelegate in my_task_runner_unittest.cc
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "base/bind.h" 61 #include "base/bind.h"
62 #include "base/callback.h" 62 #include "base/callback.h"
63 #include "base/location.h" 63 #include "base/location.h"
64 #include "base/memory/ref_counted.h" 64 #include "base/memory/ref_counted.h"
65 #include "base/single_thread_task_runner.h" 65 #include "base/single_thread_task_runner.h"
66 #include "base/synchronization/condition_variable.h" 66 #include "base/synchronization/condition_variable.h"
67 #include "base/synchronization/lock.h" 67 #include "base/synchronization/lock.h"
68 #include "base/task_runner.h" 68 #include "base/task_runner.h"
69 #include "base/threading/thread.h" 69 #include "base/threading/thread.h"
70 #include "base/tracked_objects.h" 70 #include "base/tracked_objects.h"
71 #include "testing/gtest/include/gtest/gtest.h" 71 #include "testing/gtest/googletest/include/gtest/gtest.h"
72 72
73 namespace base { 73 namespace base {
74 74
75 namespace internal { 75 namespace internal {
76 76
77 // Utility class that keeps track of how many times particular tasks 77 // Utility class that keeps track of how many times particular tasks
78 // are run. 78 // are run.
79 class TaskTracker : public RefCountedThreadSafe<TaskTracker> { 79 class TaskTracker : public RefCountedThreadSafe<TaskTracker> {
80 public: 80 public:
81 TaskTracker(); 81 TaskTracker();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 this->task_tracker_->GetTaskRunCounts()); 225 this->task_tracker_->GetTaskRunCounts());
226 } 226 }
227 227
228 // TaskRunnerAffinityTest tests that the TaskRunner implementation 228 // TaskRunnerAffinityTest tests that the TaskRunner implementation
229 // can determine if tasks will never be run on a specific thread. 229 // can determine if tasks will never be run on a specific thread.
230 REGISTER_TYPED_TEST_CASE_P(TaskRunnerAffinityTest, RunsTasksOnCurrentThread); 230 REGISTER_TYPED_TEST_CASE_P(TaskRunnerAffinityTest, RunsTasksOnCurrentThread);
231 231
232 } // namespace base 232 } // namespace base
233 233
234 #endif // BASE_TEST_TASK_RUNNER_TEST_TEMPLATE_H_ 234 #endif // BASE_TEST_TASK_RUNNER_TEST_TEMPLATE_H_
OLDNEW
« no previous file with comments | « base/test/sequenced_task_runner_test_template.h ('k') | base/test/test_listener_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698