| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/trees/blocking_task_runner.h" | 5 #include "cc/trees/blocking_task_runner.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "cc/test/ordered_simple_task_runner.h" | 12 #include "cc/test/ordered_simple_task_runner.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 void TestTask(bool* result) { | 18 void TestTask(bool* result) { |
| 19 *result = true; | 19 *result = true; |
| 20 } | 20 } |
| 21 | 21 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 36 { | 36 { |
| 37 BlockingTaskRunner::CapturePostTasks capture(runner.get()); | 37 BlockingTaskRunner::CapturePostTasks capture(runner.get()); |
| 38 runner->PostTask(FROM_HERE, base::Bind(&TestTask, &did_run)); | 38 runner->PostTask(FROM_HERE, base::Bind(&TestTask, &did_run)); |
| 39 EXPECT_FALSE(did_run); | 39 EXPECT_FALSE(did_run); |
| 40 } | 40 } |
| 41 EXPECT_TRUE(did_run); | 41 EXPECT_TRUE(did_run); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 } // namespace cc | 45 } // namespace cc |
| OLD | NEW |