| 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_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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // Simulates main-thread scrolling on each frame. | 105 // Simulates main-thread scrolling on each frame. |
| 106 class ScrollingLayerTreePerfTest : public LayerTreeHostPerfTestJsonReader { | 106 class ScrollingLayerTreePerfTest : public LayerTreeHostPerfTestJsonReader { |
| 107 public: | 107 public: |
| 108 ScrollingLayerTreePerfTest() | 108 ScrollingLayerTreePerfTest() |
| 109 : LayerTreeHostPerfTestJsonReader() { | 109 : LayerTreeHostPerfTestJsonReader() { |
| 110 } | 110 } |
| 111 | 111 |
| 112 virtual void buildTree() OVERRIDE { | 112 virtual void buildTree() OVERRIDE { |
| 113 LayerTreeHostPerfTestJsonReader::buildTree(); | 113 LayerTreeHostPerfTestJsonReader::buildTree(); |
| 114 m_scrollable = m_layerTreeHost->rootLayer()->children()[1]; | 114 scrollable_ = m_layerTreeHost->rootLayer()->children()[1]; |
| 115 ASSERT_TRUE(m_scrollable); | 115 ASSERT_TRUE(scrollable_); |
| 116 } | 116 } |
| 117 | 117 |
| 118 virtual void layout() OVERRIDE { | 118 virtual void layout() OVERRIDE { |
| 119 static const gfx::Vector2d delta = gfx::Vector2d(0, 10); | 119 static const gfx::Vector2d delta = gfx::Vector2d(0, 10); |
| 120 m_scrollable->setScrollOffset(m_scrollable->scrollOffset() + delta); | 120 scrollable_->SetScrollOffset(scrollable_->scroll_offset() + delta); |
| 121 } | 121 } |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 scoped_refptr<Layer> m_scrollable; | 124 scoped_refptr<Layer> 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 |