| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 void ReadTestFile(const std::string& name) { | 42 void ReadTestFile(const std::string& name) { |
| 43 base::FilePath test_data_dir; | 43 base::FilePath test_data_dir; |
| 44 ASSERT_TRUE(PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir)); | 44 ASSERT_TRUE(PathService::Get(CCPaths::DIR_TEST_DATA, &test_data_dir)); |
| 45 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json"); | 45 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json"); |
| 46 ASSERT_TRUE(base::ReadFileToString(json_file, &json_)); | 46 ASSERT_TRUE(base::ReadFileToString(json_file, &json_)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void SetupTree() override { | 49 void SetupTree() override { |
| 50 gfx::Size viewport = gfx::Size(720, 1038); | 50 gfx::Size viewport = gfx::Size(720, 1038); |
| 51 layer_tree()->SetViewportSize(viewport); | 51 layer_tree_host()->SetViewportSize(viewport); |
| 52 scoped_refptr<Layer> root = | 52 scoped_refptr<Layer> root = |
| 53 ParseTreeFromJson(json_, &content_layer_client_); | 53 ParseTreeFromJson(json_, &content_layer_client_); |
| 54 ASSERT_TRUE(root.get()); | 54 ASSERT_TRUE(root.get()); |
| 55 layer_tree()->SetRootLayer(root); | 55 layer_tree_host()->SetRootLayer(root); |
| 56 content_layer_client_.set_bounds(viewport); | 56 content_layer_client_.set_bounds(viewport); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void SetTestName(const std::string& name) { test_name_ = name; } | 59 void SetTestName(const std::string& name) { test_name_ = name; } |
| 60 | 60 |
| 61 void AfterTest() override { | 61 void AfterTest() override { |
| 62 CHECK(!test_name_.empty()) << "Must SetTestName() before TearDown()."; | 62 CHECK(!test_name_.empty()) << "Must SetTestName() before TearDown()."; |
| 63 perf_test::PrintResult("calc_draw_props_time", | 63 perf_test::PrintResult("calc_draw_props_time", |
| 64 "", | 64 "", |
| 65 test_name_, | 65 test_name_, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 TEST_F(CalcDrawPropsTest, TouchRegionHeavy) { | 143 TEST_F(CalcDrawPropsTest, TouchRegionHeavy) { |
| 144 SetTestName("touch_region_heavy"); | 144 SetTestName("touch_region_heavy"); |
| 145 ReadTestFile("touch_region_heavy"); | 145 ReadTestFile("touch_region_heavy"); |
| 146 RunCalcDrawProps(); | 146 RunCalcDrawProps(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace | 149 } // namespace |
| 150 } // namespace cc | 150 } // namespace cc |
| OLD | NEW |