OLD | NEW |
| (Empty) |
1 // Copyright 2015 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. | |
4 | |
5 #include "components/scheduler/child/scheduler_task_runner_delegate_impl.h" | |
6 | |
7 #include "base/message_loop/message_loop.h" | |
8 #include "base/test/test_simple_task_runner.h" | |
9 #include "testing/gtest/include/gtest/gtest.h" | |
10 | |
11 namespace scheduler { | |
12 | |
13 TEST(SchedulerTaskRunnerDelegateImplTest, TestTaskRunnerOverriding) { | |
14 base::MessageLoop loop; | |
15 scoped_refptr<base::SingleThreadTaskRunner> original_runner( | |
16 loop.task_runner()); | |
17 scoped_refptr<base::SingleThreadTaskRunner> custom_runner( | |
18 new base::TestSimpleTaskRunner()); | |
19 { | |
20 scoped_refptr<SchedulerTaskRunnerDelegateImpl> delegate( | |
21 SchedulerTaskRunnerDelegateImpl::Create(&loop)); | |
22 delegate->SetDefaultTaskRunner(custom_runner); | |
23 DCHECK_EQ(custom_runner, loop.task_runner()); | |
24 } | |
25 DCHECK_EQ(original_runner, loop.task_runner()); | |
26 } | |
27 | |
28 } // namespace scheduler | |
OLD | NEW |