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/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 | 71 |
72 class LayerTreeHostPerfTestJsonReader : public LayerTreeHostPerfTest { | 72 class LayerTreeHostPerfTestJsonReader : public LayerTreeHostPerfTest { |
73 public: | 73 public: |
74 LayerTreeHostPerfTestJsonReader() | 74 LayerTreeHostPerfTestJsonReader() |
75 : LayerTreeHostPerfTest() { | 75 : LayerTreeHostPerfTest() { |
76 } | 76 } |
77 | 77 |
78 void readTestFile(std::string name) { | 78 void readTestFile(std::string name) { |
79 test_name_ = name; | 79 test_name_ = name; |
80 FilePath test_data_dir; | 80 base::FilePath test_data_dir; |
81 ASSERT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); | 81 ASSERT_TRUE(PathService::Get(cc::DIR_TEST_DATA, &test_data_dir)); |
82 FilePath json_file = test_data_dir.AppendASCII(name + ".json"); | 82 base::FilePath json_file = test_data_dir.AppendASCII(name + ".json"); |
83 ASSERT_TRUE(file_util::ReadFileToString(json_file, &json_)); | 83 ASSERT_TRUE(file_util::ReadFileToString(json_file, &json_)); |
84 } | 84 } |
85 | 85 |
86 virtual void buildTree() OVERRIDE { | 86 virtual void buildTree() OVERRIDE { |
87 gfx::Size viewport = gfx::Size(720, 1038); | 87 gfx::Size viewport = gfx::Size(720, 1038); |
88 m_layerTreeHost->setViewportSize(viewport, viewport); | 88 m_layerTreeHost->setViewportSize(viewport, viewport); |
89 scoped_refptr<Layer> root = ParseTreeFromJson(json_, | 89 scoped_refptr<Layer> root = ParseTreeFromJson(json_, |
90 &fake_content_layer_client_); | 90 &fake_content_layer_client_); |
91 ASSERT_TRUE(root.get()); | 91 ASSERT_TRUE(root.get()); |
92 m_layerTreeHost->setRootLayer(root); | 92 m_layerTreeHost->setRootLayer(root); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 scoped_refptr<Layer> m_scrollable; | 124 scoped_refptr<Layer> m_scrollable; |
125 }; | 125 }; |
126 | 126 |
127 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePage) { | 127 TEST_F(ScrollingLayerTreePerfTest, LongScrollablePage) { |
128 readTestFile("long_scrollable_page"); | 128 readTestFile("long_scrollable_page"); |
129 runTest(false); | 129 runTest(false); |
130 } | 130 } |
131 | 131 |
132 } // namespace | 132 } // namespace |
133 } // namespace cc | 133 } // namespace cc |
OLD | NEW |