OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 public: | 108 public: |
109 LayerTreeHostPerfTestJsonReader() | 109 LayerTreeHostPerfTestJsonReader() |
110 : LayerTreeHostPerfTest() { | 110 : LayerTreeHostPerfTest() { |
111 } | 111 } |
112 | 112 |
113 void ReadTestFile(std::string name) { | 113 void ReadTestFile(std::string name) { |
114 test_name_ = name; | 114 test_name_ = name; |
115 base::FilePath test_data_dir; | 115 base::FilePath test_data_dir; |
116 ASSERT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); | 116 ASSERT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); |
117 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json"); | 117 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json"); |
118 ASSERT_TRUE(file_util::ReadFileToString(json_file, &json_)); | 118 ASSERT_TRUE(base::ReadFileToString(json_file, &json_)); |
119 } | 119 } |
120 | 120 |
121 virtual void BuildTree() OVERRIDE { | 121 virtual void BuildTree() OVERRIDE { |
122 gfx::Size viewport = gfx::Size(720, 1038); | 122 gfx::Size viewport = gfx::Size(720, 1038); |
123 layer_tree_host()->SetViewportSize(viewport); | 123 layer_tree_host()->SetViewportSize(viewport); |
124 scoped_refptr<Layer> root = ParseTreeFromJson(json_, | 124 scoped_refptr<Layer> root = ParseTreeFromJson(json_, |
125 &fake_content_layer_client_); | 125 &fake_content_layer_client_); |
126 ASSERT_TRUE(root.get()); | 126 ASSERT_TRUE(root.get()); |
127 layer_tree_host()->SetRootLayer(root); | 127 layer_tree_host()->SetRootLayer(root); |
128 } | 128 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 }; | 277 }; |
278 | 278 |
279 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) { | 279 TEST_F(PageScaleImplSidePaintingPerfTest, HeavyPage) { |
280 measure_commit_cost_ = true; | 280 measure_commit_cost_ = true; |
281 ReadTestFile("heavy_layer_tree"); | 281 ReadTestFile("heavy_layer_tree"); |
282 RunTestWithImplSidePainting(); | 282 RunTestWithImplSidePainting(); |
283 } | 283 } |
284 | 284 |
285 } // namespace | 285 } // namespace |
286 } // namespace cc | 286 } // namespace cc |
OLD | NEW |