| 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/resources/task_graph_runner.h" | 5 #include "cc/resources/task_graph_runner.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 44 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
| 45 kTimeCheckInterval) {} | 45 kTimeCheckInterval) {} |
| 46 | 46 |
| 47 // Overridden from testing::Test: | 47 // Overridden from testing::Test: |
| 48 void SetUp() override { | 48 void SetUp() override { |
| 49 task_graph_runner_ = make_scoped_ptr(new TaskGraphRunner); | 49 task_graph_runner_ = make_scoped_ptr(new TaskGraphRunner); |
| 50 namespace_token_ = task_graph_runner_->GetNamespaceToken(); | 50 namespace_token_ = task_graph_runner_->GetNamespaceToken(); |
| 51 } | 51 } |
| 52 void TearDown() override { task_graph_runner_ = nullptr; } | 52 void TearDown() override { task_graph_runner_ = nullptr; } |
| 53 | 53 |
| 54 void AfterTest(const std::string& test_name) { | |
| 55 // Format matches chrome/test/perf/perf_test.h:PrintResult | |
| 56 printf( | |
| 57 "*RESULT %s: %.2f runs/s\n", test_name.c_str(), timer_.LapsPerSecond()); | |
| 58 } | |
| 59 | |
| 60 void RunBuildTaskGraphTest(const std::string& test_name, | 54 void RunBuildTaskGraphTest(const std::string& test_name, |
| 61 int num_top_level_tasks, | 55 int num_top_level_tasks, |
| 62 int num_tasks, | 56 int num_tasks, |
| 63 int num_leaf_tasks) { | 57 int num_leaf_tasks) { |
| 64 PerfTaskImpl::Vector top_level_tasks; | 58 PerfTaskImpl::Vector top_level_tasks; |
| 65 PerfTaskImpl::Vector tasks; | 59 PerfTaskImpl::Vector tasks; |
| 66 PerfTaskImpl::Vector leaf_tasks; | 60 PerfTaskImpl::Vector leaf_tasks; |
| 67 CreateTasks(num_top_level_tasks, &top_level_tasks); | 61 CreateTasks(num_top_level_tasks, &top_level_tasks); |
| 68 CreateTasks(num_tasks, &tasks); | 62 CreateTasks(num_tasks, &tasks); |
| 69 CreateTasks(num_leaf_tasks, &leaf_tasks); | 63 CreateTasks(num_leaf_tasks, &leaf_tasks); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 RunScheduleAndExecuteTasksTest("0_1_0", 0, 1, 0); | 303 RunScheduleAndExecuteTasksTest("0_1_0", 0, 1, 0); |
| 310 RunScheduleAndExecuteTasksTest("0_32_0", 0, 32, 0); | 304 RunScheduleAndExecuteTasksTest("0_32_0", 0, 32, 0); |
| 311 RunScheduleAndExecuteTasksTest("2_1_0", 2, 1, 0); | 305 RunScheduleAndExecuteTasksTest("2_1_0", 2, 1, 0); |
| 312 RunScheduleAndExecuteTasksTest("2_32_0", 2, 32, 0); | 306 RunScheduleAndExecuteTasksTest("2_32_0", 2, 32, 0); |
| 313 RunScheduleAndExecuteTasksTest("2_1_1", 2, 1, 1); | 307 RunScheduleAndExecuteTasksTest("2_1_1", 2, 1, 1); |
| 314 RunScheduleAndExecuteTasksTest("2_32_1", 2, 32, 1); | 308 RunScheduleAndExecuteTasksTest("2_32_1", 2, 32, 1); |
| 315 } | 309 } |
| 316 | 310 |
| 317 } // namespace | 311 } // namespace |
| 318 } // namespace cc | 312 } // namespace cc |
| OLD | NEW |