OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/raster/task_graph_work_queue.h" | 5 #include "cc/raster/task_graph_work_queue.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 namespace { | 10 namespace { |
11 | 11 |
12 class FakeTaskImpl : public Task { | 12 class FakeTaskImpl : public Task { |
13 public: | 13 public: |
14 FakeTaskImpl() {} | 14 FakeTaskImpl() {} |
15 | 15 |
16 // Overridden from Task: | 16 // Overridden from Task: |
17 void RunOnWorkerThread() override{}; | 17 void RunOnWorkerThread() override {} |
18 | 18 |
19 private: | 19 private: |
20 ~FakeTaskImpl() override {} | 20 ~FakeTaskImpl() override {} |
21 DISALLOW_COPY_AND_ASSIGN(FakeTaskImpl); | 21 DISALLOW_COPY_AND_ASSIGN(FakeTaskImpl); |
22 }; | 22 }; |
23 | 23 |
24 TEST(TaskGraphWorkQueueTest, TestChangingDependency) { | 24 TEST(TaskGraphWorkQueueTest, TestChangingDependency) { |
25 TaskGraphWorkQueue work_queue; | 25 TaskGraphWorkQueue work_queue; |
26 NamespaceToken token = work_queue.GenerateNamespaceToken(); | 26 NamespaceToken token = work_queue.GenerateNamespaceToken(); |
27 | 27 |
(...skipping 25 matching lines...) Expand all Loading... |
53 work_queue.GetNextTaskToRun(0u); | 53 work_queue.GetNextTaskToRun(0u); |
54 EXPECT_EQ(prioritized_dependency_task.task.get(), dependency_task.get()); | 54 EXPECT_EQ(prioritized_dependency_task.task.get(), dependency_task.get()); |
55 work_queue.CompleteTask(std::move(prioritized_dependency_task)); | 55 work_queue.CompleteTask(std::move(prioritized_dependency_task)); |
56 | 56 |
57 // We should have no tasks to run, as the dependent task already completed. | 57 // We should have no tasks to run, as the dependent task already completed. |
58 EXPECT_FALSE(work_queue.HasReadyToRunTasks()); | 58 EXPECT_FALSE(work_queue.HasReadyToRunTasks()); |
59 } | 59 } |
60 | 60 |
61 } // namespace | 61 } // namespace |
62 } // namespace cc | 62 } // namespace cc |
OLD | NEW |