| 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 27 matching lines...) Expand all Loading... |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class TaskGraphRunnerPerfTest : public testing::Test { | 40 class TaskGraphRunnerPerfTest : public testing::Test { |
| 41 public: | 41 public: |
| 42 TaskGraphRunnerPerfTest() | 42 TaskGraphRunnerPerfTest() |
| 43 : timer_(kWarmupRuns, | 43 : timer_(kWarmupRuns, |
| 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 virtual 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 virtual 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) { | 54 void AfterTest(const std::string& test_name) { |
| 55 // Format matches chrome/test/perf/perf_test.h:PrintResult | 55 // Format matches chrome/test/perf/perf_test.h:PrintResult |
| 56 printf( | 56 printf( |
| 57 "*RESULT %s: %.2f runs/s\n", test_name.c_str(), timer_.LapsPerSecond()); | 57 "*RESULT %s: %.2f runs/s\n", test_name.c_str(), timer_.LapsPerSecond()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void RunBuildTaskGraphTest(const std::string& test_name, | 60 void RunBuildTaskGraphTest(const std::string& test_name, |
| 61 int num_top_level_tasks, | 61 int num_top_level_tasks, |
| 62 int num_tasks, | 62 int num_tasks, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 RunScheduleAndExecuteTasksTest("0_1_0", 0, 1, 0); | 309 RunScheduleAndExecuteTasksTest("0_1_0", 0, 1, 0); |
| 310 RunScheduleAndExecuteTasksTest("0_32_0", 0, 32, 0); | 310 RunScheduleAndExecuteTasksTest("0_32_0", 0, 32, 0); |
| 311 RunScheduleAndExecuteTasksTest("2_1_0", 2, 1, 0); | 311 RunScheduleAndExecuteTasksTest("2_1_0", 2, 1, 0); |
| 312 RunScheduleAndExecuteTasksTest("2_32_0", 2, 32, 0); | 312 RunScheduleAndExecuteTasksTest("2_32_0", 2, 32, 0); |
| 313 RunScheduleAndExecuteTasksTest("2_1_1", 2, 1, 1); | 313 RunScheduleAndExecuteTasksTest("2_1_1", 2, 1, 1); |
| 314 RunScheduleAndExecuteTasksTest("2_32_1", 2, 32, 1); | 314 RunScheduleAndExecuteTasksTest("2_32_1", 2, 32, 1); |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace | 317 } // namespace |
| 318 } // namespace cc | 318 } // namespace cc |
| OLD | NEW |