OLD | NEW |
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/task_scheduler/test_utils.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 { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 246 |
247 // Verify that Push() DCHECKs when a value is inserted twice. | 247 // Verify that Push() DCHECKs when a value is inserted twice. |
248 TEST_F(TaskSchedulerWorkerStackTest, PushTwice) { | 248 TEST_F(TaskSchedulerWorkerStackTest, PushTwice) { |
249 SchedulerWorkerStack stack; | 249 SchedulerWorkerStack stack; |
250 stack.Push(worker_a_.get()); | 250 stack.Push(worker_a_.get()); |
251 EXPECT_DCHECK_DEATH({ stack.Push(worker_a_.get()); }, ""); | 251 EXPECT_DCHECK_DEATH({ stack.Push(worker_a_.get()); }, ""); |
252 } | 252 } |
253 | 253 |
254 } // namespace internal | 254 } // namespace internal |
255 } // namespace base | 255 } // namespace base |
OLD | NEW |