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/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void ReadTestFile(std::string name) { | 82 void ReadTestFile(std::string name) { |
83 test_name_ = name; | 83 test_name_ = name; |
84 base::FilePath test_data_dir; | 84 base::FilePath test_data_dir; |
85 ASSERT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); | 85 ASSERT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); |
86 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json"); | 86 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json"); |
87 ASSERT_TRUE(file_util::ReadFileToString(json_file, &json_)); | 87 ASSERT_TRUE(file_util::ReadFileToString(json_file, &json_)); |
88 } | 88 } |
89 | 89 |
90 virtual void BuildTree() OVERRIDE { | 90 virtual void BuildTree() OVERRIDE { |
91 gfx::Size viewport = gfx::Size(720, 1038); | 91 gfx::Size viewport = gfx::Size(720, 1038); |
92 layer_tree_host()->SetViewportSize(viewport, viewport); | 92 layer_tree_host()->SetViewportSize(viewport); |
93 scoped_refptr<Layer> root = ParseTreeFromJson(json_, | 93 scoped_refptr<Layer> root = ParseTreeFromJson(json_, |
94 &fake_content_layer_client_); | 94 &fake_content_layer_client_); |
95 ASSERT_TRUE(root.get()); | 95 ASSERT_TRUE(root.get()); |
96 layer_tree_host()->SetRootLayer(root); | 96 layer_tree_host()->SetRootLayer(root); |
97 } | 97 } |
98 | 98 |
99 private: | 99 private: |
100 std::string json_; | 100 std::string json_; |
101 }; | 101 }; |
102 | 102 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 scoped_refptr<Layer> scrollable_; | 136 scoped_refptr<Layer> scrollable_; |
137 }; | 137 }; |
138 | 138 |
139 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePage) { | 139 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePage) { |
140 ReadTestFile("long_scrollable_page"); | 140 ReadTestFile("long_scrollable_page"); |
141 RunTest(false); | 141 RunTest(false); |
142 } | 142 } |
143 | 143 |
144 } // namespace | 144 } // namespace |
145 } // namespace cc | 145 } // namespace cc |
OLD | NEW |