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.
5 #include "components/scheduler/child/scheduler_task_runner_delegate_impl.h"
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"
13 TEST(SchedulerTaskRunnerDelegateImplTest
, TestTaskRunnerOverriding
) {
14 base::MessageLoop loop
;
15 scoped_refptr
<base::SingleThreadTaskRunner
> original_runner(
17 scoped_refptr
<base::SingleThreadTaskRunner
> custom_runner(
18 new base::TestSimpleTaskRunner());
20 scoped_refptr
<SchedulerTaskRunnerDelegateImpl
> delegate(
21 SchedulerTaskRunnerDelegateImpl::Create(&loop
));
22 delegate
->SetDefaultTaskRunner(custom_runner
);
23 DCHECK_EQ(custom_runner
, loop
.task_runner());
25 DCHECK_EQ(original_runner
, loop
.task_runner());
28 } // namespace scheduler