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

Side by Side Diff: base/task_scheduler/scheduler_worker_stack_unittest.cc

Issue 2611753004: Change const TimeDelta& to TimeDelta in base/task_scheduler/. (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/task_scheduler/scheduler_worker_stack.h" 5 #include "base/task_scheduler/scheduler_worker_stack.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/task_scheduler/scheduler_worker.h" 10 #include "base/task_scheduler/scheduler_worker.h"
11 #include "base/task_scheduler/sequence.h" 11 #include "base/task_scheduler/sequence.h"
12 #include "base/task_scheduler/task_tracker.h" 12 #include "base/task_scheduler/task_tracker.h"
13 #include "base/test/gtest_util.h" 13 #include "base/test/gtest_util.h"
14 #include "base/threading/platform_thread.h" 14 #include "base/threading/platform_thread.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 namespace base { 18 namespace base {
19 namespace internal { 19 namespace internal {
20 20
21 namespace { 21 namespace {
22 22
23 class MockSchedulerWorkerDelegate : public SchedulerWorker::Delegate { 23 class MockSchedulerWorkerDelegate : public SchedulerWorker::Delegate {
24 public: 24 public:
25 void OnMainEntry(SchedulerWorker* worker) override {} 25 void OnMainEntry(SchedulerWorker* worker) override {}
26 scoped_refptr<Sequence> GetWork(SchedulerWorker* worker) override { 26 scoped_refptr<Sequence> GetWork(SchedulerWorker* worker) override {
27 return nullptr; 27 return nullptr;
28 } 28 }
29 void DidRunTaskWithPriority(TaskPriority task_priority, 29 void DidRunTaskWithPriority(TaskPriority task_priority,
30 const TimeDelta& task_latency) override { 30 TimeDelta task_latency) override {
31 ADD_FAILURE() << "Unexpected call to DidRunTaskWithPriority()"; 31 ADD_FAILURE() << "Unexpected call to DidRunTaskWithPriority()";
32 } 32 }
33 void ReEnqueueSequence(scoped_refptr<Sequence> sequence) override { 33 void ReEnqueueSequence(scoped_refptr<Sequence> sequence) override {
34 ADD_FAILURE() << "Unexpected call to ReEnqueueSequence()"; 34 ADD_FAILURE() << "Unexpected call to ReEnqueueSequence()";
35 } 35 }
36 TimeDelta GetSleepTimeout() override { 36 TimeDelta GetSleepTimeout() override {
37 return TimeDelta::Max(); 37 return TimeDelta::Max();
38 } 38 }
39 bool CanDetach(SchedulerWorker* worker) override { 39 bool CanDetach(SchedulerWorker* worker) override {
40 return false; 40 return false;
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 251
252 // Verify that Push() DCHECKs when a value is inserted twice. 252 // Verify that Push() DCHECKs when a value is inserted twice.
253 TEST_F(TaskSchedulerWorkerStackTest, PushTwice) { 253 TEST_F(TaskSchedulerWorkerStackTest, PushTwice) {
254 SchedulerWorkerStack stack; 254 SchedulerWorkerStack stack;
255 stack.Push(worker_a_.get()); 255 stack.Push(worker_a_.get());
256 EXPECT_DCHECK_DEATH({ stack.Push(worker_a_.get()); }); 256 EXPECT_DCHECK_DEATH({ stack.Push(worker_a_.get()); });
257 } 257 }
258 258
259 } // namespace internal 259 } // namespace internal
260 } // namespace base 260 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_worker_pool_params.cc ('k') | base/task_scheduler/scheduler_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698